23 std::string
const& name,
25 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
26 std::vector<ProcessVariable>
const& variables,
27 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
28 std::optional<ParameterLib::CoordinateSystem>
const&
29 local_coordinate_system,
30 unsigned const integration_order,
35 DBUG(
"Create PhaseFieldProcess.");
37 auto const coupling_scheme =
40 const bool use_monolithic_scheme =
41 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
50 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
52 if (use_monolithic_scheme)
54 OGS_FATAL(
"Monolithic implementation is not available.");
58 using namespace std::string_literals;
62 auto const& variable_name :
68 auto per_process_variables =
70 process_variables.push_back(std::move(per_process_variables));
72 variable_u = &process_variables[0][0].get();
73 variable_ph = &process_variables[1][0].get();
76 DBUG(
"Associate displacement with process variable '{:s}'.",
82 "Number of components of the process variable '{:s}' is different "
83 "from the displacement dimension: got {:d}, expected {:d}",
89 DBUG(
"Associate phase field with process variable '{:s}'.",
94 "Phasefield process variable '{:s}' is not a scalar variable but "
95 "has {:d} components.",
100 auto solid_constitutive_relations =
102 parameters, local_coordinate_system, materialIDs(mesh), config);
104 auto const phasefield_parameters_config =
110 phasefield_parameters_config,
112 "residual_stiffness", parameters, 1);
113 DBUG(
"Use '{:s}' as residual stiffness.", residual_stiffness.name);
117 phasefield_parameters_config,
119 "crack_resistance", parameters, 1);
120 DBUG(
"Use '{:s}' as crack resistance.", crack_resistance.name);
124 phasefield_parameters_config,
126 "crack_length_scale", parameters, 1);
127 DBUG(
"Use '{:s}' as crack length scale.", crack_length_scale.name);
130 auto const characteristic_length =
138 "solid_density", parameters, 1);
139 DBUG(
"Use '{:s}' as solid density parameter.", solid_density.name);
142 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
144 std::vector<double>
const b =
147 "specific_body_force");
148 if (b.size() != DisplacementDim)
151 "The size of the specific body force vector does not match the "
152 "displacement dimension. Vector size is {:d}, displacement "
154 b.size(), DisplacementDim);
157 std::copy_n(b.data(), b.size(), specific_body_force.data());
160 auto const crack_scheme =
163 "pressurized_crack_scheme");
165 ((*crack_scheme !=
"propagating") && (*crack_scheme !=
"static")))
168 "crack_scheme must be 'propagating' or 'static' but '{:s}' "
170 crack_scheme->c_str());
173 const bool pressurized_crack = crack_scheme.has_value();
174 const bool propagating_pressurized_crack =
175 (crack_scheme && (*crack_scheme ==
"propagating"));
176 const bool static_pressurized_crack =
177 (crack_scheme && (*crack_scheme ==
"static"));
179 auto const irreversible_threshold =
183 auto const phasefield_model_string =
186 auto const phasefield_model =
188 DisplacementDim>(phasefield_model_string);
192 config, parameters, mesh);
194 auto const softening_curve_string =
197 auto const softening_curve =
199 DisplacementDim>(softening_curve_string);
201 auto const energy_split_model_string =
204 auto const energy_split_model =
206 DisplacementDim>(energy_split_model_string);
208 auto degradation_derivative = creatDegradationDerivative<DisplacementDim>(
209 phasefield_model, characteristic_length, softening_curve);
213 std::move(solid_constitutive_relations),
221 propagating_pressurized_crack,
222 static_pressurized_crack,
223 irreversible_threshold,
227 characteristic_length,
228 std::move(degradation_derivative)};
234 return std::make_unique<PhaseFieldProcess<DisplacementDim>>(
235 std::move(name), mesh, std::move(jacobian_assembler), parameters,
236 integration_order, std::move(process_variables),
237 std::move(process_data), std::move(secondary_variables),
238 use_monolithic_scheme);