OGS
ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim > Struct Template Reference

Detailed Description

template<int DisplacementDim>
struct ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >

Definition at line 29 of file LocalAssemblerInterface.h.

#include <LocalAssemblerInterface.h>

Inheritance diagram for ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >:
[legend]

Public Member Functions

 LocalAssemblerInterface (MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, RichardsMechanicsProcessData< DisplacementDim > &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 final
 
- 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

RichardsMechanicsProcessData< DisplacementDim > & process_data_
 
NumLib::GenericIntegrationMethod const & integration_method_
 
MeshLib::Element const & element_
 
bool const is_axially_symmetric_
 
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material_
 
std::vector< StatefulData< DisplacementDim > > current_states_
 
std::vector< StatefulDataPrev< DisplacementDim > > prev_states_
 
std::vector< ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > > material_states_
 
std::vector< OutputData< DisplacementDim > > output_data_
 

Constructor & Destructor Documentation

◆ LocalAssemblerInterface()

template<int DisplacementDim>
ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::LocalAssemblerInterface ( MeshLib::Element const & e,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
RichardsMechanicsProcessData< DisplacementDim > & process_data )
inline

Definition at line 32 of file LocalAssemblerInterface.h.

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

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

Member Function Documentation

◆ getMaterialID()

template<int DisplacementDim>
int ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getMaterialID ( ) const
inline

Definition at line 136 of file LocalAssemblerInterface.h.

137 {
138 return process_data_.material_ids == nullptr
139 ? 0
140 : (*process_data_.material_ids)[element_.getID()];
141 }
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89

References ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MeshLib::Element::getID(), and ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_.

◆ getMaterialStateVariableInternalState()

template<int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::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 117 of file LocalAssemblerInterface.h.

122 {
126 DisplacementDim>::material_state_variables,
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::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_.

◆ getMaterialStateVariablesAt()

template<int DisplacementDim>
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::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::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_.

◆ getNumberOfIntegrationPoints()

template<int DisplacementDim>
unsigned ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getNumberOfIntegrationPoints ( ) const
inline

◆ getReflectionDataForOutput()

template<int DisplacementDim>
static auto ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getReflectionDataForOutput ( )
inlinestatic

Definition at line 150 of file LocalAssemblerInterface.h.

151 {
153
155 &Self::current_states_, &Self::output_data_);
156 }
auto reflectWithoutName(Accessors &&... accessors)
LocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, RichardsMechanicsProcessData< DisplacementDim > &process_data)

References ProcessLib::Reflection::reflectWithoutName().

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::RichardsMechanicsProcess().

◆ postTimestepConcrete()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::postTimestepConcrete ( Eigen::VectorXd const & ,
Eigen::VectorXd const & ,
double const ,
double const ,
int const  )
inlinefinaloverridevirtual

◆ setIPDataInitialConditions()

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

Definition at line 65 of file LocalAssemblerInterface.h.

68 {
69 if (integration_order !=
70 static_cast<int>(integration_method_.getIntegrationOrder()))
71 {
73 "Setting integration point initial conditions; The integration "
74 "order of the local assembler for element {:d} is different "
75 "from the integration order in the initial condition.",
76 element_.getID());
77 }
78
79 if (name == "sigma" && process_data_.initial_stress.value != nullptr)
80 {
82 "Setting initial conditions for stress from integration "
83 "point data and from a parameter '{:s}' is not possible "
84 "simultaneously.",
85 process_data_.initial_stress.value->name);
86 }
87
88 if (name.starts_with("material_state_variable_"))
89 {
90 name.remove_prefix(24);
91
92 auto const& internal_variables =
93 solid_material_.getInternalVariables();
94 if (auto const iv = std::find_if(
95 begin(internal_variables), end(internal_variables),
96 [&name](auto const& iv) { return iv.name == name; });
97 iv != end(internal_variables))
98 {
99 DBUG("Setting material state variable '{:s}'", name);
100 return ProcessLib::
102 values, material_states_,
104 DisplacementDim>::material_state_variables,
105 iv->reference);
106 }
107 return 0;
108 }
109
110 // TODO this logic could be pulled out of the local assembler into the
111 // process. That might lead to a slightly better performance due to less
112 // string comparisons.
114 name, values, current_states_);
115 }
#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::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, DBUG(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getIntegrationOrder(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_, OGS_FATAL, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_, ProcessLib::Reflection::reflectSetIPData(), ProcessLib::setIntegrationPointDataMaterialStateVariables(), and ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::solid_material_.

Member Data Documentation

◆ current_states_

◆ element_

◆ integration_method_

◆ is_axially_symmetric_

template<int DisplacementDim>
bool const ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_
protected

Definition at line 181 of file LocalAssemblerInterface.h.

◆ material_states_

◆ output_data_

template<int DisplacementDim>
std::vector<OutputData<DisplacementDim> > ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::output_data_
protected

◆ prev_states_

◆ process_data_

◆ solid_material_


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