Skip to content

Commit 7fa439d

Browse files
author
Willi Braun
committed
- added newton solver as non-linear system solver
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14997 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent b3f99d0 commit 7fa439d

File tree

6 files changed

+615
-0
lines changed

6 files changed

+615
-0
lines changed

SimulationRuntime/c/simulation/simulation_runtime.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,15 @@ int getNonlinearSolverMethod(int argc, char**argv)
250250
return NS_HYBRID;
251251
else if(*method == string("kinsol"))
252252
return NS_KINSOL;
253+
else if(*method == string("newton"))
254+
return NS_NEWTON;
253255

254256
WARNING1(LOG_STDOUT, "unrecognized option -nls %s", method->c_str());
255257
WARNING(LOG_STDOUT, "current options are:");
256258
INDENT(LOG_STDOUT);
257259
WARNING2(LOG_STDOUT, "%-18s [%s]", "hybrid", "default method");
258260
WARNING2(LOG_STDOUT, "%-18s [%s]", "kinsol", "sundials/kinsol");
261+
WARNING2(LOG_STDOUT, "%-18s [%s]", "newton", "newton Raphson");
259262
THROW("see last warning");
260263
return NS_NONE;
261264
}

SimulationRuntime/c/simulation/solver/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SET(solver_sources dassl.c
1010
model_help.c
1111
nonlinearSystem.c
1212
nonlinearSolverHybrd.c
13+
nonlinearSolverNewton.c
1314
kinsolSolver.c
1415
solver_main.c
1516
stateset.c)
@@ -19,6 +20,7 @@ SET(solver_headers dassl.h
1920
events.h
2021
model_help.h
2122
nonlinearSolverHybrd.h
23+
nonlinearSolverNewton.h
2224
kinsolSolver.h
2325
nonlinearSystem.h
2426
solver_main.h

0 commit comments

Comments
 (0)