16 #ifndef dealii_differentiation_sd_symengine_utilities_h 17 #define dealii_differentiation_sd_symengine_utilities_h 19 #include <deal.II/base/config.h> 21 #ifdef DEAL_II_WITH_SYMENGINE 23 # include <deal.II/differentiation/sd/symengine_number_types.h> 24 # include <deal.II/differentiation/sd/symengine_types.h> 26 # include <symengine/basic.h> 27 # include <symengine/dict.h> 29 DEAL_II_NAMESPACE_OPEN
40 SymEngine::map_basic_basic
41 convert_expression_map_to_basic_map(
42 const SD::types::substitution_map &substitution_map);
48 convert_expression_vector_to_basic_vector(
49 const SD::types::symbol_vector &symbol_vector);
60 SD::types::symbol_vector
61 extract_symbols(
const SD::types::substitution_map &substitution_values);
74 template <
typename NumberType,
typename ExpressionType = SD::Expression>
75 std::vector<NumberType>
76 extract_values(
const SD::types::substitution_map &substitution_values);
81 template <
typename StreamType>
83 print_substitution_map(
85 const SD::types::substitution_map &symbol_value_map);
105 template <
typename NumberType,
typename ExpressionType>
106 std::vector<NumberType>
107 extract_values(
const SD::types::substitution_map &substitution_values)
109 std::vector<NumberType> values;
110 values.reserve(substitution_values.size());
112 for (
const auto &entry : substitution_values)
114 static_cast<NumberType>(ExpressionType(entry.second)));
120 template <
typename StreamType>
122 print_substitution_map(
124 const SD::types::substitution_map &symbol_value_map)
126 for (
const auto &entry : symbol_value_map)
127 stream << entry.first <<
" = " << entry.second <<
"\n";
129 stream << std::flush;
142 DEAL_II_NAMESPACE_CLOSE
144 #endif // DEAL_II_WITH_SYMENGINE 146 #endif // dealii_differentiation_sd_symengine_utilities_h