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_string =
193 auto const phasefield_model =
195 DisplacementDim>(phasefield_model_string);
199 config, parameters, mesh);
201 auto const softening_curve_string =
204 auto const softening_curve =
206 DisplacementDim>(softening_curve_string);
208 auto const energy_split_model_string =
211 auto const energy_split_model =
213 DisplacementDim>(energy_split_model_string);
215 auto degradation_derivative = creatDegradationDerivative<DisplacementDim>(
216 phasefield_model, characteristic_length, softening_curve);
220 std::move(solid_constitutive_relations),
228 propagating_pressurized_crack,
229 static_pressurized_crack,
230 irreversible_threshold,
234 characteristic_length,
235 std::move(degradation_derivative)};
241 return std::make_unique<PhaseFieldProcess<DisplacementDim>>(
242 std::move(name), mesh, std::move(jacobian_assembler), parameters,
243 integration_order, std::move(process_variables),
244 std::move(process_data), std::move(secondary_variables),
245 use_monolithic_scheme);