OGS
LocalAssemblerInterface.h
Go to the documentation of this file.
1
11#pragma once
12
22#include "TH2MProcessData.h"
23
24namespace ProcessLib
25{
26namespace TH2M
27{
28template <int DisplacementDim>
31{
33 MeshLib::Element const& e,
34 NumLib::GenericIntegrationMethod const& integration_method,
35 bool const is_axially_symmetric,
37 : process_data_(process_data),
38 integration_method_(integration_method),
39 element_(e),
40 is_axially_symmetric_(is_axially_symmetric),
41 solid_material_(MaterialLib::Solids::selectSolidConstitutiveRelation(
42 process_data_.solid_materials, process_data_.material_ids,
43 element_.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 for (unsigned ip = 0; ip < n_integration_points; ++ip)
54 {
55 material_states_.emplace_back(
56 solid_material_.createMaterialStateVariables());
57
58 // Set initial stress field to zero. Might be overwritten by
59 // integration point data or initial stress.
60 current_states_[ip].eff_stress_data.sigma =
62 }
63 }
64
65 virtual std::size_t setIPDataInitialConditions(
66 std::string_view name, double const* values,
67 int const integration_order) = 0;
68
69 virtual std::vector<double> const& getIntPtDarcyVelocityGas(
70 const double t,
71 std::vector<GlobalVector*> const& x,
72 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
73 std::vector<double>& cache) const = 0;
74
75 virtual std::vector<double> const& getIntPtDarcyVelocityLiquid(
76 const double t,
77 std::vector<GlobalVector*> const& x,
78 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
79 std::vector<double>& cache) const = 0;
80
81 virtual std::vector<double> const& getIntPtDiffusionVelocityVapourGas(
82 const double t,
83 std::vector<GlobalVector*> const& x,
84 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
85 std::vector<double>& cache) const = 0;
86
87 virtual std::vector<double> const& getIntPtDiffusionVelocityGasGas(
88 const double t,
89 std::vector<GlobalVector*> const& x,
90 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
91 std::vector<double>& cache) const = 0;
92
93 virtual std::vector<double> const& getIntPtDiffusionVelocitySoluteLiquid(
94 const double t,
95 std::vector<GlobalVector*> const& x,
96 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
97 std::vector<double>& cache) const = 0;
98
99 virtual std::vector<double> const& getIntPtDiffusionVelocityLiquidLiquid(
100 const double t,
101 std::vector<GlobalVector*> const& x,
102 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
103 std::vector<double>& cache) const = 0;
104
105 virtual std::vector<double> const& getIntPtEnthalpySolid(
106 const double t,
107 std::vector<GlobalVector*> const& x,
108 std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
109 std::vector<double>& cache) const = 0;
110
111 // TODO move to NumLib::ExtrapolatableElement
113 {
115 }
116
117 int getMaterialID() const
118 {
119 return process_data_.material_ids == nullptr
120 ? 0
121 : (*process_data_.material_ids)[element_.getID()];
122 }
123
125 std::function<std::span<double>(
127 DisplacementDim>::MaterialStateVariables&)> const&
128 get_values_span,
129 int const& n_components) const
130 {
134 DisplacementDim>::material_state_variables,
135 get_values_span, n_components);
136 }
137
139 DisplacementDim>::MaterialStateVariables const&
140 getMaterialStateVariablesAt(unsigned integration_point) const
141 {
142 return *material_states_[integration_point].material_state_variables;
143 }
144
146 {
148
150 &Self::current_states_, &Self::output_data_);
151 }
152
154
155 std::vector<typename ConstitutiveRelations::StatefulData<DisplacementDim>>
156 current_states_; // TODO maybe do not store but rather re-evaluate for
157 // state update
158 std::vector<
161
162 // Material state is special, because it contains both the current and the
163 // old state.
164 std::vector<ConstitutiveRelations::MaterialStateData<DisplacementDim>>
166 std::vector<ConstitutiveRelations::OutputData<DisplacementDim>>
168
174};
175
176} // namespace TH2M
177} // namespace ProcessLib
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
auto reflectWithoutName(Accessors &&... accessors)
KV::KelvinVectorType< DisplacementDim > KelvinVector
Definition Base.h:26
std::vector< double > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)
NumLib::GenericIntegrationMethod const & integration_method_
virtual std::vector< double > const & getIntPtDarcyVelocityGas(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
LocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, TH2MProcessData< DisplacementDim > &process_data)
std::vector< double > getMaterialStateVariableInternalState(std::function< std::span< double >(typename ConstitutiveRelations::SolidConstitutiveRelation< DisplacementDim >::MaterialStateVariables &)> const &get_values_span, int const &n_components) const
TH2MProcessData< DisplacementDim > & process_data_
virtual std::size_t setIPDataInitialConditions(std::string_view name, double const *values, int const integration_order)=0
ConstitutiveRelations::SolidConstitutiveRelation< DisplacementDim > const & solid_material_
std::vector< typename ConstitutiveRelations::StatefulData< DisplacementDim > > current_states_
std::vector< typename ConstitutiveRelations::StatefulDataPrev< DisplacementDim > > prev_states_
virtual std::vector< double > const & getIntPtDiffusionVelocitySoluteLiquid(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDiffusionVelocityVapourGas(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDarcyVelocityLiquid(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDiffusionVelocityLiquidLiquid(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
ConstitutiveRelations::SolidConstitutiveRelation< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt(unsigned integration_point) const
virtual std::vector< double > const & getIntPtDiffusionVelocityGasGas(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtEnthalpySolid(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
std::vector< ConstitutiveRelations::OutputData< DisplacementDim > > output_data_
std::vector< ConstitutiveRelations::MaterialStateData< DisplacementDim > > material_states_