OGS 6.1.0-1721-g6382411ad
HydroMechanicsProcess.cpp
Go to the documentation of this file.
1 
10 #include "HydroMechanicsProcess.h"
11 
13 #include "MeshLib/ElementStatus.h"
14 #include "MeshLib/Elements/Utils.h"
15 #include "MeshLib/Mesh.h"
17 #include "MeshLib/Properties.h"
18 
21 
26 
27 #include "LocalAssembler/CreateLocalAssemblers.h"
31 
32 namespace ProcessLib
33 {
34 namespace LIE
35 {
36 namespace HydroMechanics
37 {
38 template <int GlobalDim>
40  MeshLib::Mesh& mesh,
41  std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
42  std::vector<std::unique_ptr<ParameterBase>> const& parameters,
43  unsigned const integration_order,
44  std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&& process_variables,
46  SecondaryVariableCollection&& secondary_variables,
47  NumLib::NamedFunctionCaller&& named_function_caller,
48  bool const use_monolithic_scheme)
49  : Process(mesh, std::move(jacobian_assembler), parameters,
50  integration_order, std::move(process_variables),
51  std::move(secondary_variables), std::move(named_function_caller),
52  use_monolithic_scheme),
53  _process_data(std::move(process_data))
54 {
55  INFO("[LIE/HM] looking for fracture elements in the given mesh");
56  std::vector<int> vec_fracture_mat_IDs;
57  std::vector<std::vector<MeshLib::Element*>> vec_vec_fracture_elements;
58  std::vector<std::vector<MeshLib::Element*>>
59  vec_vec_fracture_matrix_elements;
60  std::vector<std::vector<MeshLib::Node*>> vec_vec_fracture_nodes;
61  std::vector<std::pair<std::size_t, std::vector<int>>>
62  vec_branch_nodeID_matIDs;
63  std::vector<std::pair<std::size_t, std::vector<int>>>
64  vec_junction_nodeID_matIDs;
66  mesh, _vec_matrix_elements, vec_fracture_mat_IDs,
67  vec_vec_fracture_elements, vec_vec_fracture_matrix_elements,
68  vec_vec_fracture_nodes, vec_branch_nodeID_matIDs,
69  vec_junction_nodeID_matIDs);
71  vec_vec_fracture_elements[0].begin(),
72  vec_vec_fracture_elements[0].end());
75  vec_vec_fracture_matrix_elements[0].begin(),
76  vec_vec_fracture_matrix_elements[0].end());
78  vec_vec_fracture_nodes[0].begin(),
79  vec_vec_fracture_nodes[0].end());
80 
81  if (!_vec_fracture_elements.empty())
82  {
83  // set fracture property assuming a fracture forms a straight line
84  setFractureProperty(GlobalDim,
86  *_process_data.fracture_property);
87  }
88 
89  //
90  // If Neumann BCs for the displacement_jump variable are required they need
91  // special treatment because of the levelset function. The implementation
92  // exists in the version 6.1.0 (e54815cc07ee89c81f953a4955b1c788595dd725)
93  // and was removed due to lack of applications.
94  //
95 
96  if (!_process_data.deactivate_matrix_in_flow)
97  {
98  _process_data.p_element_status =
99  std::make_unique<MeshLib::ElementStatus>(&mesh);
100  }
101  else
102  {
103  auto range =
104  MeshLib::MeshInformation::getValueBounds<int>(mesh, "MaterialIDs");
105  std::vector<int> vec_p_inactive_matIDs;
106  for (int matID = range.first; matID <= range.second; matID++)
107  {
108  if (std::find(vec_fracture_mat_IDs.begin(),
109  vec_fracture_mat_IDs.end(),
110  matID) == vec_fracture_mat_IDs.end())
111  {
112  vec_p_inactive_matIDs.push_back(matID);
113  }
114  }
115  _process_data.p_element_status =
116  std::make_unique<MeshLib::ElementStatus>(&mesh,
117  vec_p_inactive_matIDs);
118 
119  const int monolithic_process_id = 0;
120  ProcessVariable const& pv_p =
121  getProcessVariables(monolithic_process_id)[0];
122  _process_data.p0 = &pv_p.getInitialCondition();
123  }
124 }
125 
126 template <int GlobalDim>
128 {
129  //------------------------------------------------------------
130  // prepare mesh subsets to define DoFs
131  //------------------------------------------------------------
132  // for extrapolation
134  std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
135  // pressure
137  _process_data.p_element_status->getActiveElements());
139  std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh_nodes_p);
140  // regular u
142  std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
143  if (!_vec_fracture_nodes.empty())
144  {
145  // u jump
147  std::make_unique<MeshLib::MeshSubset>(_mesh, _vec_fracture_nodes);
148  }
149 
150  // Collect the mesh subsets in a vector.
151  std::vector<MeshLib::MeshSubset> all_mesh_subsets;
152  std::vector<int> vec_n_components;
153  std::vector<std::vector<MeshLib::Element*> const*> vec_var_elements;
154  // pressure
155  vec_n_components.push_back(1);
156  all_mesh_subsets.emplace_back(*_mesh_subset_nodes_p);
157  if (!_process_data.deactivate_matrix_in_flow)
158  {
159  vec_var_elements.push_back(&_mesh.getElements());
160  }
161  else
162  {
163  // TODO set elements including active nodes for pressure.
164  // cannot use ElementStatus
165  vec_var_elements.push_back(&_vec_fracture_matrix_elements);
166  }
167  // regular displacement
168  vec_n_components.push_back(GlobalDim);
169  std::generate_n(std::back_inserter(all_mesh_subsets), GlobalDim,
170  [&]() { return *_mesh_subset_matrix_nodes; });
171  vec_var_elements.push_back(&_vec_matrix_elements);
172  if (!_vec_fracture_nodes.empty())
173  {
174  // displacement jump
175  vec_n_components.push_back(GlobalDim);
176  std::generate_n(std::back_inserter(all_mesh_subsets), GlobalDim,
177  [&]() { return *_mesh_subset_fracture_nodes; });
178  vec_var_elements.push_back(&_vec_fracture_matrix_elements);
179  }
180 
181  INFO("[LIE/HM] creating a DoF table");
183  std::make_unique<NumLib::LocalToGlobalIndexMap>(
184  std::move(all_mesh_subsets),
185  vec_n_components,
186  vec_var_elements,
188 
189  DBUG("created %d DoF", _local_to_global_index_map->size());
190 }
191 
192 template <int GlobalDim>
194  NumLib::LocalToGlobalIndexMap const& dof_table,
195  MeshLib::Mesh const& mesh,
196  unsigned const integration_order)
197 {
198  assert(mesh.getDimension() == GlobalDim);
199  INFO("[LIE/HM] creating local assemblers");
200  const int monolithic_process_id = 0;
205  mesh.getElements(), dof_table,
206  // use displacment process variable for shapefunction order
208  monolithic_process_id)[1].get().getShapeFunctionOrder(),
209  _local_assemblers, mesh.isAxiallySymmetric(), integration_order,
210  _process_data);
211 
212  auto mesh_prop_sigma_xx = MeshLib::getOrCreateMeshProperty<double>(
213  const_cast<MeshLib::Mesh&>(mesh), "stress_xx",
215  mesh_prop_sigma_xx->resize(mesh.getNumberOfElements());
216  _process_data.mesh_prop_stress_xx = mesh_prop_sigma_xx;
217 
218  auto mesh_prop_sigma_yy = MeshLib::getOrCreateMeshProperty<double>(
219  const_cast<MeshLib::Mesh&>(mesh), "stress_yy",
221  mesh_prop_sigma_yy->resize(mesh.getNumberOfElements());
222  _process_data.mesh_prop_stress_yy = mesh_prop_sigma_yy;
223 
224  auto mesh_prop_sigma_zz = MeshLib::getOrCreateMeshProperty<double>(
225  const_cast<MeshLib::Mesh&>(mesh), "stress_zz",
227  mesh_prop_sigma_zz->resize(mesh.getNumberOfElements());
228  _process_data.mesh_prop_stress_zz = mesh_prop_sigma_zz;
229 
230  auto mesh_prop_sigma_xy = MeshLib::getOrCreateMeshProperty<double>(
231  const_cast<MeshLib::Mesh&>(mesh), "stress_xy",
233  mesh_prop_sigma_xy->resize(mesh.getNumberOfElements());
234  _process_data.mesh_prop_stress_xy = mesh_prop_sigma_xy;
235 
236  if (GlobalDim == 3)
237  {
238  auto mesh_prop_sigma_xz = MeshLib::getOrCreateMeshProperty<double>(
239  const_cast<MeshLib::Mesh&>(mesh), "stress_xz",
241  mesh_prop_sigma_xz->resize(mesh.getNumberOfElements());
242  _process_data.mesh_prop_stress_xz = mesh_prop_sigma_xz;
243 
244  auto mesh_prop_sigma_yz = MeshLib::getOrCreateMeshProperty<double>(
245  const_cast<MeshLib::Mesh&>(mesh), "stress_yz",
247  mesh_prop_sigma_yz->resize(mesh.getNumberOfElements());
248  _process_data.mesh_prop_stress_yz = mesh_prop_sigma_yz;
249  }
250 
251  auto mesh_prop_epsilon_xx = MeshLib::getOrCreateMeshProperty<double>(
252  const_cast<MeshLib::Mesh&>(mesh), "strain_xx",
254  mesh_prop_epsilon_xx->resize(mesh.getNumberOfElements());
255  _process_data.mesh_prop_strain_xx = mesh_prop_epsilon_xx;
256 
257  auto mesh_prop_epsilon_yy = MeshLib::getOrCreateMeshProperty<double>(
258  const_cast<MeshLib::Mesh&>(mesh), "strain_yy",
260  mesh_prop_epsilon_yy->resize(mesh.getNumberOfElements());
261  _process_data.mesh_prop_strain_yy = mesh_prop_epsilon_yy;
262 
263  auto mesh_prop_epsilon_zz = MeshLib::getOrCreateMeshProperty<double>(
264  const_cast<MeshLib::Mesh&>(mesh), "strain_zz",
266  mesh_prop_epsilon_zz->resize(mesh.getNumberOfElements());
267  _process_data.mesh_prop_strain_zz = mesh_prop_epsilon_zz;
268 
269  auto mesh_prop_epsilon_xy = MeshLib::getOrCreateMeshProperty<double>(
270  const_cast<MeshLib::Mesh&>(mesh), "strain_xy",
272  mesh_prop_epsilon_xy->resize(mesh.getNumberOfElements());
273  _process_data.mesh_prop_strain_xy = mesh_prop_epsilon_xy;
274 
275  if (GlobalDim == 3)
276  {
277  auto mesh_prop_epsilon_xz = MeshLib::getOrCreateMeshProperty<double>(
278  const_cast<MeshLib::Mesh&>(mesh), "strain_xz",
280  mesh_prop_epsilon_xz->resize(mesh.getNumberOfElements());
281  _process_data.mesh_prop_strain_xz = mesh_prop_epsilon_xz;
282 
283  auto mesh_prop_epsilon_yz = MeshLib::getOrCreateMeshProperty<double>(
284  const_cast<MeshLib::Mesh&>(mesh), "strain_yz",
286  mesh_prop_epsilon_yz->resize(mesh.getNumberOfElements());
287  _process_data.mesh_prop_strain_yz = mesh_prop_epsilon_yz;
288  }
289 
290  auto mesh_prop_velocity = MeshLib::getOrCreateMeshProperty<double>(
291  const_cast<MeshLib::Mesh&>(mesh), "velocity",
293  mesh_prop_velocity->resize(mesh.getNumberOfElements() * 3);
294  _process_data.mesh_prop_velocity = mesh_prop_velocity;
295 
296  if (!_vec_fracture_elements.empty())
297  {
298  auto mesh_prop_levelset = MeshLib::getOrCreateMeshProperty<double>(
299  const_cast<MeshLib::Mesh&>(mesh), "levelset1",
301  mesh_prop_levelset->resize(mesh.getNumberOfElements());
302  for (MeshLib::Element const* e : _mesh.getElements())
303  {
304  if (e->getDimension() < GlobalDim)
305  {
306  continue;
307  }
308 
309  std::vector<FractureProperty*> fracture_props(
310  {_process_data.fracture_property.get()});
311  std::vector<JunctionProperty*> junction_props;
312  std::unordered_map<int, int> fracID_to_local({{0, 0}});
313  std::vector<double> levelsets = uGlobalEnrichments(
314  fracture_props, junction_props, fracID_to_local,
315  Eigen::Vector3d(e->getCenterOfGravity().getCoords()));
316  (*mesh_prop_levelset)[e->getID()] = levelsets[0];
317  }
318 
319  auto mesh_prop_w_n = MeshLib::getOrCreateMeshProperty<double>(
320  const_cast<MeshLib::Mesh&>(mesh), "w_n",
322  mesh_prop_w_n->resize(mesh.getNumberOfElements());
323  auto mesh_prop_w_s = MeshLib::getOrCreateMeshProperty<double>(
324  const_cast<MeshLib::Mesh&>(mesh), "w_s",
326  mesh_prop_w_s->resize(mesh.getNumberOfElements());
327  _process_data.mesh_prop_w_n = mesh_prop_w_n;
328  _process_data.mesh_prop_w_s = mesh_prop_w_s;
329 
330  auto mesh_prop_b = MeshLib::getOrCreateMeshProperty<double>(
331  const_cast<MeshLib::Mesh&>(mesh), "aperture",
333  mesh_prop_b->resize(mesh.getNumberOfElements());
334  auto const mesh_prop_matid = materialIDs(mesh);
335  if (!mesh_prop_matid)
336  {
337  OGS_FATAL("Could not access MaterialIDs property from mesh.");
338  }
339  auto const& frac = _process_data.fracture_property;
340  for (MeshLib::Element const* e : _mesh.getElements())
341  {
342  if (e->getDimension() == GlobalDim)
343  {
344  continue;
345  }
346  if ((*mesh_prop_matid)[e->getID()] != frac->mat_id)
347  {
348  continue;
349  }
351  x.setElementID(e->getID());
352  (*mesh_prop_b)[e->getID()] = frac->aperture0(0, x)[0];
353  }
354  _process_data.mesh_prop_b = mesh_prop_b;
355 
356  auto mesh_prop_k_f = MeshLib::getOrCreateMeshProperty<double>(
357  const_cast<MeshLib::Mesh&>(mesh), "k_f",
359  mesh_prop_k_f->resize(mesh.getNumberOfElements());
360  _process_data.mesh_prop_k_f = mesh_prop_k_f;
361 
362  auto mesh_prop_fracture_stress_shear =
363  MeshLib::getOrCreateMeshProperty<double>(
364  const_cast<MeshLib::Mesh&>(mesh), "f_stress_s",
366  mesh_prop_fracture_stress_shear->resize(mesh.getNumberOfElements());
367  _process_data.mesh_prop_fracture_stress_shear =
368  mesh_prop_fracture_stress_shear;
369 
370  auto mesh_prop_fracture_stress_normal =
371  MeshLib::getOrCreateMeshProperty<double>(
372  const_cast<MeshLib::Mesh&>(mesh), "f_stress_n",
374  mesh_prop_fracture_stress_normal->resize(mesh.getNumberOfElements());
375  _process_data.mesh_prop_fracture_stress_normal =
376  mesh_prop_fracture_stress_normal;
377 
378  auto mesh_prop_fracture_shear_failure =
379  MeshLib::getOrCreateMeshProperty<double>(
380  const_cast<MeshLib::Mesh&>(mesh), "f_shear_failure",
382  mesh_prop_fracture_shear_failure->resize(mesh.getNumberOfElements());
383  _process_data.mesh_prop_fracture_shear_failure =
384  mesh_prop_fracture_shear_failure;
385 
386  auto mesh_prop_nodal_w = MeshLib::getOrCreateMeshProperty<double>(
387  const_cast<MeshLib::Mesh&>(mesh), "nodal_w",
388  MeshLib::MeshItemType::Node, GlobalDim);
389  mesh_prop_nodal_w->resize(mesh.getNumberOfNodes() * GlobalDim);
390  _process_data.mesh_prop_nodal_w = mesh_prop_nodal_w;
391 
392  auto mesh_prop_nodal_b = MeshLib::getOrCreateMeshProperty<double>(
393  const_cast<MeshLib::Mesh&>(mesh), "nodal_aperture",
395  mesh_prop_nodal_b->resize(mesh.getNumberOfNodes());
396  _process_data.mesh_prop_nodal_b = mesh_prop_nodal_b;
397 
398  if (GlobalDim == 3)
399  {
400  auto mesh_prop_w_s2 = MeshLib::getOrCreateMeshProperty<double>(
401  const_cast<MeshLib::Mesh&>(mesh), "w_s2",
403  mesh_prop_w_s2->resize(mesh.getNumberOfElements());
404  _process_data.mesh_prop_w_s2 = mesh_prop_w_s2;
405 
406  auto mesh_prop_fracture_stress_shear2 =
407  MeshLib::getOrCreateMeshProperty<double>(
408  const_cast<MeshLib::Mesh&>(mesh), "f_stress_s2",
410  mesh_prop_fracture_stress_shear2->resize(
411  mesh.getNumberOfElements());
412  _process_data.mesh_prop_fracture_stress_shear2 =
413  mesh_prop_fracture_stress_shear2;
414  }
415 
416  auto mesh_prop_nodal_p = MeshLib::getOrCreateMeshProperty<double>(
417  const_cast<MeshLib::Mesh&>(mesh), "pressure_interpolated",
419  mesh_prop_nodal_p->resize(mesh.getNumberOfNodes());
420  _process_data.mesh_prop_nodal_p = mesh_prop_nodal_p;
421 
422  _process_data.mesh_prop_nodal_forces =
423  MeshLib::getOrCreateMeshProperty<double>(
424  const_cast<MeshLib::Mesh&>(mesh), "NodalForces",
425  MeshLib::MeshItemType::Node, GlobalDim);
426  assert(_process_data.mesh_prop_nodal_forces->size() ==
427  GlobalDim * mesh.getNumberOfNodes());
428 
429  _process_data.mesh_prop_nodal_forces_jump =
430  MeshLib::getOrCreateMeshProperty<double>(
431  const_cast<MeshLib::Mesh&>(mesh), "NodalForcesJump",
432  MeshLib::MeshItemType::Node, GlobalDim);
433  assert(_process_data.mesh_prop_nodal_forces_jump->size() ==
434  GlobalDim * mesh.getNumberOfNodes());
435 
436  _process_data.mesh_prop_hydraulic_flow =
437  MeshLib::getOrCreateMeshProperty<double>(
438  const_cast<MeshLib::Mesh&>(mesh), "HydraulicFlow",
440  assert(_process_data.mesh_prop_hydraulic_flow->size() ==
441  mesh.getNumberOfNodes());
442  }
443 }
444 
445 template <int GlobalDim>
447  const double t, GlobalVector const& x, int const process_id)
448 {
449  DBUG("Compute the secondary variables for HydroMechanicsProcess.");
450  const auto& dof_table = getDOFTable(process_id);
451 
452  {
453  ProcessLib::ProcessVariable const& pv =
454  getProcessVariables(process_id)[0];
455 
459  dof_table, t, x, _coupled_solutions);
460  }
461 
462  // Copy displacement jumps in a solution vector to mesh property
463  // Remark: the copy is required because mesh properties for primary
464  // variables are set during output and are not ready yet when this function
465  // is called.
466  int g_variable_id = 0;
467  {
468  const int monolithic_process_id = 0;
469  auto const& pvs = getProcessVariables(monolithic_process_id);
470  auto const it =
471  std::find_if(pvs.begin(), pvs.end(), [](ProcessVariable const& pv) {
472  return pv.getName() == "displacement_jump1";
473  });
474  if (it == pvs.end())
475  {
476  OGS_FATAL(
477  "Didn't find expected 'displacement_jump1' process "
478  "variable.");
479  }
480  g_variable_id = static_cast<int>(std::distance(pvs.begin(), it));
481  }
482 
483  MathLib::LinAlg::setLocalAccessibleVector(x);
484 
485  const int monolithic_process_id = 0;
486  ProcessVariable& pv_g =
487  this->getProcessVariables(monolithic_process_id)[g_variable_id];
488  auto const num_comp = pv_g.getNumberOfComponents();
489  auto& mesh_prop_g = *MeshLib::getOrCreateMeshProperty<double>(
490  _mesh, pv_g.getName(), MeshLib::MeshItemType::Node, num_comp);
491  for (int component_id = 0; component_id < num_comp; ++component_id)
492  {
493  auto const& mesh_subset = dof_table.getMeshSubset(
494  g_variable_id, component_id);
495  auto const mesh_id = mesh_subset.getMeshID();
496  for (auto const* node : mesh_subset.getNodes())
497  {
499  node->getID());
500 
501  auto const global_index =
502  dof_table.getGlobalIndex(l, g_variable_id, component_id);
503  mesh_prop_g[node->getID() * num_comp + component_id] =
504  x[global_index];
505  }
506  }
507 
508  // compute nodal w and aperture
509  auto const& R = _process_data.fracture_property->R;
510  auto const& b0 = _process_data.fracture_property->aperture0;
511  MeshLib::PropertyVector<double>& vec_w = *_process_data.mesh_prop_nodal_w;
512  MeshLib::PropertyVector<double>& vec_b = *_process_data.mesh_prop_nodal_b;
513 
514  auto compute_nodal_aperture = [&](std::size_t const node_id,
515  double const w_n) {
516  // skip aperture computation for element-wise defined b0 because there
517  // are jumps on the nodes between the element's values.
518  if (dynamic_cast<MeshElementParameter<double> const*>(&b0))
519  {
520  return std::numeric_limits<double>::quiet_NaN();
521  }
522 
524  x.setNodeID(node_id);
525  return w_n + b0(/*time independent*/ 0, x)[0];
526  };
527 
528  Eigen::VectorXd g(GlobalDim), w(GlobalDim);
529  for (MeshLib::Node const* node : _vec_fracture_nodes)
530  {
531  auto const node_id = node->getID();
532  g.setZero();
533  for (int k = 0; k < GlobalDim; k++)
534  {
535  g[k] = mesh_prop_g[node_id * GlobalDim + k];
536  }
537 
538  w.noalias() = R * g;
539  for (int k = 0; k < GlobalDim; k++)
540  {
541  vec_w[node_id * GlobalDim + k] = w[k];
542  }
543 
544  vec_b[node_id] = compute_nodal_aperture(node_id, w[GlobalDim - 1]);
545  }
546 }
547 
548 template <int GlobalDim>
550 {
551  return false;
552 }
553 
554 template <int GlobalDim>
556  const double t, GlobalVector const& x, GlobalMatrix& M, GlobalMatrix& K,
557  GlobalVector& b)
558 {
559  DBUG("Assemble HydroMechanicsProcess.");
560 
561  std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
562  dof_table = {std::ref(*_local_to_global_index_map)};
563  // Call global assembler for each local assembly item.
566  dof_table, t, x, M, K, b, _coupled_solutions);
567 }
568 
569 template <int GlobalDim>
571  const double t, GlobalVector const& x, GlobalVector const& xdot,
572  const double dxdot_dx, const double dx_dx, GlobalMatrix& M, GlobalMatrix& K,
573  GlobalVector& b, GlobalMatrix& Jac)
574 {
575  DBUG("AssembleWithJacobian HydroMechanicsProcess.");
576 
577  const int process_id =
579  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
580 
581  // Call global assembler for each local assembly item.
582  std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
583  dof_table = {std::ref(*_local_to_global_index_map)};
586  _local_assemblers, pv.getActiveElementIDs(), dof_table, t, x,
587  xdot, dxdot_dx, dx_dx, M, K, b, Jac, _coupled_solutions);
588 
589  auto copyRhs = [&](int const variable_id, auto& output_vector) {
590  transformVariableFromGlobalVector(b, variable_id,
592  output_vector, std::negate<double>());
593  };
594  copyRhs(0, *_process_data.mesh_prop_hydraulic_flow);
595  copyRhs(1, *_process_data.mesh_prop_nodal_forces);
596  copyRhs(2, *_process_data.mesh_prop_nodal_forces_jump);
597 }
598 
599 template <int GlobalDim>
601  GlobalVector const& x, double const t, double const dt,
602  const int process_id)
603 {
604  DBUG("PreTimestep HydroMechanicsProcess.");
605 
606  _process_data.dt = dt;
607  _process_data.t = t;
608 
609  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
610 
614  x, t, dt);
615 }
616 
617 // ------------------------------------------------------------------------------------
618 // template instantiation
619 // ------------------------------------------------------------------------------------
620 template class HydroMechanicsProcess<2>;
621 template class HydroMechanicsProcess<3>;
622 
623 } // namespace HydroMechanics
624 } // namespace LIE
625 } // namespace ProcessLib
std::size_t getNumberOfNodes() const
Get the number of nodes.
Definition: Mesh.h:99
void setFractureProperty(int const dim, MeshLib::Element const &e, FractureProperty &frac_prop)
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_nodes_p
MeshLib::Mesh & _mesh
Definition: Process.h:261
virtual NumLib::LocalToGlobalIndexMap const & getDOFTable(const int) const
Definition: Process.h:115
std::vector< Node * > getBaseNodes(std::vector< Element *> const &elements)
Definition: Utils.h:25
virtual void computeSecondaryVariable(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, const double t, GlobalVector const &x, CoupledSolutionsForStaggeredScheme const *coupled_xs)
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition: Process.h:262
HydroMechanicsProcessData< GlobalDim > _process_data
HydroMechanicsProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, HydroMechanicsProcessData< GlobalDim > &&process_data, SecondaryVariableCollection &&secondary_variables, NumLib::NamedFunctionCaller &&named_function_caller, bool const use_monolithic_scheme)
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)
Definition: MeshUtils.cpp:184
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition: Process.h:123
std::vector< std::unique_ptr< LocalAssemblerInterface > > _local_assemblers
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_matrix_nodes
void assembleConcreteProcess(const double t, GlobalVector const &x, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
void assembleWithJacobianConcreteProcess(const double t, GlobalVector const &x, GlobalVector const &xdot, const double dxdot_dx, const double dx_dx, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac) override
void setElementID(std::size_t element_id)
void createLocalAssemblers(std::vector< MeshLib::Element *> const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, const unsigned shapefunction_order, std::vector< std::unique_ptr< LocalAssemblerInterface >> &local_assemblers, ExtraCtorArgs &&... extra_ctor_args)
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition: Mesh.h:105
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, double const t, GlobalVector const &x, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, CoupledSolutionsForStaggeredScheme const *const cpl_xs)
Definition of the Mesh class.
Parameter< double > const & getInitialCondition() const
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, const double t, GlobalVector const &x, GlobalVector const &xdot, const double dxdot_dx, const double dx_dx, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac, CoupledSolutionsForStaggeredScheme const *const cpl_xs)
bool isAxiallySymmetric() const
Definition: Mesh.h:137
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition: Process.h:264
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)
Builds expression trees of named functions dynamically at runtime.
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)
static void executeMemberDereferenced(Object &object, Method method, Container const &container, Args &&... args)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
void preTimestepConcreteProcess(GlobalVector const &x, double const t, double const dt, const int) override
std::string const & getName() const
int getNumberOfComponents() const
Returns the number of components of the process variable.
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:352
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition: Mesh.h:108
void computeSecondaryVariableConcrete(double const t, GlobalVector const &x, int const process_id) override
void transformVariableFromGlobalVector(GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor mapFunction)
Definition: DOFTableUtil.h:59
CoupledSolutionsForStaggeredScheme * _coupled_solutions
Definition: Process.h:279
Handles configuration of several secondary variables from the project file.
void setNodeID(std::size_t node_id)
Definition of the class Properties that implements a container of properties.
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:81
Definition of the MeshInformation class.
std::size_t getNumberOfElements() const
Get the number of elements.
Definition: Mesh.h:96
#define OGS_FATAL(fmt,...)
Definition: Error.h:71
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_fracture_nodes
A parameter represented by a mesh property vector.
const bool _use_monolithic_scheme
Definition: Process.h:275
VectorMatrixAssembler _global_assembler
Definition: Process.h:273
Definition of the ElementStatus class.
Ordering data by component type.
std::vector< MeshLib::Element * > _vec_fracture_matrix_elements
std::vector< std::size_t > & getActiveElementIDs() const