6#include <deal.II/base/exceptions.h>
7#include <deal.II/base/point.h>
8#include <deal.II/base/tensor.h>
9#include <deal.II/base/vectorization.h>
10#include <deal.II/matrix_free/evaluation_flags.h>
12#include <boost/range/algorithm.hpp>
13#include <boost/range/algorithm_ext.hpp>
15#include <prismspf/config.h>
20#include <unordered_map>
27template <
typename Type>
30 const std::unordered_map<std::string, Type> &
table)
34 dealii::ExcMessage(
"Unknown table entry: " +
string));
55template <
typename Type,
typename OtherType>
56std::pair<OtherType, Type>
58 const std::string &
string,
59 const std::unordered_map<std::string, Type> &
table,
60 const std::unordered_map<std::string, OtherType> &
other_table,
61 const std::pair<char, char> &
delimiters = {
'(',
')'})
73 "Opening delimiter must precede the closing delimiter. You had " +
76 dealii::ExcMessage(
"You must either have a delimiter pair or not. You seem "
77 "to only have one delimiter. You had " +
91 "Closing delimiter must be at the end of the string. You had " +
string));
102 "Inner and outer map entries must not be empty. You had " +
string));
117template <
typename Real,
typename OtherReal>
128template <
unsigned int dim>
135template <
unsigned int dim,
typename T>
148template <
unsigned int dim,
typename T>
151 const dealii::Tensor<2, dim, T> &
strain,
152 dealii::Tensor<2, dim, T> &
stress)
154 dealii::Tensor<1, voigt_tensor_size<dim>,
T>
sigma;
155 dealii::Tensor<1, voigt_tensor_size<dim>,
T>
epsilon;
157 if constexpr (
dim == 3)
190 else if constexpr (
dim == 2)
234 return boolean ?
"true" :
"false";
245 if ((flag & dealii::EvaluationFlags::EvaluationFlags::values) != 0
U)
249 if ((flag & dealii::EvaluationFlags::EvaluationFlags::gradients) != 0
U)
257 if ((flag & dealii::EvaluationFlags::EvaluationFlags::hessians) != 0
U)
274template <
unsigned int dim,
typename number>
275inline std::vector<number>
278 static_assert(
dim < 4,
"We only allow 3 space dimensions");
280 std::vector<number>
vec(3, 0.0);
284 for (
unsigned int i = 0;
i <
dim; ++
i)
@ Value
Use value of the variable as a criterion for refinement.
Definition grid_refiner_criterion.h:31
Definition conditional_ostreams.cc:20
inline ::dealii::VectorizedArray< Number, width > fmod(const ::dealii::VectorizedArray< Number, width > &numer, const Number denom)
Definition vectorized_operations.h:44
Type
Factory function to create appropriate reader based on input file type not a member of ReadFieldBase ...
Definition read_field_factory.h:30
std::string strip_whitespace(const std::string &_text)
Remove whitespace from strings.
Definition utilities.h:221
std::pair< OtherType, Type > string_to_type_pair_with_delimiters(const std::string &string, const std::unordered_map< std::string, Type > &table, const std::unordered_map< std::string, OtherType > &other_table, const std::pair< char, char > &delimiters={'(', ')'})
Helper function that converts a string to some type pair, given two mappings and a set of delimiters.
Definition utilities.h:57
std::string eval_flags_to_string(dealii::EvaluationFlags::EvaluationFlags flag)
Convert evaluation flags to string.
Definition utilities.h:241
Real pmod(const Real &value, const OtherReal &modulus)
Positive moldulo (remainder) returns the normal remainder. (c++ fmod is defined abnormally for negati...
Definition utilities.h:119
std::vector< number > dealii_point_to_vector(const dealii::Point< dim, number > &point)
Definition utilities.h:276
constexpr unsigned int voigt_tensor_size
Voigt notation index range.
Definition utilities.h:129
void compute_stress(const dealii::Tensor< 2, voigt_tensor_size< dim >, T > &elasticity_tensor, const dealii::Tensor< 1, voigt_tensor_size< dim >, T > &strain, dealii::Tensor< 1, voigt_tensor_size< dim >, T > &stress)
Compute the stress with a given displacement and elasticity tensor. This assumes that the provided pa...
Definition utilities.h:137
PRISMS_PF_BEGIN_NAMESPACE Type string_to_type(const std::string &string, const std::unordered_map< std::string, Type > &table)
Helper function that converts a string to some type, given a mapping.
Definition utilities.h:29
const char * bool_to_string(bool boolean)
Convert bool to string.
Definition utilities.h:232