Loading [MathJax]/extensions/tex2jax.js
OGS
ProcessLib::PhaseField Namespace Reference

Classes

struct  IntegrationPointData
 
class  PhaseFieldLocalAssembler
 
struct  PhaseFieldLocalAssemblerInterface
 
class  PhaseFieldProcess
 
struct  PhaseFieldProcessData
 
struct  SecondaryData
 

Functions

template<int DisplacementDim>
std::unique_ptr< ProcesscreatePhaseFieldProcess (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template std::unique_ptr< ProcesscreatePhaseFieldProcess< 2 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template std::unique_ptr< ProcesscreatePhaseFieldProcess< 3 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 

Function Documentation

◆ createPhaseFieldProcess()

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::PhaseField::createPhaseFieldProcess ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__PHASE_FIELD__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__PHASE_FIELD__process_variables

Primary process variables as they appear in the global component vector:

Input File Parameter
prj__processes__process__PHASE_FIELD__process_variables__displacement
Input File Parameter
prj__processes__process__PHASE_FIELD__process_variables__phasefield

Process Parameters

Input File Parameter
prj__processes__process__PHASE_FIELD__phasefield_parameters
Input File Parameter
prj__processes__process__PHASE_FIELD__phasefield_parameters__residual_stiffness
Input File Parameter
prj__processes__process__PHASE_FIELD__phasefield_parameters__crack_resistance
Input File Parameter
prj__processes__process__PHASE_FIELD__phasefield_parameters__crack_length_scale
Input File Parameter
prj__processes__process__PHASE_FIELD__characteristic_length
Input File Parameter
prj__processes__process__PHASE_FIELD__solid_density
Input File Parameter
prj__processes__process__PHASE_FIELD__specific_body_force
Input File Parameter
prj__processes__process__PHASE_FIELD__pressurized_crack_scheme
Input File Parameter
prj__processes__process__PHASE_FIELD__irreversible_threshold
Input File Parameter
prj__processes__process__PHASE_FIELD__phasefield_model
Input File Parameter
prj__processes__process__PHASE_FIELD__softening_curve
Input File Parameter
prj__processes__process__PHASE_FIELD__energy_split_model

Definition at line 29 of file CreatePhaseFieldProcess.cpp.

39{
41 config.checkConfigParameter("type", "PHASE_FIELD");
42 DBUG("Create PhaseFieldProcess.");
43
44 auto const coupling_scheme =
46 config.getConfigParameterOptional<std::string>("coupling_scheme");
47 const bool use_monolithic_scheme =
48 !(coupling_scheme && (*coupling_scheme == "staggered"));
49
51
53 auto const pv_config = config.getConfigSubtree("process_variables");
54
55 ProcessVariable* variable_ph;
56 ProcessVariable* variable_u;
57 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
58 process_variables;
59 if (use_monolithic_scheme) // monolithic scheme.
60 {
61 OGS_FATAL("Monolithic implementation is not available.");
62 }
63 else // staggered scheme.
64 {
65 using namespace std::string_literals;
66 for (
69 auto const& variable_name :
70 {
71 "displacement"s,
73 "phasefield"s})
74 {
75 auto per_process_variables =
76 findProcessVariables(variables, pv_config, {variable_name});
77 process_variables.push_back(std::move(per_process_variables));
78 }
79 variable_u = &process_variables[0][0].get();
80 variable_ph = &process_variables[1][0].get();
81 }
82
83 DBUG("Associate displacement with process variable '{:s}'.",
84 variable_u->getName());
85
86 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
87 {
89 "Number of components of the process variable '{:s}' is different "
90 "from the displacement dimension: got {:d}, expected {:d}",
91 variable_u->getName(),
92 variable_u->getNumberOfGlobalComponents(),
93 DisplacementDim);
94 }
95
96 DBUG("Associate phase field with process variable '{:s}'.",
97 variable_ph->getName());
98 if (variable_ph->getNumberOfGlobalComponents() != 1)
99 {
100 OGS_FATAL(
101 "Phasefield process variable '{:s}' is not a scalar variable but "
102 "has {:d} components.",
103 variable_ph->getName(),
104 variable_ph->getNumberOfGlobalComponents());
105 }
107 auto solid_constitutive_relations =
109 parameters, local_coordinate_system, materialIDs(mesh), config);
110
111 auto const phasefield_parameters_config =
113 config.getConfigSubtree("phasefield_parameters");
114
115 // Residual stiffness
116 auto const& residual_stiffness = ParameterLib::findParameter<double>(
117 phasefield_parameters_config,
119 "residual_stiffness", parameters, 1);
120 DBUG("Use '{:s}' as residual stiffness.", residual_stiffness.name);
121
122 // Crack resistance
123 auto const& crack_resistance = ParameterLib::findParameter<double>(
124 phasefield_parameters_config,
126 "crack_resistance", parameters, 1);
127 DBUG("Use '{:s}' as crack resistance.", crack_resistance.name);
128
129 // Crack length scale
130 auto const& crack_length_scale = ParameterLib::findParameter<double>(
131 phasefield_parameters_config,
133 "crack_length_scale", parameters, 1);
134 DBUG("Use '{:s}' as crack length scale.", crack_length_scale.name);
135
136 // Characteristic_length
137 auto const characteristic_length =
139 config.getConfigParameter<double>("characteristic_length", 1.0);
140
141 // Solid density
142 auto const& solid_density = ParameterLib::findParameter<double>(
143 config,
145 "solid_density", parameters, 1);
146 DBUG("Use '{:s}' as solid density parameter.", solid_density.name);
147
148 // Specific body force
149 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
150 {
151 std::vector<double> const b =
153 config.getConfigParameter<std::vector<double>>(
154 "specific_body_force");
155 if (b.size() != DisplacementDim)
156 {
157 OGS_FATAL(
158 "The size of the specific body force vector does not match the "
159 "displacement dimension. Vector size is {:d}, displacement "
160 "dimension is {:d}",
161 b.size(), DisplacementDim);
162 }
163
164 std::copy_n(b.data(), b.size(), specific_body_force.data());
165 }
166
167 auto const crack_scheme =
169 config.getConfigParameterOptional<std::string>(
170 "pressurized_crack_scheme");
171 if (crack_scheme &&
172 ((*crack_scheme != "propagating") && (*crack_scheme != "static")))
173 {
174 OGS_FATAL(
175 "crack_scheme must be 'propagating' or 'static' but '{:s}' "
176 "was given",
177 crack_scheme->c_str());
178 }
179
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"));
185
186 auto const irreversible_threshold =
188 config.getConfigParameter<double>("irreversible_threshold", 0.05);
189
190 auto const phasefield_model_string =
192 config.getConfigParameter<std::string>("phasefield_model");
193 auto const phasefield_model =
195 DisplacementDim>(phasefield_model_string);
196
197 // Initial stress conditions
199 config, parameters, mesh);
200
201 auto const softening_curve_string =
203 config.getConfigParameterOptional<std::string>("softening_curve");
204 auto const softening_curve =
206 DisplacementDim>(softening_curve_string);
207
208 auto const energy_split_model_string =
210 config.getConfigParameter<std::string>("energy_split_model");
211 auto const energy_split_model =
213 DisplacementDim>(energy_split_model_string);
214
215 auto degradation_derivative = creatDegradationDerivative<DisplacementDim>(
216 phasefield_model, characteristic_length, softening_curve);
217
218 PhaseFieldProcessData<DisplacementDim> process_data{
219 materialIDs(mesh),
220 std::move(solid_constitutive_relations),
221 residual_stiffness,
222 crack_resistance,
223 crack_length_scale,
224 solid_density,
225 initial_stress,
226 specific_body_force,
227 pressurized_crack,
228 propagating_pressurized_crack,
229 static_pressurized_crack,
230 irreversible_threshold,
231 phasefield_model,
232 energy_split_model,
233 softening_curve,
234 characteristic_length,
235 std::move(degradation_derivative)};
236
237 SecondaryVariableCollection secondary_variables;
238
239 ProcessLib::createSecondaryVariables(config, secondary_variables);
240
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);
246}
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
PhaseFieldModel convertStringToPhaseFieldModel(std::string const &phasefield_model)
SofteningCurve convertStringToSofteningCurve(std::optional< std::string > const &softening_curve)
EnergySplitModel convertStringToEnergySplitModel(std::string const &energy_split_model)
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:268
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102
InitialStress createInitialStress(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), MaterialLib::Solids::Phasefield::convertStringToEnergySplitModel(), MaterialLib::Solids::Phasefield::convertStringToPhaseFieldModel(), MaterialLib::Solids::Phasefield::convertStringToSofteningCurve(), MaterialLib::Solids::createConstitutiveRelations(), ProcessLib::createInitialStress(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), and OGS_FATAL.

◆ createPhaseFieldProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::PhaseField::createPhaseFieldProcess< 2 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )

◆ createPhaseFieldProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::PhaseField::createPhaseFieldProcess< 3 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )