47 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
48 std::vector<ProcessVariable>
const& variables,
49 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
50 std::optional<ParameterLib::CoordinateSystem>
const&
51 local_coordinate_system,
53 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
57 DBUG(
"Create HMPhaseFieldProcess.");
59 auto const coupling_scheme =
62 const bool use_monolithic_scheme = (coupling_scheme !=
"staggered");
70 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
72 if (use_monolithic_scheme)
74 OGS_FATAL(
"Monolithic implementation is not available.");
78 using namespace std::string_literals;
82 auto const& variable_name :
90 auto per_process_variables =
92 process_variables.push_back(std::move(per_process_variables));
94 variable_ph = &process_variables[0][0].get();
95 variable_p = &process_variables[1][0].get();
96 variable_u = &process_variables[2][0].get();
99 DBUG(
"Associate phase field with process variable '{}'.",
104 "HMPhasefield process variable '{}' is not a scalar variable but "
105 "has {:d} components.",
110 DBUG(
"Associate pressure with process variable '{}'.",
115 "HMPhasefield process variable '{}' is not a scalar variable but "
116 "has {:d} components.",
121 DBUG(
"Associate displacement with process variable '{}'.",
127 "The component number of the process variable '{}' is different "
128 "from the displacement dimension: got {:d}, expected {:d}",
135 auto solid_constitutive_relations =
137 parameters, local_coordinate_system, materialIDs(mesh), config);
139 auto const phasefield_parameters_config =
145 phasefield_parameters_config,
147 "residual_stiffness", parameters, 1);
148 DBUG(
"Use '{}' as residual stiffness.", residual_stiffness.name);
152 phasefield_parameters_config,
154 "crack_resistance", parameters, 1);
155 DBUG(
"Use '{}' as crack resistance.", crack_resistance.name);
159 phasefield_parameters_config,
161 "crack_length_scale", parameters, 1);
162 DBUG(
"Use '{}' as crack length scale.", crack_length_scale.name);
165 auto const characteristic_length =
170 auto const fluid_compressibility =
175 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
177 std::vector<double>
const b =
180 "specific_body_force");
181 if (b.size() != DisplacementDim)
184 "The size of the specific body force vector does not match the "
185 "displacement dimension. Vector size is {:d}, displacement "
187 b.size(), DisplacementDim);
190 std::copy_n(b.data(), b.size(), specific_body_force.data());
194 Eigen::Vector<double, DisplacementDim> specific_fracture_direction;
196 std::vector<double>
const fracture_normal =
199 "specific_fracture_direction");
200 if (fracture_normal.size() != DisplacementDim)
203 "The size of the specific fracture direction vector does not "
204 "match the displacement dimension. Vector size is {:d}, "
205 "displacement dimension is {:d}",
206 fracture_normal.size(), DisplacementDim);
209 std::copy_n(fracture_normal.data(), fracture_normal.size(),
210 specific_fracture_direction.data());
213 auto const irreversible_threshold =
217 auto const phasefield_model_string =
220 auto const phasefield_model =
222 DisplacementDim>(phasefield_model_string);
224 auto const softening_curve_string =
227 auto const softening_curve =
229 DisplacementDim>(softening_curve_string);
231 auto const energy_split_model_string =
234 auto const energy_split_model =
236 DisplacementDim>(energy_split_model_string);
238 auto degradation_derivative = creatDegradationDerivative<DisplacementDim>(
239 phasefield_model, characteristic_length, softening_curve);
241 auto const diffused_range_parameter =
245 auto const fracture_threshold =
249 auto const fracture_permeability_parameter =
255 double const fixed_stress_stabilization_parameter =
258 "fixed_stress_stabilization_parameter", 0.5);
260 DBUG(
"Using value {:g} for coupling parameter of staggered scheme.",
261 fixed_stress_stabilization_parameter);
263 auto spatial_stabilization_parameter_optional =
266 "spatial_stabilization_parameter");
267 double const spatial_stabilization_parameter =
268 spatial_stabilization_parameter_optional
269 ? spatial_stabilization_parameter_optional.value()
271 DBUG(
"Using value {} for spatial stabilization coupling parameter.",
272 spatial_stabilization_parameter);
278 "width_init", parameters, 0.0);
279 DBUG(
"Use '{}' as initial width.", width_init.name);
283 DBUG(
"Check the media properties of HMPhaseField process ...");
285 DBUG(
"Media properties verified.");
289 std::move(media_map),
290 std::move(solid_constitutive_relations),
295 specific_fracture_direction,
296 irreversible_threshold,
300 characteristic_length,
301 std::move(degradation_derivative),
302 diffused_range_parameter,
303 fluid_compressibility,
305 fracture_permeability_parameter,
306 fixed_stress_stabilization_parameter,
307 spatial_stabilization_parameter,
314 return std::make_unique<HMPhaseFieldProcess<DisplacementDim>>(
315 std::move(name), mesh, std::move(jacobian_assembler), parameters,
316 integration_order, std::move(process_variables),
317 std::move(process_data), std::move(secondary_variables),
318 use_monolithic_scheme);