|
Reference documentation for deal.II version 9.2.0
|
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\)
\(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\)
\(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\)
\(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Go to the documentation of this file.
16 #ifndef dealii_symbolic_function_h
17 #define dealii_symbolic_function_h
38 template <
typename number>
42 template <
int dim,
typename RangeNumberType>
43 class SymbolicFunction;
49 #ifdef DEAL_II_WITH_SYMENGINE
153 template <
int dim,
typename RangeNumberType =
double>
200 const std::vector<Differentiation::SD::Expression> &
function,
279 const std::vector<Differentiation::SD::Expression> &
297 virtual RangeNumberType
298 value(
const Point<dim> &p,
const unsigned int component = 0)
const override;
303 const unsigned int component = 0)
const override;
306 virtual RangeNumberType
308 const unsigned int component = 0)
const override;
313 const unsigned int component = 0)
const override;
319 template <
typename StreamType>
321 print(StreamType &out)
const;
390 mutable std::vector<Differentiation::SD::Expression>
function;
397 mutable std::vector<Tensor<1, dim, Differentiation::SD::Expression>>
405 mutable std::vector<Tensor<2, dim, Differentiation::SD::Expression>>
429 template <
int dim,
typename RangeNumberType>
430 inline std::ostream &
439 template <
int dim,
typename RangeNumberType>
440 template <
typename StreamType>
444 for (
unsigned int i = 0; i < dim; ++i)
445 out << coordinate_symbols[i] <<
", ";
446 for (
const auto &argument_pair : additional_function_arguments)
447 out << argument_pair.first <<
", ";
448 out << time_symbol <<
" -> " << user_function[0];
449 for (
unsigned int i = 1; i < user_function.size(); ++i)
450 out <<
"; " << user_function[i];
451 if (!user_substitution_map.empty())
454 std::string sep =
"";
455 for (
const auto &substitution : user_substitution_map)
457 out << sep << substitution.first <<
" = " << substitution.second;
465 template <
int dim,
typename RangeNumberType =
double>
474 "This class is not available if you did not enable SymEngine "
475 "when compiling deal.II."));
std::vector< Differentiation::SD::Expression > function_laplacian
virtual Tensor< 1, dim, RangeNumberType > gradient(const Point< dim > &p, const unsigned int component=0) const override
void update_values() const
const Tensor< 1, dim, Differentiation::SD::Expression > & get_coordinate_symbols() const
StreamType & print(StreamType &out) const
const std::vector< Differentiation::SD::Expression > & get_symbolic_function_expressions() const
SymbolicFunction(const std::vector< Differentiation::SD::Expression > &function, const Tensor< 1, dim, Differentiation::SD::Expression > &coordinate_symbols=get_default_coordinate_symbols(), const Differentiation::SD::Expression &time_symbol=Differentiation::SD::make_symbol("t"), const Differentiation::SD::types::substitution_map &user_substitution_map={})
std::map< SD::Expression, SD::Expression, internal::ExpressionKeyLess > substitution_map
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
std::vector< Tensor< 1, dim, Differentiation::SD::Expression > > function_gradient
SymbolicFunction< dim, RangeNumberType > time_derivative() const
virtual SymmetricTensor< 2, dim, RangeNumberType > hessian(const Point< dim > &p, const unsigned int component=0) const override
static ::ExceptionBase & ExcMessage(std::string arg1)
virtual RangeNumberType laplacian(const Point< dim > &p, const unsigned int component=0) const override
const Differentiation::SD::types::substitution_map & get_user_substitution_map() const
#define DEAL_II_NAMESPACE_OPEN
void set_additional_function_arguments(const Differentiation::SD::types::substitution_map &arguments)
void update_second_derivatives() const
const Differentiation::SD::Expression & get_time_symbol() const
Differentiation::SD::types::substitution_map additional_function_arguments
Differentiation::SD::types::substitution_map create_evaluation_substitution_map(const Point< dim > &point) const
Expression make_symbol(const std::string &symbol)
const std::vector< Differentiation::SD::Expression > user_function
static Tensor< 1, dim, Differentiation::SD::Expression > get_default_coordinate_symbols()
void update_first_derivatives() const
std::ostream & operator<<(std::ostream &out, const SymbolicFunction< dim, RangeNumberType > &f)
std::vector< Tensor< 2, dim, Differentiation::SD::Expression > > function_hessian
#define DEAL_II_NAMESPACE_CLOSE
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
void update_user_substitution_map(const Differentiation::SD::types::substitution_map &substitutions)
Tensor< 1, dim, Differentiation::SD::Expression > coordinate_symbols
#define AssertThrow(cond, exc)
Differentiation::SD::Expression time_symbol
Differentiation::SD::types::substitution_map user_substitution_map