19#ifdef DEAL_II_WITH_SYMENGINE
48 for (
unsigned int i = 0; i < rank; ++i)
49 out += std::to_string(indices[i]);
54 template <
int rank,
int dim>
58 template <
int rank,
int dim>
62 create(
const std::string &sym)
69 out[indices] = Expression(sym + std::string(
"_") +
70 internal::make_index_string(indices));
78 struct Symbol_Tensor<0, dim>
81 create(
const std::string &sym)
88 template <
int rank,
int dim>
89 struct Symbol_SymmetricTensor;
92 template <
int rank,
int dim>
93 struct Symbol_SymmetricTensor
96 create(
const std::string &sym)
103 out[indices] = Expression(sym + std::string(
"_") +
104 internal::make_index_string(indices));
112 struct Symbol_SymmetricTensor<4, dim>
115 create(
const std::string &sym)
118 for (
unsigned int i = 0;
119 i < SymmetricTensor<2, dim>::n_independent_components;
121 for (
unsigned int j = 0;
122 j < SymmetricTensor<2, dim>::n_independent_components;
126 make_rank_4_tensor_indices<dim>(i, j);
128 Expression(sym + std::string(
"_") +
129 internal::make_index_string(indices));
136 template <
int rank,
int dim>
137 struct Symbol_Function_Tensor;
140 template <
int rank,
int dim>
141 struct Symbol_Function_Tensor
144 create(
const std::string & sym,
155 Expression(sym + std::string(
"_") +
156 internal::make_index_string(indices),
165 struct Symbol_Function_Tensor<0, dim>
168 create(
const std::string & sym,
176 template <
int rank,
int dim>
177 struct Symbol_Function_SymmetricTensor;
180 template <
int rank,
int dim>
181 struct Symbol_Function_SymmetricTensor
184 create(
const std::string & sym,
195 Expression(sym + std::string(
"_") +
196 internal::make_index_string(indices),
205 struct Symbol_Function_SymmetricTensor<4, dim>
208 create(
const std::string & sym,
214 for (
unsigned int i = 0;
215 i < SymmetricTensor<2, dim>::n_independent_components;
217 for (
unsigned int j = 0;
218 j < SymmetricTensor<2, dim>::n_independent_components;
222 make_rank_4_tensor_indices<dim>(i, j);
224 Expression(sym + std::string(
"_") +
225 internal::make_index_string(indices),
239 return internal::Symbol_Tensor<1, dim>::create(sym);
249 return internal::Symbol_Function_Tensor<1, dim>::create(sym, arguments);
254 template <
int rank,
int dim>
258 return internal::Symbol_Tensor<rank, dim>::create(sym);
262 template <
int rank,
int dim>
266 return internal::Symbol_SymmetricTensor<rank, dim>::create(sym);
271 template <
int rank,
int dim>
276 return internal::Symbol_Function_Tensor<rank, dim>::create(sym,
281 template <
int rank,
int dim>
284 const std::string & sym,
287 return internal::Symbol_Function_SymmetricTensor<rank, dim>::create(
297# include "symengine_tensor_operations.inst"
static 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)