OGS
ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits > Struct Template Reference

Detailed Description

template<int DisplacementDim, typename ConstitutiveTraits>
struct ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >

Definition at line 27 of file LocalAssemblerInterface.h.

#include <LocalAssemblerInterface.h>

Inheritance diagram for ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >:
[legend]
Collaboration diagram for ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >:
[legend]

Public Member Functions

 LocalAssemblerInterface (MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, ThermoRichardsMechanicsProcessData< DisplacementDim, ConstitutiveTraits > &process_data)
 
std::size_t setIPDataInitialConditions (std::string_view name, double const *values, int const integration_order)
 
std::vector< double > getMaterialStateVariableInternalState (std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const &get_values_span, int const &n_components) const
 
unsigned getNumberOfIntegrationPoints () const
 
int getMaterialID () const
 
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt (unsigned integration_point) const
 
void postTimestepConcrete (Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override
 
- Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
 
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
 
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
virtual void preAssemble (double const, double const, std::vector< double > const &)
 
virtual void assemble (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
virtual void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
virtual void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
 
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
 
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const =0
 Provides the shape matrix at the given integration point.
 
virtual ~ExtrapolatableElement ()=default
 

Static Public Member Functions

static auto getReflectionDataForOutput ()
 

Protected Attributes

ThermoRichardsMechanicsProcessData< DisplacementDim, ConstitutiveTraits > & process_data_
 
std::vector< typename ConstitutiveTraits::StatefulData > current_states_
 
std::vector< typename ConstitutiveTraits::StatefulDataPrev > prev_states_
 
std::vector< MaterialStateData< DisplacementDim > > material_states_
 
NumLib::GenericIntegrationMethod const & integration_method_
 
MeshLib::Element const & element_
 
bool const is_axially_symmetric_
 
ConstitutiveTraits::SolidConstitutiveRelation const & solid_material_
 
std::vector< typename ConstitutiveTraits::OutputData > output_data_
 

Constructor & Destructor Documentation

◆ LocalAssemblerInterface()

template<int DisplacementDim, typename ConstitutiveTraits >
ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::LocalAssemblerInterface ( MeshLib::Element const & e,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
ThermoRichardsMechanicsProcessData< DisplacementDim, ConstitutiveTraits > & process_data )
inline

Definition at line 30 of file LocalAssemblerInterface.h.

36 : process_data_(process_data),
37 integration_method_(integration_method),
38 element_(e),
39 is_axially_symmetric_(is_axially_symmetric),
41 process_data_.solid_materials, process_data_.material_ids,
42 e.getID()))
43 {
44 unsigned const n_integration_points =
46
47 current_states_.resize(n_integration_points);
48 prev_states_.resize(n_integration_points);
49 output_data_.resize(n_integration_points);
50
51 material_states_.reserve(n_integration_points);
52 for (unsigned ip = 0; ip < n_integration_points; ++ip)
53 {
54 material_states_.emplace_back(
55 solid_material_.createMaterialStateVariables());
56
57 // Set initial strain field to zero.
58 std::get<StrainData<DisplacementDim>>(current_states_[ip]).eps =
59 KelvinVector<DisplacementDim>::Zero();
60 }
61 }
auto & selectSolidConstitutiveRelation(SolidMaterialsMap const &constitutive_relations, MeshLib::PropertyVector< int > const *const material_ids, std::size_t const element_id)
std::vector< typename ConstitutiveTraits::OutputData > output_data_
ThermoRichardsMechanicsProcessData< DisplacementDim, ConstitutiveTraits > & process_data_
std::vector< typename ConstitutiveTraits::StatefulDataPrev > prev_states_
std::vector< MaterialStateData< DisplacementDim > > material_states_
ConstitutiveTraits::SolidConstitutiveRelation const & solid_material_
std::vector< typename ConstitutiveTraits::StatefulData > current_states_

References ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::current_states_, NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::integration_method_, ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::material_states_, ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::output_data_, ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::prev_states_, and ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::solid_material_.

Member Function Documentation

◆ getMaterialID()

template<int DisplacementDim, typename ConstitutiveTraits >
int ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::getMaterialID ( ) const
inline

◆ getMaterialStateVariableInternalState()

template<int DisplacementDim, typename ConstitutiveTraits >
std::vector< double > ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::getMaterialStateVariableInternalState ( std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const & get_values_span,
int const & n_components ) const
inline

Definition at line 118 of file LocalAssemblerInterface.h.

123 {
127 get_values_span, n_components);
128 }
std::vector< double > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)

References ProcessLib::getIntegrationPointDataMaterialStateVariables(), and ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::material_states_.

◆ getMaterialStateVariablesAt()

template<int DisplacementDim, typename ConstitutiveTraits >
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::getMaterialStateVariablesAt ( unsigned integration_point) const
inline

Definition at line 145 of file LocalAssemblerInterface.h.

146 {
147 return *material_states_[integration_point].material_state_variables;
148 }

References ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::material_states_.

◆ getNumberOfIntegrationPoints()

template<int DisplacementDim, typename ConstitutiveTraits >
unsigned ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::getNumberOfIntegrationPoints ( ) const
inline

◆ getReflectionDataForOutput()

template<int DisplacementDim, typename ConstitutiveTraits >
static auto ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::getReflectionDataForOutput ( )
inlinestatic

Definition at line 170 of file LocalAssemblerInterface.h.

171 {
172 using Self =
174
176 &Self::current_states_, &Self::output_data_);
177 }
auto reflectWithoutName(Accessors &&... accessors)
LocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, ThermoRichardsMechanicsProcessData< DisplacementDim, ConstitutiveTraits > &process_data)

References ProcessLib::Reflection::reflectWithoutName().

◆ postTimestepConcrete()

template<int DisplacementDim, typename ConstitutiveTraits >
void ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::postTimestepConcrete ( Eigen::VectorXd const & ,
Eigen::VectorXd const & ,
double const ,
double const ,
int const  )
inlineoverridevirtual

◆ setIPDataInitialConditions()

template<int DisplacementDim, typename ConstitutiveTraits >
std::size_t ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::setIPDataInitialConditions ( std::string_view name,
double const * values,
int const integration_order )
inline

Definition at line 63 of file LocalAssemblerInterface.h.

66 {
67 if (integration_order !=
68 static_cast<int>(integration_method_.getIntegrationOrder()))
69 {
71 "Setting integration point initial conditions; The integration "
72 "order of the local assembler for element {:d} is different "
73 "from the integration order in the initial condition.",
74 element_.getID());
75 }
76
77 if (name == "sigma" && process_data_.initial_stress.value)
78 {
80 "Setting initial conditions for stress from integration "
81 "point data and from a parameter '{:s}' is not possible "
82 "simultaneously.",
83 process_data_.initial_stress.value->name);
84 }
85
86 // TODO (naumov) this information is runtime information and I'm not
87 // sure how to put it into the reflected data structure. The
88 // reflectWithName function also supports only a single return value.
89 if (name.starts_with("material_state_variable_"))
90 {
91 name.remove_prefix(24);
92
93 auto const& internal_variables =
94 solid_material_.getInternalVariables();
95 if (auto const iv = std::find_if(
96 begin(internal_variables), end(internal_variables),
97 [&name](auto const& iv) { return iv.name == name; });
98 iv != end(internal_variables))
99 {
100 DBUG("Setting material state variable '{:s}'", name);
101 return ProcessLib::
103 values, material_states_,
104 &MaterialStateData<
105 DisplacementDim>::material_state_variables,
106 iv->reference);
107 }
108 return 0;
109 }
110
111 // TODO this logic could be pulled out of the local assembler into the
112 // process. That might lead to a slightly better performance due to less
113 // string comparisons.
115 name, values, current_states_);
116 }
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::size_t reflectSetIPData(std::string_view const name, double const *values, std::vector< IPData > &ip_data_vector)
std::size_t setIntegrationPointDataMaterialStateVariables(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span)

References ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::current_states_, DBUG(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::element_, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getIntegrationOrder(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::integration_method_, ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::material_states_, OGS_FATAL, ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::process_data_, ProcessLib::Reflection::reflectSetIPData(), ProcessLib::setIntegrationPointDataMaterialStateVariables(), and ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::solid_material_.

Member Data Documentation

◆ current_states_

◆ element_

◆ integration_method_

◆ is_axially_symmetric_

template<int DisplacementDim, typename ConstitutiveTraits >
bool const ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::is_axially_symmetric_
protected

Definition at line 194 of file LocalAssemblerInterface.h.

◆ material_states_

◆ output_data_

template<int DisplacementDim, typename ConstitutiveTraits >
std::vector<typename ConstitutiveTraits::OutputData> ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim, ConstitutiveTraits >::output_data_
protected

◆ prev_states_

◆ process_data_

◆ solid_material_


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