OGS
HMPhaseFieldProcessData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <Eigen/Core>
7#include <memory>
8#include <utility>
9#ifdef USE_PETSC
10#include <petscsys.h>
11#endif
12
17
18namespace MaterialLib
19{
20namespace Solids
21{
22template <int DisplacementDim>
23struct MechanicsBase;
24}
25} // namespace MaterialLib
26namespace ProcessLib
27{
28template <typename T>
29struct Parameter;
30
31namespace HMPhaseField
32{
33inline void showEnergyAndWork(const double t, double& _elastic_energy,
34 double& _surface_energy, double& _pressure_work)
35{
36#ifdef USE_PETSC
37 double const elastic_energy = _elastic_energy;
38 MPI_Allreduce(&elastic_energy, &_elastic_energy, 1, MPI_DOUBLE, MPI_SUM,
39 PETSC_COMM_WORLD);
40 double const surface_energy = _surface_energy;
41 MPI_Allreduce(&surface_energy, &_surface_energy, 1, MPI_DOUBLE, MPI_SUM,
42 PETSC_COMM_WORLD);
43 double const pressure_work = _pressure_work;
44 MPI_Allreduce(&pressure_work, &_pressure_work, 1, MPI_DOUBLE, MPI_SUM,
45 PETSC_COMM_WORLD);
46#endif
47
48 INFO("Elastic energy: {} Surface energy: {} Pressure work: {} at time: {} ",
49 _elastic_energy, _surface_energy, _pressure_work, t);
50};
51template <int DisplacementDim>
53{
55
57
58 std::map<int, std::shared_ptr<
64 Eigen::Matrix<double, DisplacementDim, 1> const specific_body_force;
65 Eigen::Matrix<double, DisplacementDim, 1> const specific_fracture_direction;
71 std::unique_ptr<MaterialLib::Solids::Phasefield::DegradationDerivative>
75 double const fracture_threshold;
80
83
84 double elastic_energy = 0.0;
85 double surface_energy = 0.0;
86 double pressure_work = 0.0;
88 int const _hydro_process_id = 1;
90};
91
92} // namespace HMPhaseField
93} // namespace ProcessLib
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28
void showEnergyAndWork(const double t, double &_elastic_energy, double &_surface_energy, double &_pressure_work)
ParameterLib::Parameter< double > const & crack_length_scale
ParameterLib::Parameter< double > const & residual_stiffness
MaterialLib::Solids::Phasefield::PhaseFieldModel phasefield_model
MaterialLib::Solids::Phasefield::EnergySplitModel energy_split_model
ParameterLib::Parameter< double > const & width_init
ParameterLib::Parameter< double > const & crack_resistance
Eigen::Matrix< double, DisplacementDim, 1 > const specific_fracture_direction
Eigen::Matrix< double, DisplacementDim, 1 > const specific_body_force
MaterialLib::Solids::Phasefield::SofteningCurve softening_curve
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > solid_materials
std::unique_ptr< MaterialLib::Solids::Phasefield::DegradationDerivative > degradation_derivative
MeshLib::PropertyVector< int > const *const material_ids
MaterialPropertyLib::MaterialSpatialDistributionMap media_map