18#ifdef DEAL_II_WITH_SYMENGINE
47 for (
unsigned int i = 0; i < rank; ++i)
48 out += std::to_string(indices[i]);
53 template <
int rank,
int dim>
57 template <
int rank,
int dim>
61 create(
const std::string &sym)
69 Expression(sym +
"_" + internal::make_index_string(indices));
77 struct Symbol_Tensor<0, dim>
80 create(
const std::string &sym)
87 template <
int rank,
int dim>
88 struct Symbol_SymmetricTensor;
91 template <
int rank,
int dim>
92 struct Symbol_SymmetricTensor
95 create(
const std::string &sym)
103 Expression(sym +
"_" + internal::make_index_string(indices));
111 struct Symbol_SymmetricTensor<4, dim>
114 create(
const std::string &sym)
117 for (
unsigned int i = 0;
118 i < SymmetricTensor<2, dim>::n_independent_components;
120 for (
unsigned int j = 0;
121 j < SymmetricTensor<2, dim>::n_independent_components;
125 make_rank_4_tensor_indices<dim>(i, j);
126 out[indices] = Expression(
127 sym +
"_" + internal::make_index_string(indices));
134 template <
int rank,
int dim>
135 struct Symbol_Function_Tensor;
138 template <
int rank,
int dim>
139 struct Symbol_Function_Tensor
142 create(
const std::string &sym,
153 Expression(sym +
"_" + internal::make_index_string(indices),
162 struct Symbol_Function_Tensor<0, dim>
165 create(
const std::string &sym,
173 template <
int rank,
int dim>
174 struct Symbol_Function_SymmetricTensor;
177 template <
int rank,
int dim>
178 struct Symbol_Function_SymmetricTensor
181 create(
const std::string &sym,
192 Expression(sym +
"_" + internal::make_index_string(indices),
201 struct Symbol_Function_SymmetricTensor<4, dim>
204 create(
const std::string &sym,
210 for (
unsigned int i = 0;
211 i < SymmetricTensor<2, dim>::n_independent_components;
213 for (
unsigned int j = 0;
214 j < SymmetricTensor<2, dim>::n_independent_components;
218 make_rank_4_tensor_indices<dim>(i, j);
220 Expression(sym +
"_" + internal::make_index_string(indices),
234 return internal::Symbol_Tensor<1, dim>::create(sym);
244 return internal::Symbol_Function_Tensor<1, dim>::create(sym, arguments);
249 template <
int rank,
int dim>
253 return internal::Symbol_Tensor<rank, dim>::create(sym);
257 template <
int rank,
int dim>
261 return internal::Symbol_SymmetricTensor<rank, dim>::create(sym);
266 template <
int rank,
int dim>
271 return internal::Symbol_Function_Tensor<rank, dim>::create(sym,
276 template <
int rank,
int dim>
279 const std::string &sym,
282 return internal::Symbol_Function_SymmetricTensor<rank, dim>::create(
292# include "symengine_tensor_operations.inst"
static DEAL_II_HOST constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
static constexpr unsigned int n_independent_components
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
static constexpr unsigned int n_independent_components
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
SD::types::symbol_vector extract_symbols(const SD::types::substitution_map &substitution_values)
std::vector< SD::Expression > symbol_vector
std::map< SD::Expression, SD::Expression, internal::ExpressionKeyLess > substitution_map
Tensor< rank, dim, Expression > make_tensor_of_symbols(const std::string &symbol)
Expression make_symbolic_function(const std::string &symbol, const types::symbol_vector &arguments)
SymmetricTensor< rank, dim, Expression > make_symmetric_tensor_of_symbols(const std::string &symbol)
Tensor< 1, dim, Expression > make_vector_of_symbolic_functions(const std::string &symbol, const types::substitution_map &arguments)
SymmetricTensor< rank, dim, Expression > make_symmetric_tensor_of_symbolic_functions(const std::string &symbol, const types::substitution_map &arguments)
Tensor< 1, dim, Expression > make_vector_of_symbols(const std::string &symbol)
Tensor< rank, dim, Expression > make_tensor_of_symbolic_functions(const std::string &symbol, const types::substitution_map &arguments)
Expression make_symbol(const std::string &symbol)