16 #ifndef dealii_function_h 17 #define dealii_function_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 23 #include <deal.II/base/function_time.h> 24 #include <deal.II/base/point.h> 25 #include <deal.II/base/subscriptor.h> 27 #include <deal.II/base/tensor.h> 32 DEAL_II_NAMESPACE_OPEN
35 template <
typename number>
37 template <
int rank,
int dim,
typename Number>
147 template <
int dim,
typename RangeNumberType =
double>
149 typename numbers::NumberTraits<RangeNumberType>::real_type>,
216 virtual RangeNumberType
240 std::vector<RangeNumberType> & values,
241 const unsigned int component = 0)
const;
267 std::vector<std::vector<RangeNumberType>> &values)
const;
293 const unsigned int component = 0)
const;
325 virtual RangeNumberType
340 std::vector<RangeNumberType> & values,
341 const unsigned int component = 0)
const;
372 const unsigned int component = 0)
const;
403 template <
int dim,
typename RangeNumberType =
double>
435 virtual RangeNumberType
436 value(
const Point<dim> &p,
const unsigned int component = 0)
const override;
444 std::vector<RangeNumberType> & return_values,
445 const unsigned int component = 0)
const override;
454 const unsigned int component = 0)
const override;
464 const unsigned int component = 0)
const override;
473 memory_consumption()
const;
496 template <
int dim,
typename RangeNumberType =
double>
514 template <
int dim,
typename RangeNumberType =
double>
523 template <
int dim,
typename RangeNumberType =
double>
543 template <
int dim,
typename RangeNumberType =
double>
553 const RangeNumberType
value,
710 template <
int dim,
typename RangeNumberType =
double>
726 virtual RangeNumberType
727 value(
const Point<dim> &p,
const unsigned int component = 0)
const override;
778 template <
int dim,
typename RangeNumberType =
double>
780 :
public Function<dim, RangeNumberType>
804 virtual RangeNumberType
805 value(
const Point<dim> &p,
const unsigned int component = 0)
const override;
868 template <
int dim,
typename RangeNumberType =
double>
881 const double initial_time = 0);
892 const std::vector<std::function<RangeNumberType(
const Point<dim> &)>>
894 const double initial_time = 0.0);
905 const std::vector<std::function<RangeNumberType(
const Point<dim> &)>>
910 const double initial_time = 0.0);
919 virtual RangeNumberType
920 value(
const Point<dim> &p,
const unsigned int component = 0)
const override;
930 const unsigned int component = 0)
const override;
939 const std::vector<std::function<RangeNumberType(
const Point<dim> &)>>
957 std::vector<std::function<RangeNumberType(const Point<dim> &)>>
964 std::function<Tensor<1, dim, RangeNumberType>(
const Point<dim> &)>>
1005 template <
int dim,
typename RangeNumberType =
double>
1039 virtual RangeNumberType
1040 value(
const Point<dim> &p,
const unsigned int component = 0)
const override;
1086 template <
int dim,
typename RangeNumberType>
1091 DEAL_II_NAMESPACE_CLOSE
virtual void vector_gradient_list(const std::vector< Point< dim >> &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType >>> &gradients) const override
Function(const unsigned int n_components=1, const time_type initial_time=0.0)
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &return_value) const override
void set_function_gradients(const std::vector< std::function< Tensor< 1, dim, RangeNumberType >(const Point< dim > &)>> &gradients)
const unsigned int n_components
virtual void vector_hessian_list(const std::vector< Point< dim >> &points, std::vector< std::vector< SymmetricTensor< 2, dim, RangeNumberType >>> &values) const
virtual void gradient_list(const std::vector< Point< dim >> &points, std::vector< Tensor< 1, dim, RangeNumberType >> &gradients, const unsigned int component=0) const override
virtual void vector_gradient_list(const std::vector< Point< dim >> &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType >>> &gradients) const
virtual ~VectorFunctionFromTensorFunction() override=default
VectorFunctionFromTensorFunction(const TensorFunction< 1, dim, RangeNumberType > &tensor_function, const unsigned int selected_component=0, const unsigned int n_components=dim)
static const unsigned int dimension
virtual void vector_laplacian(const Point< dim > &p, Vector< RangeNumberType > &values) const
virtual void vector_hessian(const Point< dim > &p, std::vector< SymmetricTensor< 2, dim, RangeNumberType >> &values) const
FunctionFromFunctionObjects(const unsigned int n_components=1, const double initial_time=0)
virtual void vector_gradients(const std::vector< Point< dim >> &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType >>> &gradients) const
LinearAlgebra::distributed::Vector< Number > Vector
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
const std::function< RangeNumberType(const Point< dim > &)> function_object
ComponentSelectFunction(const unsigned int selected, const RangeNumberType value, const unsigned int n_components)
Function & operator=(const Function &f)
virtual void vector_value_list(const std::vector< Point< dim >> &points, std::vector< Vector< RangeNumberType >> &value_list) const override
typename FunctionTime< typename numbers::NumberTraits< RangeNumberType >::real_type >::time_type time_type
virtual void vector_value_list(const std::vector< Point< dim >> &points, std::vector< Vector< RangeNumberType >> &values) const
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &return_value) const override
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &values) const override
const std::function< RangeNumberType(const Point< dim > &)> function_object
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
virtual Tensor< 1, dim, RangeNumberType > gradient(const Point< dim > &p, const unsigned int component=0) const override
virtual void vector_values(const std::vector< Point< dim >> &points, std::vector< std::vector< RangeNumberType >> &values) const
virtual SymmetricTensor< 2, dim, RangeNumberType > hessian(const Point< dim > &p, const unsigned int component=0) const
std::vector< std::function< Tensor< 1, dim, RangeNumberType >const Point< dim > &)> > function_gradients
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
std::size_t memory_consumption() const
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< RangeNumberType > &return_values, const unsigned int component=0) const override
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &values) const
virtual void vector_value_list(const std::vector< Point< dim >> &points, std::vector< Vector< RangeNumberType >> &return_values) const override
virtual void hessian_list(const std::vector< Point< dim >> &points, std::vector< SymmetricTensor< 2, dim, RangeNumberType >> &values, const unsigned int component=0) const
const TensorFunction< 1, dim, RangeNumberType > & tensor_function
virtual void vector_laplacian_list(const std::vector< Point< dim >> &points, std::vector< Vector< RangeNumberType >> &values) const
std::vector< std::function< RangeNumberType(const Point< dim > &)> > function_values
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
virtual Tensor< 1, dim, RangeNumberType > gradient(const Point< dim > &p, const unsigned int component=0) const
ZeroFunction(const unsigned int n_components=1)
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &values) const override
virtual void vector_gradient(const Point< dim > &p, std::vector< Tensor< 1, dim, RangeNumberType >> &gradients) const override
const std::pair< unsigned int, unsigned int > selected_components
virtual void substitute_function_value_with(const Functions::ConstantFunction< dim, RangeNumberType > &f)
virtual RangeNumberType laplacian(const Point< dim > &p, const unsigned int component=0) const
ConstantFunction(const RangeNumberType value, const unsigned int n_components=1)
void set_function_values(const std::vector< std::function< RangeNumberType(const Point< dim > &)>> &values)
virtual void value_list(const std::vector< Point< dim >> &points, std::vector< RangeNumberType > &values, const unsigned int component=0) const
virtual ~Function() override=0
const unsigned int selected_component
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
const unsigned int selected_component
ScalarFunctionFromFunctionObject(const std::function< RangeNumberType(const Point< dim > &)> &function_object)
virtual void vector_value_list(const std::vector< Point< dim >> &points, std::vector< Vector< RangeNumberType >> &values) const override
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const
std::size_t memory_consumption() const
virtual void gradient_list(const std::vector< Point< dim >> &points, std::vector< Tensor< 1, dim, RangeNumberType >> &gradients, const unsigned int component=0) const
virtual void vector_gradient(const Point< dim > &p, std::vector< Tensor< 1, dim, RangeNumberType >> &gradients) const
std::vector< RangeNumberType > function_value_vector
virtual void laplacian_list(const std::vector< Point< dim >> &points, std::vector< RangeNumberType > &values, const unsigned int component=0) const
VectorFunctionFromScalarFunctionObject(const std::function< RangeNumberType(const Point< dim > &)> &function_object, const unsigned int selected_component, const unsigned int n_components)
virtual Tensor< 1, dim, RangeNumberType > gradient(const Point< dim > &p, const unsigned int component=0) const override