PRISMS-PF Manual
Loading...
Searching...
No Matches
UserConstants< dim > Class Template Reference

Class the stores and manages user-defined constants. More...

#include <user_constants.h>

Classes

class  VariantPrinter
 Class for printing of variant types. This is bad practice and should be fixed. More...
 

Public Types

using InputVariant = boost::variant< double, int, bool, dealii::Tensor< 1, dim >, dealii::Tensor< 2, dim >, dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> >
 

Public Member Functions

InputVariant construct_user_constant (std::vector< std::string > &model_constants_strings)
 Assign the specified user constant to whatever type.
 
double get_model_constant_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_model_constant_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_model_constant_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.
 
dealii::Tensor< 1, dimget_model_constant_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, dimget_model_constant_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_model_constant_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)
 Print all user-specified constants.
 
void print () const
 Print all user-specified constants.
 

Private Member Functions

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, dimcompute_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, dimcompute_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
 
dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> get_cij_matrix (const ElasticityModel &model, const std::vector< double > &constants) const
 

Private Attributes

std::map< std::string, InputVariantmodel_constants
 List of user-defined constants.
 

Detailed Description

template<unsigned int dim>
class UserConstants< dim >

Class the stores and manages user-defined constants.

Member Typedef Documentation

◆ InputVariant

template<unsigned int dim>
using UserConstants< dim >::InputVariant = boost::variant<double, int, bool, dealii::Tensor<1, dim>, dealii::Tensor<2, dim>, dealii::Tensor<2, (2 * dim) - 1 + (dim / 3)> >

Member Function Documentation

◆ 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

Print all user-specified constants.

◆ 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>
UserConstants< dim >::InputVariant UserConstants< dim >::construct_user_constant ( std::vector< std::string > &  model_constants_strings)
inline

Assign the specified user constant to whatever type.

◆ get_cij_matrix()

template<unsigned int dim>
dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> UserConstants< dim >::get_cij_matrix ( const ElasticityModel model,
const std::vector< double > &  constants 
) const
inlineprivate

◆ 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
inlineprivate

◆ get_model_constant_bool()

template<unsigned int dim>
bool UserConstants< dim >::get_model_constant_bool ( const std::string &  constant_name) const
inline

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_nameName of the constant to retrieve.

◆ get_model_constant_double()

template<unsigned int dim>
double UserConstants< dim >::get_model_constant_double ( const std::string &  constant_name) const
inline

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_nameName of the constant to retrieve.

◆ get_model_constant_elasticity_tensor()

template<unsigned int dim>
dealii::Tensor< 2,(2 *dim) - 1+(dim/3)> UserConstants< dim >::get_model_constant_elasticity_tensor ( const std::string &  constant_name) const
inline

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_nameName of the constant to retrieve.

◆ get_model_constant_int()

template<unsigned int dim>
int UserConstants< dim >::get_model_constant_int ( const std::string &  constant_name) const
inline

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_nameName of the constant to retrieve.

◆ get_model_constant_rank_1_tensor()

template<unsigned int dim>
dealii::Tensor< 1, dim > UserConstants< dim >::get_model_constant_rank_1_tensor ( const std::string &  constant_name) const
inline

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_nameName of the constant to retrieve.

◆ get_model_constant_rank_2_tensor()

template<unsigned int dim>
dealii::Tensor< 2, dim > UserConstants< dim >::get_model_constant_rank_2_tensor ( const std::string &  constant_name) const
inline

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_nameName of the constant to retrieve.

◆ primitive_model_constant()

template<unsigned int dim>
UserConstants< dim >::InputVariant UserConstants< dim >::primitive_model_constant ( std::vector< std::string > &  model_constants_strings)
inlineprivate

Assign the primitive user constants (e.g., int, double, bool).

◆ print()

template<unsigned int dim>
void UserConstants< dim >::print ( ) const

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.

Member Data Documentation

◆ model_constants

template<unsigned int dim>
std::map<std::string, InputVariant> UserConstants< dim >::model_constants
private

List of user-defined constants.


The documentation for this class was generated from the following file: