29namespace ThermoRichardsMechanics
31template <
int DisplacementDim,
typename ConstitutiveTraits>
36 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
38 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const&
40 unsigned const integration_order,
41 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
44 ConstitutiveTraits>&& process_data,
46 bool const use_monolithic_scheme)
47 :
Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
48 integration_order, std::move(process_variables),
49 std::move(secondary_variables), use_monolithic_scheme),
53 process_data_(std::move(process_data))
56 DisplacementDim>(LocalAssemblerIF::getReflectionDataForOutput(),
57 _integration_point_writer, integration_order,
61template <
int DisplacementDim,
typename ConstitutiveTraits>
62bool ThermoRichardsMechanicsProcess<DisplacementDim,
63 ConstitutiveTraits>::isLinear()
const
68template <
int DisplacementDim,
typename ConstitutiveTraits>
71 ConstitutiveTraits>::getMatrixSpecifications(
const int )
const
73 auto const& l = *_local_to_global_index_map;
74 return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
75 &l.getGhostIndices(), &this->_sparsity_pattern};
78template <
int DisplacementDim,
typename ConstitutiveTraits>
80 ConstitutiveTraits>::constructDofTable()
83 _mesh_subset_all_nodes = std::make_unique<MeshLib::MeshSubset>(
84 _mesh, _mesh.getNodes(), process_data_.use_TaylorHood_elements);
87 mesh_subset_base_nodes_ = std::make_unique<MeshLib::MeshSubset>(
88 _mesh, base_nodes_, process_data_.use_TaylorHood_elements);
92 std::vector<MeshLib::MeshSubset> all__meshsubsets_single_component{
93 *_mesh_subset_all_nodes};
94 local_to_global_index_map_single_component_ =
95 std::make_unique<NumLib::LocalToGlobalIndexMap>(
96 std::move(all__meshsubsets_single_component),
101 std::vector<MeshLib::MeshSubset> all__meshsubsets{*mesh_subset_base_nodes_};
104 all__meshsubsets.push_back(*mesh_subset_base_nodes_);
107 const int monolithic_process_id = 0;
108 std::generate_n(std::back_inserter(all__meshsubsets),
109 getProcessVariables(monolithic_process_id)[2]
111 .getNumberOfGlobalComponents(),
112 [&]() {
return *_mesh_subset_all_nodes; });
114 std::vector<int>
const vec_n_components{1, 1, DisplacementDim};
115 _local_to_global_index_map =
116 std::make_unique<NumLib::LocalToGlobalIndexMap>(
117 std::move(all__meshsubsets), vec_n_components,
119 assert(_local_to_global_index_map);
122template <
int DisplacementDim,
typename ConstitutiveTraits>
126 unsigned const integration_order)
128 createLocalAssemblers<DisplacementDim, ConstitutiveTraits>(
133 auto add_secondary_variable = [&](std::string
const& name,
134 int const num_components,
135 auto get_ip_values_function)
137 _secondary_variables.addSecondaryVariable(
141 std::move(get_ip_values_function)));
144 ProcessLib::Reflection::addReflectedSecondaryVariables<DisplacementDim>(
145 LocalAssemblerIF::getReflectionDataForOutput(), _secondary_variables,
146 getExtrapolator(), local_assemblers_);
153 add_secondary_variable);
157 process_data_.solid_materials, local_assemblers_,
158 _integration_point_writer, integration_order);
160 process_data_.pressure_interpolated =
161 MeshLib::getOrCreateMeshProperty<double>(
164 process_data_.temperature_interpolated =
165 MeshLib::getOrCreateMeshProperty<double>(
166 const_cast<MeshLib::Mesh&
>(mesh),
"temperature_interpolated",
175 *_local_to_global_index_map);
178template <
int DisplacementDim,
typename ConstitutiveTraits>
181 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const&
184 const int process_id = 0;
185 initializeProcessBoundaryConditionsAndSourceTerms(
186 *_local_to_global_index_map, process_id, media);
189template <
int DisplacementDim,
typename ConstitutiveTraits>
193 int const process_id)
195 DBUG(
"SetInitialConditions ThermoRichardsMechanicsProcess.");
198 &LocalAssemblerIF::setInitialConditions, local_assemblers_,
199 getDOFTables(x.size()), x, t, process_id);
202template <
int DisplacementDim,
typename ConstitutiveTraits>
205 std::vector<GlobalVector*>
const& ,
206 std::vector<GlobalVector*>
const& ,
211 "The Picard method or the Newton-Raphson method with numerical "
212 "Jacobian is not implemented for ThermoRichardsMechanics with the full "
213 "monolithic coupling scheme");
216template <
int DisplacementDim,
typename ConstitutiveTraits>
219 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
220 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
224 DisplacementDim, ConstitutiveTraits>>::assembleWithJacobian(t, dt, x,
230template <
int DisplacementDim,
typename ConstitutiveTraits>
238 DisplacementDim, ConstitutiveTraits>>::updateActiveElements();
241template <
int DisplacementDim,
typename ConstitutiveTraits>
242std::vector<std::vector<std::string>>
245 std::vector<std::reference_wrapper<MeshLib::Mesh>>
const& meshes)
247 INFO(
"TRM process initializeSubmeshOutput().");
248 std::vector<std::vector<std::string>> residuum_names{
249 {
"HeatFlowRate",
"MassFlowRate",
"NodalForces"}};
253 initializeAssemblyOnSubmeshes(meshes, residuum_names);
255 return residuum_names;
258template <
int DisplacementDim,
typename ConstitutiveTraits>
261 std::vector<GlobalVector*>
const& x_prev,
262 double const t,
double const dt,
263 const int process_id)
265 DBUG(
"PostTimestep ThermoRichardsMechanicsProcess.");
268 &LocalAssemblerIF::postTimestep, local_assemblers_,
269 getActiveElementIDs(), getDOFTables(x.size()), x, x_prev, t, dt,
273template <
int DisplacementDim,
typename ConstitutiveTraits>
276 std::vector<GlobalVector*>
const& x,
278 int const process_id)
280 DBUG(
"Compute the secondary variables for ThermoRichardsMechanicsProcess.");
283 &LocalAssemblerIF::computeSecondaryVariable, local_assemblers_,
284 getActiveElementIDs(), getDOFTables(x.size()), t, dt, x, x_prev,
287 computeCellAverages<DisplacementDim>(cell_average_data_, local_assemblers_);
290template <
int DisplacementDim,
typename ConstitutiveTraits>
292 DisplacementDim, ConstitutiveTraits>::getDOFTableForExtrapolatorData()
const
294 const bool manage_storage =
false;
295 return std::make_tuple(local_to_global_index_map_single_component_.get(),
299template <
int DisplacementDim,
typename ConstitutiveTraits>
301 DisplacementDim, ConstitutiveTraits>::getDOFTable(
const int )
304 return *_local_to_global_index_map;
314 2, ConstitutiveStressSaturation_StrainPressureTemperature::
315 ConstitutiveTraits<2>>;
317 3, ConstitutiveStressSaturation_StrainPressureTemperature::
318 ConstitutiveTraits<3>>;
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Global vector based on Eigen vector.
bool isAxiallySymmetric() const
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Properties & getProperties()
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > _jacobian_assembler
Handles configuration of several secondary variables from the project file.
Global assembler for the monolithic scheme of the non-isothermal Richards flow coupled with mechanics...
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &, const double, const double, const int) override
void computeSecondaryVariableConcrete(double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id) override
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) override
ThermoRichardsMechanicsProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, ThermoRichardsMechanicsProcessData< DisplacementDim, ConstitutiveTraits > &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
std::vector< std::vector< std::string > > initializeAssemblyOnSubmeshes(std::vector< std::reference_wrapper< MeshLib::Mesh > > const &meshes) override
void setInitialConditionsConcreteProcess(std::vector< GlobalVector * > &x, double const t, int const process_id) override
void initializeBoundaryConditions(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media) override
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, const int process_id) override
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
@ BY_LOCATION
Ordering data by spatial location.
void addReflectedIntegrationPointWriters(ReflData const &reflection_data, std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > &integration_point_writers, unsigned const integration_order, std::vector< std::unique_ptr< LocAsmIF > > const &local_assemblers)
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
void setIPDataInitialConditions(std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const &_integration_point_writer, MeshLib::Properties const &mesh_properties, LocalAssemblersVector &local_assemblers)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)