22 template <
class TSparseSpace,
class TDenseSpace>
28 static std::shared_ptr<ConvergenceCriteriaType>
Create(
const Parameters& rSolverSettings)
31 <<
"No convergence_criterion is defined, aborting.";
33 if (rSolverSettings[
"convergence_criterion"].GetString() ==
34 "displacement_criterion")
36 const std::vector<std::string> entries_to_copy = {
37 "displacement_absolute_tolerance",
38 "displacement_relative_tolerance"};
41 return std::make_shared<DisplacementCriteria<TSparseSpace, TDenseSpace>>(convergence_inputs);
43 if (rSolverSettings[
"convergence_criterion"].GetString() ==
46 const std::vector<std::string> entries_to_copy = {
47 "residual_absolute_tolerance",
"residual_relative_tolerance"};
49 rSolverSettings, entries_to_copy);
50 return std::make_shared<ResidualCriteria<TSparseSpace, TDenseSpace>>(convergence_inputs);
54 << rSolverSettings[
"convergence_criterion"].
GetString() <<
") is unknown, "
55 <<
"supported criteria are: 'displacement_criterion', "
56 "'residual_criterion'."
Definition: convergence_criteria_factory.hpp:24
static std::shared_ptr< ConvergenceCriteriaType > Create(const Parameters &rSolverSettings)
Definition: convergence_criteria_factory.hpp:28
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
bool Has(const std::string &rEntry) const
This method checks if the Parameter contains a certain entry.
Definition: kratos_parameters.cpp:520
static Parameters CopyOptionalParameters(const Parameters &rSourceParameters, const std::vector< std::string > &rNamesOfParametersToCopy)
Definition: parameters_utilities.cpp:27
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21