19 #ifdef DEAL_II_WITH_SYMENGINE
48 for (
unsigned int i = 0; i < rank; ++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"
301 #endif // DEAL_II_WITH_SYMENGINE