Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
df60408
added quasi newton raphson with good broyden and lbfgs
aronnoordam Jun 23, 2026
a218586
cleanup
aronnoordam Jun 23, 2026
dba2c42
fixed tests
aronnoordam Jun 24, 2026
4ac1d25
added override
aronnoordam Jun 24, 2026
d700fcd
Added an attribute that keeps the CSV file path
avdg81 Jun 25, 2026
19465ba
Moved the expected results of the model with Mohr-Coulomb materials
avdg81 Jun 25, 2026
14369a8
Added an attribute that keeps the common test files directory
avdg81 Jun 25, 2026
69d9108
Add one more subdirectory to each test run
avdg81 Jun 25, 2026
7f6de98
Removed unused arguments and commented-out code
avdg81 Jun 25, 2026
f23d3cc
Moved the CSV files with results from a commercial FE package as well…
avdg81 Jun 25, 2026
53d7763
Renamed a method
avdg81 Jun 25, 2026
b1fa895
Use same set of expected results
avdg81 Jun 25, 2026
4c5142d
Restored expected results obtained with linear iteration
avdg81 Jun 25, 2026
0158597
Added a test case that uses linear iteration
avdg81 Jun 25, 2026
8c527e5
Extracted a function
avdg81 Jun 25, 2026
07740e9
Renamed a function
avdg81 Jun 25, 2026
f536f43
Reformatted the test script with `black`
avdg81 Jun 25, 2026
6c25b35
Reverted the changes to the project parameters file
avdg81 Jun 26, 2026
7506f63
Removed redundant setting of linear iteration
avdg81 Jun 26, 2026
66248d8
Moved some duplicated code down the call stack, to remove it
avdg81 Jun 26, 2026
5be2d90
Extended the preparation for a test run
avdg81 Jun 26, 2026
e482512
Re-activated the save-and-load test case
avdg81 Jun 26, 2026
1e95483
Extended the preparation of the test run once more
avdg81 Jun 26, 2026
65a9860
Inlined method `get_project_parameters`
avdg81 Jun 26, 2026
a225a3d
Merged two methods
avdg81 Jun 26, 2026
f2f98ad
Gave a recurring string a name
avdg81 Jun 26, 2026
53da150
Renamed a few test cases
avdg81 Jun 26, 2026
873d95e
Modified the code that updates the expected results
avdg81 Jun 26, 2026
f0d076f
Extracted a variable
avdg81 Jun 26, 2026
c171f68
Added initialization of an attribute
avdg81 Jun 26, 2026
aca122f
resolved comments
aronnoordam Jul 1, 2026
e3ba922
Merge remote-tracking branch 'origin/geo/quasi_newton_raphson__avdg81…
aronnoordam Jul 1, 2026
d6c4cc7
simplified set quasi newton method
aronnoordam Jul 1, 2026
2ad4e09
added quasi newton to solving_strategy_factory.hpp
aronnoordam Jul 2, 2026
f819411
Merge branch 'master' into geo/quasi_newton_raphson_dset
aronnoordam Jul 2, 2026
e7e939c
added test for quasi newton in solver strategy factory
aronnoordam Jul 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "builder_and_solver_factory.hpp"
#include "convergence_criteria_factory.hpp"
#include "custom_strategies/strategies/geo_mechanics_newton_raphson_strategy.hpp"
#include "custom_strategies/strategies/geo_mechanics_quasi_newton_strategy.hpp"
#include "factories/standard_linear_solver_factory.h"
#include "parameters_utilities.h"
#include "scheme_factory.hpp"
Expand Down Expand Up @@ -76,6 +77,27 @@ class SolvingStrategyFactory
return result;
}

if (rSolverSettings[strategy_type].GetString() == "quasi_newton") {
const auto max_iterations = rSolverSettings["max_iterations"].GetInt();
const auto compute_reactions = rSolverSettings["compute_reactions"].GetBool();
const auto reform_dof_set_at_each_step = rSolverSettings["reform_dofs_at_each_step"].GetBool();
const auto move_mesh_flag = rSolverSettings["move_mesh_flag"].GetBool();

auto strategy_parameters = Parameters{};

strategy_parameters.AddValue("quasi_newton_type", rSolverSettings["quasi_newton_type"]);
strategy_parameters.AddValue("quasi_newton_restart_interval",
rSolverSettings["quasi_newton_restart_interval"]);
strategy_parameters.AddValue("quasi_newton_max_rank",
rSolverSettings["quasi_newton_max_rank"]);
auto result =
std::make_unique<GeoMechanicsQuasiNewtonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>>(
rModelPart, scheme, criteria, builder_and_solver, strategy_parameters,
max_iterations, compute_reactions, reform_dof_set_at_each_step, move_mesh_flag);
result->SetEchoLevel(echo_level);
return result;
}

if (rSolverSettings[strategy_type].GetString() == "line_search") {
const std::vector<std::string> strategy_entries = {"compute_reactions",
"max_line_search_iterations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,22 @@ KRATOS_TEST_CASE_IN_SUITE(CreatedLineSearchStrategyUsesMaxIterationsInput, Krato
KRATOS_EXPECT_EQ(static_cast<int>(p_line_search_strategy->GetMaxIterationNumber()), max_number_of_iterations);
}

KRATOS_TEST_CASE_IN_SUITE(Create_ReturnsSolvingStrategy_ForQuasiNewtonStrategy, KratosGeoMechanicsFastSuite)
{
Model model;
const int buffer_size = 2;
auto& dummy_model_part = model.CreateModelPart("dummy", buffer_size);
Parameters parameters{testParameters};
parameters["strategy_type"].SetString("quasi_newton");
parameters.AddString("quasi_newton_type", "broyden");
parameters.AddInt("quasi_newton_restart_interval", 50);
parameters.AddInt("quasi_newton_max_rank", 10);

const auto created_strategy = SolvingStrategyFactoryType::Create(parameters, dummy_model_part);

KRATOS_EXPECT_TRUE(created_strategy->GetMoveMeshFlag()) // since it is set to true in the parameters
KRATOS_EXPECT_NE(created_strategy, nullptr);
KRATOS_EXPECT_EQ(created_strategy->Check(), 0);
}

} // namespace Kratos::Testing
Loading