29 template<
class TSparseSpace,
class TDenseSpace,
class TLinearSolver>
32 [[nodiscard]]
static std::unique_ptr<SolvingStrategy<TSparseSpace, TDenseSpace>>
34 const std::string strategy_type =
"strategy_type";
37 <<
"The parameter strategy_type is undefined, aborting.";
42 rSolverSettings[
"linear_solver_settings"]);
50 KRATOS_ERROR_IF_NOT(builder_and_solver) <<
"Failed to create a builder-and-solver" << std::endl;
57 if (rSolverSettings[strategy_type].GetString() ==
"newton_raphson") {
59 const auto calculate_reactions = rSolverSettings[
"calculate_reactions"].
GetBool();
60 const auto reform_dof_set_at_each_step = rSolverSettings[
"reform_dofs_at_each_step"].
GetBool();
61 const auto move_mesh_flag = rSolverSettings[
"move_mesh_flag"].
GetBool();
63 const std::vector<std::string> strategy_entries = {
"loads_sub_model_part_list",
64 "loads_variable_list"};
66 rSolverSettings, strategy_entries);
69 TLinearSolver>>(rModelPart,
77 reform_dof_set_at_each_step,
81 }
else if (rSolverSettings[strategy_type].GetString() ==
"line_search") {
82 const std::vector<std::string> strategy_entries = {
"max_iteration",
84 "max_line_search_iterations",
89 "line_search_tolerance",
91 "reform_dofs_at_each_step",
95 rSolverSettings, strategy_entries);
98 TLinearSolver>>(rModelPart,
102 strategy_parameters);
static std::shared_ptr< BuilderAndSolverType > Create(const Parameters &rSolverSettings, typename TLinearSolver::Pointer pNewLinearSystemSolver)
Definition: builder_and_solver_factory.hpp:28
static std::shared_ptr< ConvergenceCriteriaType > Create(const Parameters &rSolverSettings)
Definition: convergence_criteria_factory.hpp:28
Definition: geo_mechanics_newton_raphson_strategy.hpp:31
Short class definition.
Definition: line_search_strategy.h:84
Here we add the functions needed for the registration of linear solvers.
Definition: linear_solver_factory.h:62
virtual LinearSolver< TSparseSpace, TLocalSpace >::Pointer Create(Kratos::Parameters Settings) const
This method creates a new solver.
Definition: linear_solver_factory.h:100
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
bool Has(const std::string &rEntry) const
This method checks if the Parameter contains a certain entry.
Definition: kratos_parameters.cpp:520
bool GetBool() const
This method returns the boolean contained in the current Parameter.
Definition: kratos_parameters.cpp:675
static Parameters CopyOptionalParameters(const Parameters &rSourceParameters, const std::vector< std::string > &rNamesOfParametersToCopy)
Definition: parameters_utilities.cpp:27
void SetEchoLevel(int Level) override
It sets the level of echo for the solving strategy.
Definition: residualbased_newton_raphson_strategy.h:599
static std::shared_ptr< SchemeType > Create(const Parameters &rSolverSettings)
Definition: scheme_factory.hpp:28
Definition: solving_strategy_factory.hpp:30
static std::unique_ptr< SolvingStrategy< TSparseSpace, TDenseSpace > > Create(const Parameters &rSolverSettings, ModelPart &rModelPart)
Definition: solving_strategy_factory.hpp:33
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
unique_ptr< C > make_unique(Args &&...args)
Definition: smart_pointers.h:45
int max_iterations
Definition: ProjectParameters.py:53
echo_level
Definition: script.py:68
solver
Definition: script.py:98