30 std::string
const& name,
32 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
33 std::vector<ProcessVariable>
const& variables,
34 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
35 std::optional<ParameterLib::CoordinateSystem>
const&
36 local_coordinate_system,
37 unsigned const integration_order,
42 DBUG(
"Create PhaseFieldProcess.");
44 auto const coupling_scheme =
47 const bool use_monolithic_scheme =
48 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
57 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
59 if (use_monolithic_scheme)
61 OGS_FATAL(
"Monolithic implementation is not available.");
65 using namespace std::string_literals;
69 auto const& variable_name :
75 auto per_process_variables =
77 process_variables.push_back(std::move(per_process_variables));
79 variable_u = &process_variables[0][0].get();
80 variable_ph = &process_variables[1][0].get();
83 DBUG(
"Associate displacement with process variable '{:s}'.",
89 "Number of components of the process variable '{:s}' is different "
90 "from the displacement dimension: got {:d}, expected {:d}",
96 DBUG(
"Associate phase field with process variable '{:s}'.",
101 "Phasefield process variable '{:s}' is not a scalar variable but "
102 "has {:d} components.",
107 auto solid_constitutive_relations =
109 parameters, local_coordinate_system, materialIDs(mesh), config);
111 auto const phasefield_parameters_config =
117 phasefield_parameters_config,
119 "residual_stiffness", parameters, 1);
120 DBUG(
"Use '{:s}' as residual stiffness.", residual_stiffness.name);
124 phasefield_parameters_config,
126 "crack_resistance", parameters, 1);
127 DBUG(
"Use '{:s}' as crack resistance.", crack_resistance.name);
131 phasefield_parameters_config,
133 "crack_length_scale", parameters, 1);
134 DBUG(
"Use '{:s}' as crack length scale.", crack_length_scale.name);
137 auto const characteristic_length =
145 "solid_density", parameters, 1);
146 DBUG(
"Use '{:s}' as solid density parameter.", solid_density.name);
149 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
151 std::vector<double>
const b =
154 "specific_body_force");
155 if (b.size() != DisplacementDim)
158 "The size of the specific body force vector does not match the "
159 "displacement dimension. Vector size is {:d}, displacement "
161 b.size(), DisplacementDim);
164 std::copy_n(b.data(), b.size(), specific_body_force.data());
167 auto const crack_scheme =
170 "pressurized_crack_scheme");
172 ((*crack_scheme !=
"propagating") && (*crack_scheme !=
"static")))
175 "crack_scheme must be 'propagating' or 'static' but '{:s}' "
177 crack_scheme->c_str());
180 const bool pressurized_crack = crack_scheme.has_value();
181 const bool propagating_pressurized_crack =
182 (crack_scheme && (*crack_scheme ==
"propagating"));
183 const bool static_pressurized_crack =
184 (crack_scheme && (*crack_scheme ==
"static"));
186 auto const irreversible_threshold =
190 auto const phasefield_model = [&]
192 auto const phasefield_model_string =
196 if (phasefield_model_string ==
"AT1")
200 if (phasefield_model_string ==
"AT2")
204 if (phasefield_model_string ==
"COHESIVE")
209 "phasefield_model must be 'AT1', 'AT2' or 'COHESIVE' but '{:s}' "
211 phasefield_model_string.c_str());
216 config, parameters, mesh);
218 auto const softening_curve = [&]
220 auto const softening_curve_string =
223 if (softening_curve_string)
225 if (*softening_curve_string ==
"Linear")
229 if (*softening_curve_string ==
"Exponential")
234 "softening_curve must be 'Linear' or 'Exponential' but '{:s}' "
236 softening_curve_string->c_str());
241 auto const energy_split_model = [&]
243 auto const energy_split_model_string =
247 if (energy_split_model_string ==
"Isotropic")
251 if (energy_split_model_string ==
"VolumetricDeviatoric")
255 if (energy_split_model_string ==
"EffectiveStress")
259 if (energy_split_model_string ==
"OrthoVolDev")
263 if (energy_split_model_string ==
"OrthoMasonry")
268 "energy_split_model must be 'Isotropic' or 'VolumetricDeviatoric' "
269 "but '{:s}' was given",
270 energy_split_model_string);
273 std::unique_ptr<DegradationDerivative> degradation_derivative;
276 degradation_derivative =
277 std::make_unique<COHESIVE_DegradationDerivative>(
278 characteristic_length, softening_curve);
282 degradation_derivative = std::make_unique<AT_DegradationDerivative>();
287 std::move(solid_constitutive_relations),
295 propagating_pressurized_crack,
296 static_pressurized_crack,
297 irreversible_threshold,
301 characteristic_length,
302 std::move(degradation_derivative)};
308 return std::make_unique<PhaseFieldProcess<DisplacementDim>>(
309 std::move(name), mesh, std::move(jacobian_assembler), parameters,
310 integration_order, std::move(process_variables),
311 std::move(process_data), std::move(secondary_variables),
312 use_monolithic_scheme);