29 std::string
const& name,
31 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
32 std::vector<ProcessVariable>
const& variables,
33 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
34 std::optional<ParameterLib::CoordinateSystem>
const&
35 local_coordinate_system,
36 unsigned const integration_order,
41 DBUG(
"Create PhaseFieldProcess.");
43 auto const coupling_scheme =
46 const bool use_monolithic_scheme =
47 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
56 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
58 if (use_monolithic_scheme)
60 OGS_FATAL(
"Monolithic implementation is not available.");
64 using namespace std::string_literals;
68 auto const& variable_name :
74 auto per_process_variables =
76 process_variables.push_back(std::move(per_process_variables));
78 variable_u = &process_variables[0][0].get();
79 variable_ph = &process_variables[1][0].get();
82 DBUG(
"Associate displacement with process variable '{:s}'.",
88 "Number of components of the process variable '{:s}' is different "
89 "from the displacement dimension: got {:d}, expected {:d}",
95 DBUG(
"Associate phase field with process variable '{:s}'.",
100 "Phasefield process variable '{:s}' is not a scalar variable but "
101 "has {:d} components.",
106 auto solid_constitutive_relations =
107 MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
108 parameters, local_coordinate_system, config);
110 auto const phasefield_parameters_config =
115 auto const& residual_stiffness = ParameterLib::findParameter<double>(
116 phasefield_parameters_config,
118 "residual_stiffness", parameters, 1);
119 DBUG(
"Use '{:s}' as residual stiffness.", residual_stiffness.name);
122 auto const& crack_resistance = ParameterLib::findParameter<double>(
123 phasefield_parameters_config,
125 "crack_resistance", parameters, 1);
126 DBUG(
"Use '{:s}' as crack resistance.", crack_resistance.name);
129 auto const& crack_length_scale = ParameterLib::findParameter<double>(
130 phasefield_parameters_config,
132 "crack_length_scale", parameters, 1);
133 DBUG(
"Use '{:s}' as crack length scale.", crack_length_scale.name);
136 auto const characteristic_length =
141 auto const& solid_density = ParameterLib::findParameter<double>(
144 "solid_density", parameters, 1);
145 DBUG(
"Use '{:s}' as solid density parameter.", solid_density.name);
148 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
150 std::vector<double>
const b =
153 "specific_body_force");
154 if (b.size() != DisplacementDim)
157 "The size of the specific body force vector does not match the "
158 "displacement dimension. Vector size is {:d}, displacement "
160 b.size(), DisplacementDim);
163 std::copy_n(b.data(), b.size(), specific_body_force.data());
166 auto const crack_scheme =
169 "pressurized_crack_scheme");
171 ((*crack_scheme !=
"propagating") && (*crack_scheme !=
"static")))
174 "crack_scheme must be 'propagating' or 'static' but '{:s}' "
176 crack_scheme->c_str());
179 const bool pressurized_crack = crack_scheme.has_value();
180 const bool propagating_pressurized_crack =
181 (crack_scheme && (*crack_scheme ==
"propagating"));
182 const bool static_pressurized_crack =
183 (crack_scheme && (*crack_scheme ==
"static"));
185 auto const irreversible_threshold =
189 auto const phasefield_model = [&]
191 auto const phasefield_model_string =
195 if (phasefield_model_string ==
"AT1")
199 if (phasefield_model_string ==
"AT2")
203 if (phasefield_model_string ==
"COHESIVE")
208 "phasefield_model must be 'AT1', 'AT2' or 'COHESIVE' but '{:s}' "
210 phasefield_model_string.c_str());
213 auto const softening_curve = [&]
215 auto const softening_curve_string =
218 if (softening_curve_string)
220 if (*softening_curve_string ==
"Linear")
224 if (*softening_curve_string ==
"Exponential")
229 "softening_curve must be 'Linear' or 'Exponential' but '{:s}' "
231 softening_curve_string->c_str());
236 auto const energy_split_model = [&]
238 auto const energy_split_model_string =
242 if (energy_split_model_string ==
"Isotropic")
246 if (energy_split_model_string ==
"VolumetricDeviatoric")
250 if (energy_split_model_string ==
"EffectiveStress")
254 if (energy_split_model_string ==
"OrthoVolDev")
258 if (energy_split_model_string ==
"OrthoMasonry")
263 "energy_split_model must be 'Isotropic' or 'VolumetricDeviatoric' "
264 "but '{:s}' was given",
265 energy_split_model_string);
268 std::unique_ptr<DegradationDerivative> degradation_derivative;
271 degradation_derivative =
272 std::make_unique<COHESIVE_DegradationDerivative>(
273 characteristic_length, softening_curve);
277 degradation_derivative = std::make_unique<AT_DegradationDerivative>();
282 std::move(solid_constitutive_relations),
289 propagating_pressurized_crack,
290 static_pressurized_crack,
291 irreversible_threshold,
295 characteristic_length,
296 std::move(degradation_derivative)};
302 return std::make_unique<PhaseFieldProcess<DisplacementDim>>(
303 std::move(name), mesh, std::move(jacobian_assembler), parameters,
304 integration_order, std::move(process_variables),
305 std::move(process_data), std::move(secondary_variables),
306 use_monolithic_scheme);