Class the stores and manages user-defined constants.
More...
#include <user_constants.h>
|
| class | VariantPrinter |
| | Class for printing of variant types. This is bad practice and should be fixed. More...
|
| |
|
| InputVariant | construct_user_constant (std::vector< std::string > &model_constants_strings) |
| | Assign the specified user constant to whatever type.
|
| |
| double | get_double (const std::string &constant_name) const |
| | Retrieve the double from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| int | get_int (const std::string &constant_name) const |
| | Retrieve the int from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| bool | get_bool (const std::string &constant_name) const |
| | Retrieve the bool from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| std::string | get_string (const std::string &constant_name) const |
| | Retrieve the string from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| 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.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| 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.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| 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.prm parser. This is essentially just a wrapper for boost::get.
|
| |
| void | add_user_constant (const std::string &constant_name, std::vector< std::string > &model_constants_strings) |
| | Add user-specified constants.
|
| |
| void | print () const |
| | Print all user-specified constants.
|
| |
| void | declare_parameters (dealii::ParameterHandler ¶meter_handler) const |
| | Declare the parameters to be read from an input file.
|
| |
| void | assign_parameters (dealii::ParameterHandler ¶meter_handler) |
| | Assign the parameters read from an input file to this object.
|
| |
|
| static void | strip_spaces (std::string &line) |
| |
| static bool | check_keyword_match (const std::string &line, const std::string &keyword) |
| |
| 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. This is used to extract the model constant names from the input file.
|
| |
| static std::set< std::string > | get_names (const std::string &input_file_name) |
| | Get names of user-specified parameters from file.
|
| |
|
| std::string | file_name |
| | File to be parsed to extract the user-defined constants.
|
| |
|
| unsigned int | compute_tensor_parentheses (const unsigned int &n_elements, const std::vector< std::string > &tensor_elements) |
| | Compute the number of tensor rows.
|
| |
| void | remove_parentheses (std::vector< std::string > &tensor_elements) |
| | Remove and leading and trailing parentheses.
|
| |
| 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 .
|
| |
| 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 .
|
| |
| InputVariant | primitive_model_constant (std::vector< std::string > &model_constants_strings) |
| | Assign the primitive user constants (e.g., int, double, bool).
|
| |
| 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 |
| |
| dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> | get_cij_matrix (const ElasticityModel &model, const std::vector< double > &constants, const StressState &stress_state) const |
| |
template<unsigned int dim>
class UserConstants< dim >
Class the stores and manages user-defined constants.
◆ InputVariant
template<unsigned int dim>
Initial value: boost::variant<double,
int,
bool,
std::string,
dealii::Tensor<1, dim>,
dealii::Tensor<2, dim>,
dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)>>
◆ add_user_constant()
template<unsigned int dim>
| void UserConstants< dim >::add_user_constant |
( |
const std::string & | constant_name, |
|
|
std::vector< std::string > & | model_constants_strings ) |
|
inline |
Add user-specified constants.
◆ assign_parameters()
template<unsigned int dim>
| void UserConstants< dim >::assign_parameters |
( |
dealii::ParameterHandler & | parameter_handler | ) |
|
Assign the parameters read from an input file to this object.
- Precondition
- file_name is set and same as the file used in declare_parameters.
◆ check_keyword_match()
template<unsigned int dim>
| bool UserConstants< dim >::check_keyword_match |
( |
const std::string & | line, |
|
|
const std::string & | keyword ) |
|
static |
◆ compute_rank_1_tensor_constant()
template<unsigned int dim>
| dealii::Tensor< 1, dim > UserConstants< dim >::compute_rank_1_tensor_constant |
( |
const unsigned int & | n_elements, |
|
|
const std::vector< std::string > & | tensor_elements ) |
|
inlineprivate |
Compute a 1st rank tensor from user inputs .
◆ compute_rank_2_tensor_constant()
template<unsigned int dim>
| dealii::Tensor< 2, dim > UserConstants< dim >::compute_rank_2_tensor_constant |
( |
const unsigned int & | n_elements, |
|
|
const std::vector< std::string > & | tensor_elements ) |
|
inlineprivate |
Compute a 2nd rank tensor from user inputs .
◆ compute_tensor_parentheses()
template<unsigned int dim>
| unsigned int UserConstants< dim >::compute_tensor_parentheses |
( |
const unsigned int & | n_elements, |
|
|
const std::vector< std::string > & | tensor_elements ) |
|
inlineprivate |
Compute the number of tensor rows.
◆ construct_user_constant()
template<unsigned int dim>
Assign the specified user constant to whatever type.
◆ declare_parameters()
template<unsigned int dim>
| void UserConstants< dim >::declare_parameters |
( |
dealii::ParameterHandler & | parameter_handler | ) |
const |
Declare the parameters to be read from an input file.
- Precondition
- file_name is set.
◆ get_bool()
template<unsigned int dim>
| bool UserConstants< dim >::get_bool |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the bool from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ get_cij_matrix()
template<unsigned int dim>
◆ get_cij_tensor()
template<unsigned int dim>
| dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> UserConstants< dim >::get_cij_tensor |
( |
std::vector< double > | elastic_constants, |
|
|
const std::string & | elastic_const_symmetry, |
|
|
const StressState & | stress_state ) const |
|
inlinenodiscardprivate |
◆ get_double()
template<unsigned int dim>
| double UserConstants< dim >::get_double |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the double from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ get_elasticity_tensor()
template<unsigned int dim>
| dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> UserConstants< dim >::get_elasticity_tensor |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the elasticity tensor from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ get_int()
template<unsigned int dim>
| int UserConstants< dim >::get_int |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the int from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ get_names()
template<unsigned int dim>
| std::set< std::string > UserConstants< dim >::get_names |
( |
const std::string & | input_file_name | ) |
|
|
static |
Get names of user-specified parameters from file.
◆ get_rank_1_tensor()
template<unsigned int dim>
| dealii::Tensor< 1, dim > UserConstants< dim >::get_rank_1_tensor |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the rank 1 tensor from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ get_rank_2_tensor()
template<unsigned int dim>
| dealii::Tensor< 2, dim > UserConstants< dim >::get_rank_2_tensor |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the rank 2 tensor from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ get_string()
template<unsigned int dim>
| std::string UserConstants< dim >::get_string |
( |
const std::string & | constant_name | ) |
const |
|
inlinenodiscard |
Retrieve the string from the model_constants that are defined from the parameters.prm parser. This is essentially just a wrapper for boost::get.
- Parameters
-
| constant_name | Name of the constant to retrieve. |
◆ parse_line()
template<unsigned int dim>
| bool UserConstants< dim >::parse_line |
( |
std::string | line, |
|
|
const std::string & | keyword, |
|
|
const std::string & | entry_name, |
|
|
std::string & | out_string, |
|
|
bool | expect_equals_sign ) |
|
static |
Look for a keyword in a line and if it is found, extract the entry name and value. This is used to extract the model constant names from the input file.
◆ primitive_model_constant()
template<unsigned int dim>
Assign the primitive user constants (e.g., int, double, bool).
◆ print()
template<unsigned int dim>
Print all user-specified constants.
◆ remove_parentheses()
template<unsigned int dim>
| void UserConstants< dim >::remove_parentheses |
( |
std::vector< std::string > & | tensor_elements | ) |
|
|
inlineprivate |
Remove and leading and trailing parentheses.
◆ strip_spaces()
template<unsigned int dim>
◆ file_name
template<unsigned int dim>
File to be parsed to extract the user-defined constants.
◆ model_constants
template<unsigned int dim>
List of user-defined constants.
The documentation for this class was generated from the following file: