49 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
50 std::vector<ProcessVariable>
const& variables,
51 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
52 std::optional<ParameterLib::CoordinateSystem>
const&
53 local_coordinate_system,
55 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
59 DBUG(
"Create HMPhaseFieldProcess.");
61 auto const coupling_scheme =
64 const bool use_monolithic_scheme = (coupling_scheme !=
"staggered");
72 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
74 if (use_monolithic_scheme)
76 OGS_FATAL(
"Monolithic implementation is not available.");
80 using namespace std::string_literals;
84 auto const& variable_name :
92 auto per_process_variables =
94 process_variables.push_back(std::move(per_process_variables));
96 variable_ph = &process_variables[0][0].get();
97 variable_p = &process_variables[1][0].get();
98 variable_u = &process_variables[2][0].get();
101 DBUG(
"Associate phase field with process variable '{}'.",
106 "HMPhasefield process variable '{}' is not a scalar variable but "
107 "has {:d} components.",
112 DBUG(
"Associate pressure with process variable '{}'.",
117 "HMPhasefield process variable '{}' is not a scalar variable but "
118 "has {:d} components.",
123 DBUG(
"Associate displacement with process variable '{}'.",
129 "The component number of the process variable '{}' is different "
130 "from the displacement dimension: got {:d}, expected {:d}",
137 auto solid_constitutive_relations =
139 parameters, local_coordinate_system, materialIDs(mesh), config);
141 auto const phasefield_parameters_config =
147 phasefield_parameters_config,
149 "residual_stiffness", parameters, 1);
150 DBUG(
"Use '{}' as residual stiffness.", residual_stiffness.name);
154 phasefield_parameters_config,
156 "crack_resistance", parameters, 1);
157 DBUG(
"Use '{}' as crack resistance.", crack_resistance.name);
161 phasefield_parameters_config,
163 "crack_length_scale", parameters, 1);
164 DBUG(
"Use '{}' as crack length scale.", crack_length_scale.name);
167 auto const characteristic_length =
172 auto const fluid_compressibility =
177 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
179 std::vector<double>
const b =
182 "specific_body_force");
183 if (b.size() != DisplacementDim)
186 "The size of the specific body force vector does not match the "
187 "displacement dimension. Vector size is {:d}, displacement "
189 b.size(), DisplacementDim);
192 std::copy_n(b.data(), b.size(), specific_body_force.data());
196 Eigen::Vector<double, DisplacementDim> specific_fracture_direction;
198 std::vector<double>
const fracture_normal =
201 "specific_fracture_direction");
202 if (fracture_normal.size() != DisplacementDim)
205 "The size of the specific fracture direction vector does not "
206 "match the displacement dimension. Vector size is {:d}, "
207 "displacement dimension is {:d}",
208 fracture_normal.size(), DisplacementDim);
211 std::copy_n(fracture_normal.data(), fracture_normal.size(),
212 specific_fracture_direction.data());
215 auto const irreversible_threshold =
219 auto const phasefield_model_string =
222 auto const phasefield_model =
224 DisplacementDim>(phasefield_model_string);
226 auto const softening_curve_string =
229 auto const softening_curve =
231 DisplacementDim>(softening_curve_string);
233 auto const energy_split_model_string =
236 auto const energy_split_model =
238 DisplacementDim>(energy_split_model_string);
240 auto degradation_derivative = creatDegradationDerivative<DisplacementDim>(
241 phasefield_model, characteristic_length, softening_curve);
243 auto const diffused_range_parameter =
247 auto const fracture_threshold =
251 auto const fracture_permeability_parameter =
257 double const fixed_stress_stabilization_parameter =
260 "fixed_stress_stabilization_parameter", 0.5);
262 DBUG(
"Using value {:g} for coupling parameter of staggered scheme.",
263 fixed_stress_stabilization_parameter);
265 auto spatial_stabilization_parameter_optional =
268 "spatial_stabilization_parameter");
269 double const spatial_stabilization_parameter =
270 spatial_stabilization_parameter_optional
271 ? spatial_stabilization_parameter_optional.value()
273 DBUG(
"Using value {} for spatial stabilization coupling parameter.",
274 spatial_stabilization_parameter);
280 "width_init", parameters, 0.0);
281 DBUG(
"Use '{}' as initial width.", width_init.name);
285 DBUG(
"Check the media properties of HMPhaseField process ...");
287 DBUG(
"Media properties verified.");
291 std::move(media_map),
292 std::move(solid_constitutive_relations),
297 specific_fracture_direction,
298 irreversible_threshold,
302 characteristic_length,
303 std::move(degradation_derivative),
304 diffused_range_parameter,
305 fluid_compressibility,
307 fracture_permeability_parameter,
308 fixed_stress_stabilization_parameter,
309 spatial_stabilization_parameter,
316 return std::make_unique<HMPhaseFieldProcess<DisplacementDim>>(
317 std::move(name), mesh, std::move(jacobian_assembler), parameters,
318 integration_order, std::move(process_variables),
319 std::move(process_data), std::move(secondary_variables),
320 use_monolithic_scheme);