Reference documentation for deal.II version 9.1.0-pre
function_derivative.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_function_derivative_h
17 #define dealii_function_derivative_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/auto_derivative_function.h>
22 #include <deal.II/base/exceptions.h>
23 #include <deal.II/base/function.h>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
27 
44 template <int dim>
46 {
47 public:
54  const Point<dim> & direction,
55  const double h = 1.e-6);
56 
70  const std::vector<Point<dim>> &direction,
71  const double h = 1.e-6);
72 
81  void
87  void
88  set_h(const double h);
89 
90  virtual double
91  value(const Point<dim> &p, const unsigned int component = 0) const override;
92 
93  virtual void
94  vector_value(const Point<dim> &p, Vector<double> &value) const override;
95 
96  virtual void
97  value_list(const std::vector<Point<dim>> &points,
98  std::vector<double> & values,
99  const unsigned int component = 0) const override;
100 
106  std::size_t
107  memory_consumption() const;
108 
109 private:
113  const Function<dim> &f;
114 
118  double h;
119 
124 
128  std::vector<Tensor<1, dim>> incr;
129 };
130 
131 DEAL_II_NAMESPACE_CLOSE
132 
133 #endif
virtual double value(const Point< dim > &p, const unsigned int component=0) const override
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< double > &values, const unsigned int component=0) const override
void set_formula(typename AutoDerivativeFunction< dim >::DifferenceFormula formula=AutoDerivativeFunction< dim >::Euler)
virtual void vector_value(const Point< dim > &p, Vector< double > &value) const override
FunctionDerivative(const Function< dim > &f, const Point< dim > &direction, const double h=1.e-6)
const Function< dim > & f
AutoDerivativeFunction< dim >::DifferenceFormula formula
std::vector< Tensor< 1, dim > > incr
std::size_t memory_consumption() const
void set_h(const double h)