NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble::MaterialFactory Class Reference

#include <nimble_material_factory.h>

Inheritance diagram for nimble::MaterialFactory:
nimble::MaterialFactoryBase

Public Member Functions

 MaterialFactory ()
 
 ~MaterialFactory () override=default
 
- Public Member Functions inherited from nimble::MaterialFactoryBase
 MaterialFactoryBase ()
 
virtual ~MaterialFactoryBase ()=default
 
void add_valid_double_parameter_name (const char *name)
 
void add_valid_string_parameter_name (const char *name)
 
virtual std::shared_ptr< nimble::Materialget_material () const
 
virtual void parse_and_create (const std::string &mat_params, int num_points)
 
virtual void parse_and_create (const std::string &mat_params)
 
virtual std::map< std::string, double > parse_material_params_string (const std::string &mat_params)
 

Protected Member Functions

void create () override
 
- Protected Member Functions inherited from nimble::MaterialFactoryBase
std::shared_ptr< nimble::MaterialParametersParseMaterialParametersString (const std::string &material_parameters, int num_material_points=0) const
 
std::map< std::string, double > ParseMaterialParamsStringToMap (const std::string &material_parameters) const
 

Additional Inherited Members

- Protected Attributes inherited from nimble::MaterialFactoryBase
std::shared_ptr< nimble::Materialmaterial = nullptr
 
std::shared_ptr< const nimble::MaterialParametersmaterial_params
 

Constructor & Destructor Documentation

◆ MaterialFactory()

nimble::MaterialFactory::MaterialFactory ( )
explicit
MaterialFactoryBase()
Definition nimble_material_factory_base.cc:56

◆ ~MaterialFactory()

nimble::MaterialFactory::~MaterialFactory ( )
overridedefault

Member Function Documentation

◆ create()

void nimble::MaterialFactory::create ( )
overrideprotectedvirtual

Implements nimble::MaterialFactoryBase.

58{
59 auto name_string = material_params->GetMaterialName(false);
60 if (name_string == "neohookean") {
61 material = std::make_shared<NeohookeanMaterial>(*material_params);
62 } else if (name_string == "elastic") {
63 material = std::make_shared<ElasticMaterial>(*material_params);
64 } else {
65 throw std::invalid_argument(
66 "\nError in Block::InstantiateMaterialModel(), invalid material model "
67 "name.\n");
68 }
69}
std::shared_ptr< nimble::Material > material
Definition nimble_material_factory_base.h:125
std::shared_ptr< const nimble::MaterialParameters > material_params
Definition nimble_material_factory_base.h:126

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