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)
68 out[indices] = Expression(sym + std::string(
"_") +
69 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)
102 out[indices] = Expression(sym + std::string(
"_") +
103 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);
127 Expression(sym + std::string(
"_") +
128 internal::make_index_string(indices));
135 template <
int rank,
int dim>
136 struct Symbol_Function_Tensor;
139 template <
int rank,
int dim>
140 struct Symbol_Function_Tensor
143 create(
const std::string &sym,
154 Expression(sym + std::string(
"_") +
155 internal::make_index_string(indices),
164 struct Symbol_Function_Tensor<0, dim>
167 create(
const std::string &sym,
175 template <
int rank,
int dim>
176 struct Symbol_Function_SymmetricTensor;
179 template <
int rank,
int dim>
180 struct Symbol_Function_SymmetricTensor
183 create(
const std::string &sym,
194 Expression(sym + std::string(
"_") +
195 internal::make_index_string(indices),
204 struct Symbol_Function_SymmetricTensor<4, dim>
207 create(
const std::string &sym,
213 for (
unsigned int i = 0;
214 i < SymmetricTensor<2, dim>::n_independent_components;
216 for (
unsigned int j = 0;
217 j < SymmetricTensor<2, dim>::n_independent_components;
221 make_rank_4_tensor_indices<dim>(i, j);
223 Expression(sym + std::string(
"_") +
224 internal::make_index_string(indices),
238 return internal::Symbol_Tensor<1, dim>::create(sym);
248 return internal::Symbol_Function_Tensor<1, dim>::create(sym, arguments);
253 template <
int rank,
int dim>
257 return internal::Symbol_Tensor<rank, dim>::create(sym);
261 template <
int rank,
int dim>
265 return internal::Symbol_SymmetricTensor<rank, dim>::create(sym);
270 template <
int rank,
int dim>
275 return internal::Symbol_Function_Tensor<rank, dim>::create(sym,
280 template <
int rank,
int dim>
283 const std::string &sym,
286 return internal::Symbol_Function_SymmetricTensor<rank, dim>::create(
296# 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::map< SD::Expression, SD::Expression, internal::ExpressionKeyLess > substitution_map
std::vector< SD::Expression > symbol_vector
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)