OGS
LIE/HydroMechanics/HydroMechanicsProcess.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <range/v3/view/join.hpp>
7
15#include "MeshLib/Mesh.h"
16#include "MeshLib/Properties.h"
25
26namespace ProcessLib
27{
28namespace LIE
29{
30namespace HydroMechanics
31{
32template <int DisplacementDim>
34 std::string name,
35 MeshLib::Mesh& mesh,
36 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
37 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
38 unsigned const integration_order,
39 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
40 process_variables,
42 SecondaryVariableCollection&& secondary_variables,
43 bool const use_monolithic_scheme)
44 : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
45 integration_order, std::move(process_variables),
46 std::move(secondary_variables), use_monolithic_scheme),
47 _process_data(std::move(process_data))
48{
49 // For numerical Jacobian assembler
50 if (this->_jacobian_assembler->isPerturbationEnabled())
51 {
52 OGS_FATAL(
53 "The numericial Jacobian assembler is not supported for the "
54 "LIE HydroMechanics process.");
55 }
56
57 INFO("[LIE/HM] looking for fracture elements in the given mesh");
58 std::vector<std::pair<std::size_t, std::vector<int>>>
59 vec_branch_nodeID_matIDs;
60 std::vector<std::pair<std::size_t, std::vector<int>>>
61 vec_junction_nodeID_matIDs;
65 _vec_fracture_nodes, vec_branch_nodeID_matIDs,
66 vec_junction_nodeID_matIDs);
67
68 if (_vec_fracture_mat_IDs.size() !=
69 _process_data.fracture_properties.size())
70 {
72 "The number of the given fracture properties ({:d}) are not "
73 "consistent with the number of fracture groups in a mesh ({:d}).",
74 _process_data.fracture_properties.size(),
76 }
77
78 // create a map from a material ID to a fracture ID
79 auto max_frac_mat_id = std::max_element(_vec_fracture_mat_IDs.begin(),
81 _process_data.map_materialID_to_fractureID.resize(*max_frac_mat_id + 1);
82 for (unsigned i = 0; i < _vec_fracture_mat_IDs.size(); i++)
83 {
84 _process_data.map_materialID_to_fractureID[_vec_fracture_mat_IDs[i]] =
85 i;
86 }
87
88 // create a table of connected fracture IDs for each element
89 _process_data.vec_ele_connected_fractureIDs.resize(
90 mesh.getNumberOfElements());
91 for (unsigned i = 0; i < _vec_fracture_matrix_elements.size(); i++)
92 {
93 for (auto e : _vec_fracture_matrix_elements[i])
94 {
95 _process_data.vec_ele_connected_fractureIDs[e->getID()].push_back(
96 i);
97 }
98 }
99
100 // set fracture property
101 for (auto& fracture_prop : _process_data.fracture_properties)
102 {
103 // based on the 1st element assuming a fracture forms a straight line
105 DisplacementDim,
106 *_vec_fracture_elements[fracture_prop.fracture_id][0],
107 fracture_prop);
108 }
109
110 // set branches
111 for (auto const& [vec_branch_nodeID, matID] : vec_branch_nodeID_matIDs)
112 {
113 auto const master_matId = matID[0];
114 auto const slave_matId = matID[1];
115 auto& master_frac =
116 _process_data.fracture_properties
117 [_process_data.map_materialID_to_fractureID[master_matId]];
118 auto& slave_frac =
119 _process_data.fracture_properties
120 [_process_data.map_materialID_to_fractureID[slave_matId]];
121
122 master_frac.branches_master.push_back(createBranchProperty(
123 *mesh.getNode(vec_branch_nodeID), master_frac, slave_frac));
124
125 slave_frac.branches_slave.push_back(createBranchProperty(
126 *mesh.getNode(vec_branch_nodeID), master_frac, slave_frac));
127 }
128
129 // set junctions
130 transform(cbegin(vec_junction_nodeID_matIDs),
131 cend(vec_junction_nodeID_matIDs),
132 back_inserter(_vec_junction_nodes),
133 [&](auto& vec_junction_nodeID_matID)
134 {
135 return const_cast<MeshLib::Node*>(
136 _mesh.getNode(vec_junction_nodeID_matID.first));
137 });
138
139 for (std::size_t i = 0; i < vec_junction_nodeID_matIDs.size(); i++)
140 {
141 auto const& material_ids = vec_junction_nodeID_matIDs[i].second;
142 assert(material_ids.size() == 2);
143 std::array<int, 2> fracture_ids{
144 {_process_data.map_materialID_to_fractureID[material_ids[0]],
145 _process_data.map_materialID_to_fractureID[material_ids[1]]}};
146
147 _process_data.junction_properties.emplace_back(
148 i, *mesh.getNode(vec_junction_nodeID_matIDs[i].first),
149 fracture_ids);
150 }
151
152 // create a table of connected junction IDs for each element
153 _process_data.vec_ele_connected_junctionIDs.resize(
154 mesh.getNumberOfElements());
155 for (unsigned i = 0; i < vec_junction_nodeID_matIDs.size(); i++)
156 {
157 auto node = mesh.getNode(vec_junction_nodeID_matIDs[i].first);
158 for (auto id :
160 {
161 _process_data.vec_ele_connected_junctionIDs[id].push_back(i);
162 }
163 }
164
165 // create a table of junction node and connected elements
167 vec_junction_nodeID_matIDs.size());
168 for (unsigned i = 0; i < vec_junction_nodeID_matIDs.size(); i++)
169 {
170 auto node = mesh.getNode(vec_junction_nodeID_matIDs[i].first);
171 for (auto e : mesh.getElementsConnectedToNode(*node))
172 {
174 const_cast<MeshLib::Element*>(e));
175 }
176 }
177
178 //
179 // If Neumann BCs for the displacement_jump variable are required they need
180 // special treatment because of the levelset function. The implementation
181 // exists in the version 6.1.0 (e54815cc07ee89c81f953a4955b1c788595dd725)
182 // and was removed due to lack of applications.
183 //
184
185 if (!_process_data.deactivate_matrix_in_flow)
186 {
187 _process_data.p_element_status =
188 std::make_unique<MeshLib::ElementStatus>(&mesh);
189 }
190 else
191 {
192 auto const range =
194 if (!range)
195 {
196 OGS_FATAL(
197 "Could not get minimum/maximum ranges values for the "
198 "MaterialIDs property in the mesh '{:s}'.",
199 mesh.getName());
200 }
201
202 std::vector<int> vec_p_inactive_matIDs;
203 for (int matID = range->first; matID <= range->second; matID++)
204 {
205 if (std::find(_vec_fracture_mat_IDs.begin(),
207 matID) == _vec_fracture_mat_IDs.end())
208 {
209 vec_p_inactive_matIDs.push_back(matID);
210 }
211 }
212 _process_data.p_element_status =
213 std::make_unique<MeshLib::ElementStatus>(&mesh,
214 vec_p_inactive_matIDs);
215
216 const int monolithic_process_id = 0;
217 ProcessVariable const& pv_p =
218 getProcessVariables(monolithic_process_id)[0];
220 }
221 MeshLib::PropertyVector<int> const* material_ids(
222 mesh.getProperties().getPropertyVector<int>("MaterialIDs"));
223 _process_data.mesh_prop_materialIDs = material_ids;
224}
225
226template <int DisplacementDim>
228{
229 //------------------------------------------------------------
230 // prepare mesh subsets to define DoFs
231 //------------------------------------------------------------
232 // for extrapolation
234 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
235 // pressure
237 _process_data.p_element_status->getActiveElements());
239 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh_nodes_p);
240 // regular u
242 std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
243 // u jump
244 for (unsigned i = 0; i < _vec_fracture_nodes.size(); i++)
245 {
247 std::make_unique<MeshLib::MeshSubset const>(
249 }
250 // enrichment for junctions
252 std::make_unique<MeshLib::MeshSubset>(_mesh, _vec_junction_nodes);
253
254 // Collect the mesh subsets in a vector. (pressure, displacement,
255 // displacement_jump_fracture, and displacement_jump_junction)
256 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
257 all_mesh_subsets.emplace_back(*_mesh_subset_nodes_p);
258 std::generate_n(std::back_inserter(all_mesh_subsets), DisplacementDim,
259 [&]() { return *_mesh_subset_matrix_nodes; });
260 for (auto const& ms : _mesh_subset_fracture_nodes)
261 {
262 std::generate_n(std::back_inserter(all_mesh_subsets),
263 DisplacementDim,
264 [&]() { return *ms; });
265 }
266 std::generate_n(std::back_inserter(all_mesh_subsets),
267 DisplacementDim,
268 [&]() { return *_mesh_subset_junction_nodes; });
269
270 // The corresponding number of components for (pressure, displacement,
271 // displacement_jump_fracture, and displacement_jump_junction).
272 std::vector<int> vec_n_components;
273 vec_n_components.push_back(1); // pressure
274 vec_n_components.insert(
275 vec_n_components.end(),
276 1 + _vec_fracture_mat_IDs.size() + _vec_junction_nodes.size(),
277 DisplacementDim); // all displacements
278
279 auto const all_fracture_matrix_elements = _vec_fracture_matrix_elements |
280 ranges::views::join |
281 ranges::to<std::vector>();
282 std::vector<std::vector<MeshLib::Element*> const*> vec_var_elements;
283 if (!_process_data.deactivate_matrix_in_flow)
284 {
285 vec_var_elements.push_back(&_mesh.getElements());
286 }
287 else
288 {
289 // TODO set elements including active nodes for pressure.
290 // cannot use ElementStatus
291 vec_var_elements.push_back(&all_fracture_matrix_elements);
292 }
293 vec_var_elements.push_back(&_vec_matrix_elements);
294 for (unsigned i = 0; i < _vec_fracture_matrix_elements.size(); i++)
295 {
296 vec_var_elements.push_back(&_vec_fracture_matrix_elements[i]);
297 }
298 for (unsigned i = 0; i < _vec_junction_fracture_matrix_elements.size(); i++)
299 {
300 vec_var_elements.push_back(&_vec_junction_fracture_matrix_elements[i]);
301 }
302
303 INFO("[LIE/HM] creating a DoF table");
305 std::make_unique<NumLib::LocalToGlobalIndexMap>(
306 std::move(all_mesh_subsets),
307 vec_n_components,
308 vec_var_elements,
310
311 DBUG("[LIE/HM] created {:d} DoF", _local_to_global_index_map->size());
312}
313
314template <int DisplacementDim>
316 MeshLib::Element const& e, MeshLib::Mesh& mesh)
317{
318 Eigen::Vector3d const pt(getCenterOfGravity(e).asEigenVector3d());
319 std::vector<FractureProperty*> e_fracture_props;
320 std::unordered_map<int, int> e_fracID_to_local;
321 unsigned tmpi = 0;
322 for (auto fid : _process_data.vec_ele_connected_fractureIDs[e.getID()])
323 {
324 e_fracture_props.push_back(&_process_data.fracture_properties[fid]);
325 e_fracID_to_local.insert({fid, tmpi++});
326 }
327 std::vector<JunctionProperty*> e_junction_props;
328 std::unordered_map<int, int> e_juncID_to_local;
329 tmpi = 0;
330 for (auto fid : _process_data.vec_ele_connected_junctionIDs[e.getID()])
331 {
332 e_junction_props.push_back(&_process_data.junction_properties[fid]);
333 e_juncID_to_local.insert({fid, tmpi++});
334 }
335 std::vector<double> const levelsets(uGlobalEnrichments(
336 e_fracture_props, e_junction_props, e_fracID_to_local, pt));
337
338 auto update_levelset_property = [&](unsigned const i, int const id,
339 unsigned const levelset_idx_offset,
340 unsigned const name_offset)
341 {
342 auto levelset_property = MeshLib::getOrCreateMeshProperty<double>(
343 const_cast<MeshLib::Mesh&>(mesh),
344 "levelset" + std::to_string(id + 1 + name_offset),
346 levelset_property->resize(mesh.getNumberOfElements());
347 (*levelset_property)[e.getID()] = levelsets[i + levelset_idx_offset];
348 };
349
350 for (unsigned i = 0; i < e_fracture_props.size(); i++)
351 {
352 update_levelset_property(i, e_fracture_props[i]->fracture_id, 0, 0);
353 }
354 for (unsigned i = 0; i < e_junction_props.size(); i++)
355 {
356 update_levelset_property(i, e_junction_props[i]->junction_id,
357 e_fracture_props.size(),
358 _process_data.fracture_properties.size());
359 }
360}
361
362template <int DisplacementDim>
364 NumLib::LocalToGlobalIndexMap const& dof_table,
365 MeshLib::Mesh const& mesh,
366 unsigned const integration_order)
367{
368 assert(mesh.getDimension() == DisplacementDim);
369 INFO("[LIE/HM] creating local assemblers");
371 DisplacementDim, HydroMechanicsLocalAssemblerMatrix,
374 mesh.getElements(), dof_table, _local_assemblers,
375 NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
377
378 auto add_secondary_variable = [&](std::string const& name,
379 int const num_components,
380 auto get_ip_values_function)
381 {
382 _secondary_variables.addSecondaryVariable(
383 name,
384 makeExtrapolator(num_components, getExtrapolator(),
386 std::move(get_ip_values_function)));
387 };
388
389 add_secondary_variable("sigma",
391 DisplacementDim>::RowsAtCompileTime,
393
394 add_secondary_variable("epsilon",
396 DisplacementDim>::RowsAtCompileTime,
398
399 add_secondary_variable("velocity", DisplacementDim,
401
402 add_secondary_variable("fracture_velocity", DisplacementDim,
404
405 add_secondary_variable("fracture_stress", DisplacementDim,
407
408 add_secondary_variable("fracture_aperture", 1,
410
411 add_secondary_variable(
412 "fracture_permeability", 1,
414
416 const_cast<MeshLib::Mesh&>(mesh), "sigma_avg",
419 DisplacementDim>::RowsAtCompileTime);
420
422 const_cast<MeshLib::Mesh&>(mesh), "velocity_avg",
423 MeshLib::MeshItemType::Cell, DisplacementDim);
424
425 for (MeshLib::Element const* e : _mesh.getElements())
426 {
427 if (e->getDimension() < DisplacementDim)
428 {
429 continue;
430 }
431
432 updateElementLevelSets(*e, const_cast<MeshLib::Mesh&>(mesh));
433 }
434
435 _process_data.element_local_jumps =
437 const_cast<MeshLib::Mesh&>(mesh), "local_jump_w_avg",
438 MeshLib::MeshItemType::Cell, DisplacementDim);
439
440 _process_data.element_fracture_stresses =
442 const_cast<MeshLib::Mesh&>(mesh), "fracture_stress_avg",
443 MeshLib::MeshItemType::Cell, DisplacementDim);
444
445 _process_data.element_fracture_velocities =
447 const_cast<MeshLib::Mesh&>(mesh), "fracture_velocity_avg",
448 MeshLib::MeshItemType::Cell, DisplacementDim);
449
451 const_cast<MeshLib::Mesh&>(mesh), "fracture_aperture_avg",
453
454 mesh_prop_b->resize(mesh.getNumberOfElements());
455 auto const& mesh_prop_matid = *_process_data.mesh_prop_materialIDs;
456 for (auto const& fracture_prop : _process_data.fracture_properties)
457 {
458 for (MeshLib::Element const* e : _mesh.getElements())
459 {
460 if (e->getDimension() == DisplacementDim)
461 {
462 continue;
463 }
464 if (mesh_prop_matid[e->getID()] != fracture_prop.mat_id)
465 {
466 continue;
467 }
468 // Mean value for the element. This allows usage of node based
469 // properties for aperture.
470 (*mesh_prop_b)[e->getID()] =
471 fracture_prop.aperture0
472 .getNodalValuesOnElement(*e, /*time independent*/ 0)
473 .mean();
474 }
475 }
476
477 auto mesh_prop_k_f = MeshLib::getOrCreateMeshProperty<double>(
478 const_cast<MeshLib::Mesh&>(mesh), "fracture_permeability_avg",
480 mesh_prop_k_f->resize(mesh.getNumberOfElements());
481 _process_data.mesh_prop_k_f = mesh_prop_k_f;
482
483 auto mesh_prop_fracture_shear_failure =
485 const_cast<MeshLib::Mesh&>(mesh), "f_shear_failure",
487 mesh_prop_fracture_shear_failure->resize(mesh.getNumberOfElements());
488 _process_data.mesh_prop_fracture_shear_failure =
489 mesh_prop_fracture_shear_failure;
490
491 auto mesh_prop_nodal_p = MeshLib::getOrCreateMeshProperty<double>(
492 const_cast<MeshLib::Mesh&>(mesh), "pressure_interpolated",
494 mesh_prop_nodal_p->resize(mesh.getNumberOfNodes());
495 _process_data.mesh_prop_nodal_p = mesh_prop_nodal_p;
496
497 _process_data.mesh_prop_nodal_forces =
499 const_cast<MeshLib::Mesh&>(mesh), "NodalForces",
500 MeshLib::MeshItemType::Node, DisplacementDim);
501 assert(_process_data.mesh_prop_nodal_forces->size() ==
502 DisplacementDim * mesh.getNumberOfNodes());
503
504 _process_data.mesh_prop_nodal_forces_jump =
506 const_cast<MeshLib::Mesh&>(mesh), "NodalForcesJump",
507 MeshLib::MeshItemType::Node, DisplacementDim);
508 assert(_process_data.mesh_prop_nodal_forces_jump->size() ==
509 DisplacementDim * mesh.getNumberOfNodes());
510
511 _process_data.mesh_prop_hydraulic_flow =
513 const_cast<MeshLib::Mesh&>(mesh), "VolumetricFlowRate",
515 assert(_process_data.mesh_prop_hydraulic_flow->size() ==
516 mesh.getNumberOfNodes());
517 _process_data.mesh_prop_b = mesh_prop_b;
518}
519
520template <int DisplacementDim>
522 std::vector<GlobalVector*> const& x,
523 std::vector<GlobalVector*> const& x_prev, const double t, double const dt,
524 int const process_id)
525{
526 if (process_id == 0)
527 {
528 DBUG("PostTimestep HydroMechanicsProcess.");
529
533 x_prev, t, dt, process_id);
534 }
535
536 DBUG("Compute the secondary variables for HydroMechanicsProcess.");
537
538 const auto& dof_table = getDOFTable(process_id);
539
540 // Copy displacement jumps in a solution vector to mesh property
541 // Remark: the copy is required because mesh properties for primary
542 // variables are set during output and are not ready yet when this function
543 // is called.
544 int g_variable_id = 0;
545 {
546 const int monolithic_process_id = 0;
547 auto const& pvs = getProcessVariables(monolithic_process_id);
548 auto const it =
549 std::find_if(pvs.begin(), pvs.end(), [](ProcessVariable const& pv)
550 { return pv.getName() == "displacement_jump1"; });
551 if (it == pvs.end())
552 {
553 OGS_FATAL(
554 "Didn't find expected 'displacement_jump1' process variable.");
555 }
556 g_variable_id = static_cast<int>(std::distance(pvs.begin(), it));
557 }
558
560
561 const int monolithic_process_id = 0;
562 ProcessVariable& pv_g =
563 this->getProcessVariables(monolithic_process_id)[g_variable_id];
564 auto const num_comp = pv_g.getNumberOfGlobalComponents();
565 auto& mesh_prop_g = *MeshLib::getOrCreateMeshProperty<double>(
566 _mesh, pv_g.getName(), MeshLib::MeshItemType::Node, num_comp);
567 for (int component_id = 0; component_id < num_comp; ++component_id)
568 {
569 auto const& mesh_subset =
570 dof_table.getMeshSubset(g_variable_id, component_id);
571 for (auto const& l : MeshLib::views::meshLocations(
572 mesh_subset, MeshLib::MeshItemType::Node))
573 {
574 auto const global_index =
575 dof_table.getGlobalIndex(l, g_variable_id, component_id);
576 auto const node_id = l.item_id;
577 mesh_prop_g[node_id * num_comp + component_id] =
578 (*x[process_id])[global_index];
579 }
580 }
581}
582
583template <int DisplacementDim>
585{
586 return false;
587}
588
589template <int DisplacementDim>
591 const double t, double const dt, std::vector<GlobalVector*> const& x,
592 std::vector<GlobalVector*> const& x_prev, int const process_id,
594{
595 DBUG("Assemble HydroMechanicsProcess.");
596
597 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
599 // Call global assembler for each local assembly item.
602 dof_table, t, dt, x, x_prev, process_id, &M, &K, &b);
603}
604
605template <int DisplacementDim>
608 const double t, double const dt, std::vector<GlobalVector*> const& x,
609 std::vector<GlobalVector*> const& x_prev, int const process_id,
610 GlobalVector& b, GlobalMatrix& Jac)
611{
612 DBUG("AssembleWithJacobian HydroMechanicsProcess.");
613
614 // Call global assembler for each local assembly item.
615 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
619 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
620 process_id, &b, &Jac);
621
622 auto copyRhs = [&](int const variable_id, auto& output_vector)
623 {
624 transformVariableFromGlobalVector(b, variable_id,
626 output_vector, std::negate<double>());
627 };
628 copyRhs(0, *_process_data.mesh_prop_hydraulic_flow);
629 copyRhs(1, *_process_data.mesh_prop_nodal_forces);
630 copyRhs(2, *_process_data.mesh_prop_nodal_forces_jump);
631}
632
633template <int DisplacementDim>
635 std::vector<GlobalVector*> const& x, double const t, double const dt,
636 int const process_id)
637{
638 DBUG("PreTimestep HydroMechanicsProcess.");
639
642 getActiveElementIDs(), *_local_to_global_index_map, *x[process_id], t,
643 dt);
644}
645
646// ------------------------------------------------------------------------------------
647// template instantiation
648// ------------------------------------------------------------------------------------
649template class HydroMechanicsProcess<2>;
650template class HydroMechanicsProcess<3>;
651
652} // namespace HydroMechanics
653} // namespace LIE
654} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:19
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:80
bool isAxiallySymmetric() const
Definition Mesh.h:128
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:100
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:79
const Node * getNode(std::size_t idx) const
Get the node with the given index.
Definition Mesh.h:82
Properties & getProperties()
Definition Mesh.h:125
const std::string getName() const
Get name of the mesh.
Definition Mesh.h:94
std::size_t getNumberOfNodes() const
Get the number of nodes.
Definition Mesh.h:91
std::vector< Element const * > const & getElementsConnectedToNode(std::size_t node_id) const
Definition Mesh.cpp:246
std::size_t getNumberOfElements() const
Get the number of elements.
Definition Mesh.h:88
PropertyVector< T > const * getPropertyVector(std::string_view name) const
static std::optional< std::pair< T, T > > const getValueBounds(MeshLib::PropertyVector< T > const &property)
virtual std::vector< double > const & getIntPtFracturePermeability(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 & getIntPtDarcyVelocity(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 & getIntPtFractureAperture(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 & getIntPtFractureStress(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 & getIntPtEpsilon(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 & getIntPtFractureVelocity(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 & getIntPtSigma(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
HydroMechanicsProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, HydroMechanicsProcessData< DisplacementDim > &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id) override
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
std::vector< std::unique_ptr< MeshLib::MeshSubset const > > _mesh_subset_fracture_nodes
std::vector< std::vector< MeshLib::Element * > > _vec_junction_fracture_matrix_elements
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, double const t, double const dt, int const process_id) override
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 updateElementLevelSets(MeshLib::Element const &e, MeshLib::Mesh &mesh)
std::vector< std::vector< MeshLib::Element * > > _vec_fracture_elements
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
std::vector< std::unique_ptr< LocalAssemblerInterface > > _local_assemblers
std::vector< std::vector< MeshLib::Element * > > _vec_fracture_matrix_elements
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)
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)
ParameterLib::Parameter< double > const & getInitialCondition() const
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
std::string const name
Definition Process.h:361
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(int const number_of_processes) const
Definition Process.cpp:376
Process(std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
Definition Process.cpp:37
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition Process.h:365
MeshLib::Mesh & _mesh
Definition Process.h:364
std::vector< std::size_t > const & getActiveElementIDs() const
Definition Process.h:160
virtual NumLib::LocalToGlobalIndexMap const & getDOFTable(const int) const
Definition Process.h:140
SecondaryVariableCollection _secondary_variables
Definition Process.h:369
VectorMatrixAssembler _global_assembler
Definition Process.h:376
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition Process.h:367
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > _jacobian_assembler
Definition Process.h:375
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > const & getProcessVariables() const
Definition Process.h:149
NumLib::Extrapolator & getExtrapolator() const
Definition Process.h:201
Handles configuration of several secondary variables from the project file.
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const 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)
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, 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)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
void setLocalAccessibleVector(PETScVector const &x)
Definition LinAlg.cpp:20
constexpr ranges::views::view_closure ids
For an element of a range view return its id.
Definition Mesh.h:216
auto meshLocations(Mesh const &mesh, MeshItemType const item_type)
Definition Mesh.h:227
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
@ BY_COMPONENT
Ordering data by component type.
void createLocalAssemblers(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, NumLib::IntegrationOrder const integration_order, ExtraCtorArgs &&... extra_ctor_args)
void setFractureProperty(int const dim, MeshLib::Element const &e, FractureProperty &frac_prop)
void getFractureMatrixDataInMesh(MeshLib::Mesh const &mesh, std::vector< MeshLib::Element * > &vec_matrix_elements, std::vector< int > &vec_fracture_mat_IDs, std::vector< std::vector< MeshLib::Element * > > &vec_fracture_elements, std::vector< std::vector< MeshLib::Element * > > &vec_fracture_matrix_elements, std::vector< std::vector< MeshLib::Node * > > &vec_fracture_nodes, std::vector< std::pair< std::size_t, std::vector< int > > > &vec_branch_nodeID_matIDs, std::vector< std::pair< std::size_t, std::vector< int > > > &vec_junction_nodeID_matIDs)
std::vector< double > uGlobalEnrichments(std::vector< FractureProperty * > const &frac_props, std::vector< JunctionProperty * > const &junction_props, std::unordered_map< int, int > const &fracID_to_local, Eigen::Vector3d const &x)
BranchProperty createBranchProperty(MeshLib::Node const &branchNode, FractureProperty const &master_frac, FractureProperty const &slave_frac)
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeMemberDereferenced(Object &object, Method method, Container const &container, Args &&... args)