6#include <deal.II/base/parameter_handler.h>
7#include <deal.II/base/tensor.h>
8#include <deal.II/base/utilities.h>
10#include <boost/algorithm/string/predicate.hpp>
11#include <boost/range/algorithm_ext/erase.hpp>
12#include <boost/variant.hpp>
18#include <prismspf/config.h>
28template <
unsigned int dim>
36 dealii::Tensor<1, dim>,
37 dealii::Tensor<2, dim>,
38 dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>>;
53 get_double(
const std::string &constant_name)
const;
62 get_int(
const std::string &constant_name)
const;
71 get_bool(
const std::string &constant_name)
const;
79 [[nodiscard]] std::string
80 get_string(
const std::string &constant_name)
const;
88 [[nodiscard]] dealii::Tensor<1, dim>
97 [[nodiscard]] dealii::Tensor<2, dim>
106 [[nodiscard]] dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>
114 std::vector<std::string> &model_constants_strings)
137 const std::string &keyword,
138 const std::string &entry_name,
139 std::string &out_string,
140 bool expect_equals_sign);
145 static std::set<std::string>
146 get_names(
const std::string &input_file_name);
173 const std::vector<std::string> &tensor_elements);
184 dealii::Tensor<1, dim>
186 const std::vector<std::string> &tensor_elements);
191 dealii::Tensor<2, dim>
193 const std::vector<std::string> &tensor_elements);
201 [[nodiscard]] dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>
203 const std::string &elastic_const_symmetry,
206 [[nodiscard]] dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>
208 const std::vector<double> &constants,
250 for (
unsigned int i = 0; i < dim; ++i)
260 for (
unsigned int i = 0; i < dim; ++i)
262 for (
unsigned int j = 0; j < dim; ++j)
269 template <
unsigned int D = dim>
271 operator()(
const dealii::Tensor<2, (2 * D) - 1 + (D / 3)> &value)
const
272 requires((D != ((2 * D) - 1 + (D / 3))))
274 constexpr unsigned int dimension = (2 * D) - 1 + (D / 3);
276 for (
unsigned int i = 0; i < dimension; ++i)
278 for (
unsigned int j = 0; j < dimension; ++j)
287template <
unsigned int dim>
293 "Mismatch between constants in parameters.prm and CustomPDE.h. The constant "
294 "that you attempted to access was " +
295 constant_name +
"."));
300template <
unsigned int dim>
306 "Mismatch between constants in parameters.prm and CustomPDE.h. The constant "
307 "that you attempted to access was " +
308 constant_name +
"."));
313template <
unsigned int dim>
319 "Mismatch between constants in parameters.prm and CustomPDE.h. The constant "
320 "that you attempted to access was " +
321 constant_name +
"."));
326template <
unsigned int dim>
332 "Mismatch between constants in parameters.prm and CustomPDE.h. The constant "
333 "that you attempted to access was " +
334 constant_name +
"."));
339template <
unsigned int dim>
340inline dealii::Tensor<1, dim>
345 " Mismatch between constants in parameters.prm and "
346 "CustomPDE.h. The constant that you attempted to access was " +
347 constant_name +
"."));
349 return boost::get<dealii::Tensor<1, dim>>(
model_constants.at(constant_name));
352template <
unsigned int dim>
353inline dealii::Tensor<2, dim>
358 "Mismatch between constants in parameters.prm and CustomPDE.h. The constant "
359 "that you attempted to access was " +
360 constant_name +
"."));
362 return boost::get<dealii::Tensor<2, dim>>(
model_constants.at(constant_name));
365template <
unsigned int dim>
366inline dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>
371 "Mismatch between constants in parameters.prm and CustomPDE.h. The constant "
372 "that you attempted to access was " +
373 constant_name +
"."));
375 return boost::get<dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>>(
379template <
unsigned int dim>
382 const unsigned int &n_elements,
383 const std::vector<std::string> &tensor_elements)
385 unsigned int open_parentheses = 0;
386 unsigned int close_parentheses = 0;
388 for (
unsigned int element = 0; element < n_elements; element++)
390 for (
const char character : tensor_elements.at(element))
392 if (character ==
'(')
396 else if (character ==
')')
403 if (open_parentheses != close_parentheses)
406 dealii::ExcMessage(
"User-defined elastic constant list does not have "
407 "the same number of open and close parentheses."));
410 return open_parentheses;
413template <
unsigned int dim>
417 for (std::string &element : tensor_elements)
419 boost::range::remove_erase(element,
'(');
420 boost::range::remove_erase(element,
')');
424template <
unsigned int dim>
425inline dealii::Tensor<1, dim>
427 const unsigned int &n_elements,
428 const std::vector<std::string> &tensor_elements)
430 AssertThrow(n_elements == 3,
431 dealii::ExcMessage(
"The columns in user-defined constant tensors must be "
432 "equal to the maximum number of dimensions."));
434 dealii::Tensor<1, dim> temp;
435 for (
unsigned int i = 0; i < dim; i++)
437 temp[i] = dealii::Utilities::string_to_double(tensor_elements.at(i));
443template <
unsigned int dim>
444inline dealii::Tensor<2, dim>
446 const unsigned int &n_elements,
447 const std::vector<std::string> &tensor_elements)
449 AssertThrow(n_elements == 9,
450 dealii::ExcMessage(
"User-defined constant tensor does not have the "
451 "correct number of elements, matrices must be 3x3."));
453 const unsigned int row_length = 3;
455 dealii::Tensor<2, dim> temp;
456 for (
unsigned int i = 0; i < dim; i++)
458 for (
unsigned int j = 0; j < dim; j++)
461 dealii::Utilities::string_to_double(tensor_elements.at((i * row_length) + j));
468template <
unsigned int dim>
471 std::vector<std::string> &model_constants_strings)
475 model_constants_strings.size() > 1,
477 "At least two fields are required for user-defined variables (value and type)."));
479 std::vector<std::string> model_constants_type_strings =
480 dealii::Utilities::split_string_list(model_constants_strings.at(
481 model_constants_strings.size() - 1),
484 if (model_constants_strings.size() == 2)
489 if (boost::iequals(model_constants_type_strings.at(0),
"tensor"))
491 const unsigned int n_elements = model_constants_strings.size() - 1;
493 const unsigned int open_parentheses =
496 AssertThrow(open_parentheses <= 4,
497 FeatureNotImplemented(
"3rd rank tensors and above"));
502 if (open_parentheses == 1)
509 if (boost::iequals(model_constants_type_strings.at(1),
"elastic") &&
510 boost::iequals(model_constants_type_strings.at(2),
"constants"))
512 const unsigned int n_elements = model_constants_strings.size() - 1;
517 std::vector<double> temp_elastic_constants(n_elements);
518 for (
unsigned int i = 0; i < n_elements; i++)
520 temp_elastic_constants[i] =
521 dealii::Utilities::string_to_double(model_constants_strings.at(i));
523 const std::string &elastic_const_symmetry = model_constants_type_strings.at(0);
529 if (model_constants_type_strings.size() == 4)
531 if (boost::iequals(model_constants_type_strings.at(3),
"planestress"))
535 else if (boost::iequals(model_constants_type_strings.at(3),
"planestrain"))
544 "Wrong 2D stress state. Use planestress or planestrain."));
547 else if (model_constants_type_strings.size() == 3)
556 "Wrong format of user-defined elastic constants."));
560 dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)> temp =
561 get_cij_tensor(temp_elastic_constants, elastic_const_symmetry, stress_state);
567 "Only user-defined constant tensors may have multiple elements."));
571template <
unsigned int dim>
574 std::vector<std::string> &model_constants_strings)
576 std::vector<std::string> model_constants_type_strings =
577 dealii::Utilities::split_string_list(model_constants_strings.at(
578 model_constants_strings.size() - 1),
581 if (boost::iequals(model_constants_type_strings.at(0),
"double"))
583 return dealii::Utilities::string_to_double(model_constants_strings.at(0));
585 if (boost::iequals(model_constants_type_strings.at(0),
"int"))
587 return dealii::Utilities::string_to_int(model_constants_strings.at(0));
589 if (boost::iequals(model_constants_type_strings.at(0),
"bool"))
591 return boost::iequals(model_constants_strings.at(0),
"true");
593 if (boost::iequals(model_constants_type_strings.at(0),
"string"))
595 return model_constants_strings.at(0);
600 "The type for user-defined variables must be `double`, `int`, "
601 "`bool`, `string`, `tensor`, or `elastic constants`."));
605template <
unsigned int dim>
606inline dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>
608 const std::string &elastic_const_symmetry,
613 if (elastic_const_symmetry ==
"isotropic")
617 else if (elastic_const_symmetry ==
"transverse")
621 else if (elastic_const_symmetry ==
"orthotropic")
625 else if (elastic_const_symmetry ==
"anisotropic")
631 AssertThrow(
false, dealii::ExcMessage(
"Invalid elasticity tensor type"));
637 constexpr unsigned int max_number = 21;
638 if ((mat_model ==
Anisotropic) && (dim == 2) && elastic_constants.size() == max_number)
640 std::vector<double> elastic_constants_temp = elastic_constants;
641 elastic_constants.clear();
642 const std::vector<unsigned int> indices_2d = {0, 1, 5, 6, 10, 14};
643 std::transform(indices_2d.begin(),
645 std::back_inserter(elastic_constants),
646 [&elastic_constants_temp](
unsigned int index)
648 return elastic_constants_temp.at(index);
652 return get_cij_matrix(mat_model, elastic_constants, stress_state);
655template <
unsigned int dim>
656inline dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>
658 const std::vector<double> &constants,
662 dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)> stiffness;
668 const int xx_dir = 0;
679 const double modulus = constants.at(0);
681 stiffness[xx_dir][xx_dir] = modulus;
687 "Invalid elasticity model type for 1D. We only accept "
688 "isotropic elasticity tensors."));
695 const int xx_dir = 0;
696 const int yy_dir = 1;
697 const int xy_dir = 2;
713 const double modulus = constants.at(0);
714 const double poisson = constants.at(1);
716 const double shear_modulus = modulus / (2 * (1 + poisson));
718 switch (stress_state)
722 lambda = poisson * modulus / ((1 - poisson * poisson));
728 poisson * modulus / ((1 + poisson) * (1 - 2 * poisson));
733 dealii::ExcMessage(
"Invalid stress state type"));
736 stiffness[xx_dir][xx_dir] = stiffness[yy_dir][yy_dir] =
737 lambda + 2 * shear_modulus;
738 stiffness[xy_dir][xy_dir] = shear_modulus;
739 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] = lambda;
745 switch (stress_state)
749 const double E1 = constants.at(0);
750 const double E2 = constants.at(1);
751 const double nu12 = constants.at(2);
752 const double G12 = constants.at(3);
754 const double nu21 = nu12 * (E2 / E1);
755 const double denom = 1.0 - (nu12 * nu21);
757 stiffness[xx_dir][xx_dir] = E1 / denom;
758 stiffness[yy_dir][yy_dir] = E2 / denom;
759 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] =
761 stiffness[xy_dir][xy_dir] = G12;
766 const double E1 = constants.at(0);
767 const double E2 = constants.at(1);
768 const double E3 = constants.at(2);
769 const double nu12 = constants.at(3);
770 const double nu13 = constants.at(4);
771 const double nu23 = constants.at(5);
772 const double G12 = constants.at(6);
774 const double nu21 = nu12 * (E2 / E1);
775 const double nu31 = nu13 * (E3 / E1);
776 const double nu32 = nu23 * (E3 / E2);
778 const double delta = 1.0 - (nu12 * nu21) - (nu23 * nu32) -
779 (nu13 * nu31) - (2.0 * nu12 * nu23 * nu31);
781 stiffness[xx_dir][xx_dir] =
782 (E1 * (1.0 - (nu23 * nu32))) / delta;
783 stiffness[yy_dir][yy_dir] =
784 (E2 * (1.0 - (nu13 * nu31))) / delta;
785 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] =
786 (E1 * (nu21 + (nu31 * nu23))) / delta;
787 stiffness[xy_dir][xy_dir] = G12;
792 dealii::ExcMessage(
"Invalid stress state type"));
804 stiffness[xx_dir][xx_dir] = constants.at(0);
805 stiffness[yy_dir][yy_dir] = constants.at(1);
806 stiffness[xy_dir][xy_dir] = constants.at(2);
807 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] = constants.at(3);
808 stiffness[xx_dir][xy_dir] = stiffness[xy_dir][xx_dir] = constants.at(4);
809 stiffness[yy_dir][xy_dir] = stiffness[xy_dir][yy_dir] = constants.at(5);
815 AssertThrow(
false, dealii::ExcMessage(
"Invalid elasticity model type"));
821 const int xx_dir = 0;
822 const int yy_dir = 1;
823 const int zz_dir = 2;
824 const int yz_dir = 3;
825 const int xz_dir = 4;
826 const int xy_dir = 5;
839 const double modulus = constants.at(0);
840 const double poisson = constants.at(1);
842 const double shear_modulus = modulus / (2 * (1 + poisson));
843 const double lambda =
844 poisson * modulus / ((1 + poisson) * (1 - 2 * poisson));
846 stiffness[xx_dir][xx_dir] = stiffness[yy_dir][yy_dir] =
847 stiffness[zz_dir][zz_dir] = lambda + 2 * shear_modulus;
848 stiffness[yz_dir][yz_dir] = stiffness[xz_dir][xz_dir] =
849 stiffness[xy_dir][xy_dir] = shear_modulus;
850 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] =
851 stiffness[xx_dir][zz_dir] = stiffness[zz_dir][xx_dir] =
852 stiffness[yy_dir][zz_dir] = stiffness[zz_dir][yy_dir] = lambda;
863 stiffness[xx_dir][xx_dir] = constants[0];
864 stiffness[yy_dir][yy_dir] = constants[1];
865 stiffness[zz_dir][zz_dir] = constants[2];
866 stiffness[yz_dir][yz_dir] = constants[3];
867 stiffness[xz_dir][xz_dir] = constants[4];
868 stiffness[xy_dir][xy_dir] = constants[5];
869 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] = constants[6];
870 stiffness[xx_dir][zz_dir] = stiffness[zz_dir][xx_dir] = constants[7];
871 stiffness[xx_dir][yz_dir] = stiffness[yz_dir][xx_dir] = constants[8];
872 stiffness[xx_dir][xz_dir] = stiffness[xz_dir][xx_dir] = constants[9];
873 stiffness[xx_dir][xy_dir] = stiffness[xy_dir][xx_dir] = constants[10];
874 stiffness[yy_dir][zz_dir] = stiffness[zz_dir][yy_dir] = constants[11];
875 stiffness[yy_dir][yz_dir] = stiffness[yz_dir][yy_dir] = constants[12];
876 stiffness[yy_dir][xz_dir] = stiffness[xz_dir][yy_dir] = constants[13];
877 stiffness[yy_dir][xy_dir] = stiffness[xy_dir][yy_dir] = constants[14];
878 stiffness[zz_dir][yz_dir] = stiffness[yz_dir][zz_dir] = constants[15];
879 stiffness[zz_dir][xz_dir] = stiffness[xz_dir][zz_dir] = constants[16];
880 stiffness[zz_dir][xy_dir] = stiffness[xy_dir][zz_dir] = constants[17];
881 stiffness[yz_dir][xz_dir] = stiffness[xz_dir][yz_dir] = constants[18];
882 stiffness[yz_dir][xy_dir] = stiffness[xy_dir][yz_dir] = constants[19];
883 stiffness[xz_dir][xy_dir] = stiffness[xy_dir][xz_dir] = constants[20];
891 AssertThrow(
false, FeatureNotImplemented(
"Transverse material"));
896 const double E1 = constants.at(0);
897 const double E2 = constants.at(1);
898 const double E3 = constants.at(2);
899 const double nu12 = constants.at(3);
900 const double nu13 = constants.at(4);
901 const double nu23 = constants.at(5);
902 const double G12 = constants.at(6);
903 const double G13 = constants.at(7);
904 const double G23 = constants.at(8);
906 const double nu21 = nu12 * (E2 / E1);
907 const double nu31 = nu13 * (E3 / E1);
908 const double nu32 = nu23 * (E3 / E2);
910 const double delta = 1.0 - (nu12 * nu21) - (nu23 * nu32) -
911 (nu13 * nu31) - (2.0 * nu12 * nu23 * nu31);
913 stiffness[xx_dir][xx_dir] = (E1 * (1.0 - nu23 * nu32)) / delta;
914 stiffness[yy_dir][yy_dir] = (E2 * (1.0 - nu13 * nu31)) / delta;
915 stiffness[zz_dir][zz_dir] = (E3 * (1.0 - nu12 * nu21)) / delta;
916 stiffness[xx_dir][yy_dir] = stiffness[yy_dir][xx_dir] =
917 (E1 * (nu21 + nu31 * nu23)) / delta;
918 stiffness[xx_dir][zz_dir] = stiffness[zz_dir][xx_dir] =
919 (E1 * (nu31 + nu21 * nu32)) / delta;
920 stiffness[yy_dir][zz_dir] = stiffness[zz_dir][yy_dir] =
921 (E2 * (nu32 + nu12 * nu31)) / delta;
922 stiffness[yz_dir][yz_dir] = G23;
923 stiffness[xz_dir][xz_dir] = G13;
924 stiffness[xy_dir][xy_dir] = G12;
928 AssertThrow(
false, dealii::ExcMessage(
"Invalid elasticity model type"));
934 Assert(
false, UnreachableCode());
941template <
unsigned int dim>
948 <<
"================================================\n"
949 <<
" User Constants\n"
950 <<
"================================================\n";
962template <
unsigned int dim>
966 while ((!line.empty()) && (line[0] ==
' ' || line[0] ==
'\t'))
970 while ((!line.empty()) &&
971 (line[line.size() - 1] ==
' ' || line[line.size() - 1] ==
'\t'))
973 line.erase(line.size() - 1, std::string::npos);
977template <
unsigned int dim>
980 const std::string &keyword)
983 if (line.size() < keyword.size())
989 for (
unsigned int i = 0; i < keyword.size(); i++)
991 if (line[i] != keyword[i])
1000template <
unsigned int dim>
1003 const std::string &keyword,
1004 const std::string &entry_name,
1005 std::string &out_string,
1006 bool expect_equals_sign)
1018 if (!entry_name.empty())
1020 if (line[keyword.size()] !=
' ' && line[keyword.size()] !=
'\t')
1027 line.erase(0, keyword.size());
1031 if (!line.starts_with(entry_name))
1036 line.erase(0, entry_name.size());
1040 if (expect_equals_sign)
1042 if ((line.empty()) || (line[0] !=
'='))
1049 const std::string::size_type pos = line.find(
'#');
1050 if (pos != std::string::npos)
1057 if (expect_equals_sign)
1067template <
unsigned int dim>
1068std::set<std::string>
1071 const std::string keyword =
"set";
1072 const std::string entry_name_begining =
"Model constant";
1073 std::ifstream input_file;
1074 input_file.open(input_file_name);
1079 std::set<std::string> entry_name_end_list;
1082 while (std::getline(input_file, line))
1084 if (
parse_line(line, keyword, entry_name_begining, entry,
false))
1090 while ((!entry.empty()) && (entry[0] ==
' ' || entry[0] ==
'\t'))
1096 while ((!entry.empty()) && (entry[entry.size() - 1] !=
'='))
1098 entry.erase(entry.size() - 1, std::string::npos);
1102 entry.erase(entry.size() - 1, std::string::npos);
1105 while ((!entry.empty()) &&
1106 (entry[entry.size() - 1] ==
' ' || entry[entry.size() - 1] ==
'\t'))
1108 entry.erase(entry.size() - 1, std::string::npos);
1112 AssertThrow(entry_name_end_list.insert(entry).second,
1114 "Non-unique constant name in parameters.prm. The constant that "
1115 "you attempted to create was \"" +
1119 return entry_name_end_list;
1122template <
unsigned int dim>
1131 for (
const std::string &constant_name : model_constant_names)
1133 std::string constants_text =
"Model constant ";
1134 constants_text.append(constant_name);
1135 parameter_handler.declare_entry(constants_text,
1137 dealii::Patterns::Anything(),
1138 "The value of a user-defined constant.");
1142template <
unsigned int dim>
1151 for (
const std::string &constant_name : model_constant_names)
1153 std::string constants_text =
"Model constant ";
1154 constants_text.append(constant_name);
1156 std::vector<std::string> model_constants_strings =
1157 dealii::Utilities::split_string_list(parameter_handler.get(constants_text));
1162PRISMS_PF_END_NAMESPACE
static dealii::ConditionalOStream & pout_summary()
Log output stream for writing a summary.log file.
Definition conditional_ostreams.cc:35
Class for printing of variant types. This is bad practice and should be fixed.
Definition user_constants.h:220
void operator()(bool value) const
Definition user_constants.h:235
void operator()(const std::string &value) const
Definition user_constants.h:241
void operator()(int value) const
Definition user_constants.h:229
void operator()(double value) const
Definition user_constants.h:223
void operator()(const dealii::Tensor< 2, dim > &value) const
Definition user_constants.h:257
void operator()(const dealii::Tensor< 2,(2 *D) - 1+(D/3)> &value) const
Definition user_constants.h:271
void operator()(const dealii::Tensor< 1, dim > &value) const
Definition user_constants.h:247
Class the stores and manages user-defined constants.
Definition user_constants.h:30
InputVariant construct_user_constant(std::vector< std::string > &model_constants_strings)
Assign the specified user constant to whatever type.
Definition user_constants.h:470
dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> get_cij_matrix(const ElasticityModel &model, const std::vector< double > &constants, const StressState &stress_state) const
Definition user_constants.h:657
dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> get_cij_tensor(std::vector< double > elastic_constants, const std::string &elastic_const_symmetry, const StressState &stress_state) const
Definition user_constants.h:607
int get_int(const std::string &constant_name) const
Retrieve the int from the model_constants that are defined from the parameters.prm parser....
Definition user_constants.h:302
dealii::Tensor< 1, dim > get_rank_1_tensor(const std::string &constant_name) const
Retrieve the rank 1 tensor from the model_constants that are defined from the parameters....
Definition user_constants.h:341
void add_user_constant(const std::string &constant_name, std::vector< std::string > &model_constants_strings)
Add user-specified constants.
Definition user_constants.h:113
std::map< std::string, InputVariant > model_constants
List of user-defined constants.
Definition user_constants.h:214
InputVariant primitive_model_constant(std::vector< std::string > &model_constants_strings)
Assign the primitive user constants (e.g., int, double, bool).
Definition user_constants.h:573
static std::set< std::string > get_names(const std::string &input_file_name)
Get names of user-specified parameters from file.
Definition user_constants.h:1069
boost::variant< double, int, bool, std::string, dealii::Tensor< 1, dim >, dealii::Tensor< 2, dim >, dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> > InputVariant
Definition user_constants.h:32
double get_double(const std::string &constant_name) const
Retrieve the double from the model_constants that are defined from the parameters....
Definition user_constants.h:289
static bool check_keyword_match(const std::string &line, const std::string &keyword)
Definition user_constants.h:979
dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> get_elasticity_tensor(const std::string &constant_name) const
Retrieve the elasticity tensor from the model_constants that are defined from the parameters....
Definition user_constants.h:367
dealii::Tensor< 2, dim > get_rank_2_tensor(const std::string &constant_name) const
Retrieve the rank 2 tensor from the model_constants that are defined from the parameters....
Definition user_constants.h:354
void declare_parameters(dealii::ParameterHandler ¶meter_handler) const
Declare the parameters to be read from an input file.
Definition user_constants.h:1124
dealii::Tensor< 1, dim > compute_rank_1_tensor_constant(const unsigned int &n_elements, const std::vector< std::string > &tensor_elements)
Compute a 1st rank tensor from user inputs .
Definition user_constants.h:426
dealii::Tensor< 2, dim > compute_rank_2_tensor_constant(const unsigned int &n_elements, const std::vector< std::string > &tensor_elements)
Compute a 2nd rank tensor from user inputs .
Definition user_constants.h:445
std::string file_name
File to be parsed to extract the user-defined constants.
Definition user_constants.h:165
unsigned int compute_tensor_parentheses(const unsigned int &n_elements, const std::vector< std::string > &tensor_elements)
Compute the number of tensor rows.
Definition user_constants.h:381
static bool parse_line(std::string line, const std::string &keyword, const std::string &entry_name, std::string &out_string, bool expect_equals_sign)
Look for a keyword in a line and if it is found, extract the entry name and value....
Definition user_constants.h:1002
void print() const
Print all user-specified constants.
Definition user_constants.h:943
std::string get_string(const std::string &constant_name) const
Retrieve the string from the model_constants that are defined from the parameters....
Definition user_constants.h:328
static void strip_spaces(std::string &line)
Definition user_constants.h:964
bool get_bool(const std::string &constant_name) const
Retrieve the bool from the model_constants that are defined from the parameters.prm parser....
Definition user_constants.h:315
void assign_parameters(dealii::ParameterHandler ¶meter_handler)
Assign the parameters read from an input file to this object.
Definition user_constants.h:1144
void remove_parentheses(std::vector< std::string > &tensor_elements)
Remove and leading and trailing parentheses.
Definition user_constants.h:415
Definition conditional_ostreams.cc:20
ElasticityModel
Symmetry of elastic tensor.
Definition type_enums.h:62
@ Transverse
Definition type_enums.h:64
@ Anisotropic
Definition type_enums.h:66
@ Orthotropic
Definition type_enums.h:65
@ Isotropic
Definition type_enums.h:63
StressState
State of stress.
Definition type_enums.h:73
@ ThreeDimension
Definition type_enums.h:77
@ PlaneStress
Definition type_enums.h:87
@ PlaneStrain
Definition type_enums.h:82