Skip to content
Snippets Groups Projects
Commit 3743e4d7 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[newton] use new NewtonSolver in incompressible 2p fv test

parent cfefa2c4
No related branches found
No related tags found
1 merge request!795[newton] use new NewtonSolver in incompressible 2p fv test
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
#include <dumux/common/defaultusagemessage.hh> #include <dumux/common/defaultusagemessage.hh>
#include <dumux/linear/amgbackend.hh> #include <dumux/linear/amgbackend.hh>
#include <dumux/nonlinear/newtonmethod.hh> #include <dumux/nonlinear/newtonsolver.hh>
#include <dumux/nonlinear/newtoncontroller.hh>
#include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/fvassembler.hh>
#include <dumux/assembly/diffmethod.hh> #include <dumux/assembly/diffmethod.hh>
...@@ -163,10 +162,8 @@ int main(int argc, char** argv) try ...@@ -163,10 +162,8 @@ int main(int argc, char** argv) try
auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->dofMapper()); auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->dofMapper());
// the non-linear solver // the non-linear solver
using NewtonController = Dumux::NewtonController<Scalar>; using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>;
using NewtonMethod = Dumux::NewtonMethod<NewtonController, Assembler, LinearSolver>; NewtonSolver nonLinearSolver(assembler, linearSolver);
auto newtonController = std::make_shared<NewtonController>(timeLoop);
NewtonMethod nonLinearSolver(newtonController, assembler, linearSolver);
// time loop // time loop
timeLoop->start(); do timeLoop->start(); do
...@@ -206,8 +203,8 @@ int main(int argc, char** argv) try ...@@ -206,8 +203,8 @@ int main(int argc, char** argv) try
// report statistics of this time step // report statistics of this time step
timeLoop->reportTimeStep(); timeLoop->reportTimeStep();
// set new dt as suggested by newton controller // set new dt as suggested by the Newton solver
timeLoop->setTimeStepSize(newtonController->suggestTimeStepSize(timeLoop->timeStepSize())); timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize()));
} while (!timeLoop->finished()); } while (!timeLoop->finished());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment