Skip to content
Snippets Groups Projects
Commit c8ba6590 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[test][tracer][multiphase] Use experimental assembly/timestepping

parent b55205b9
No related branches found
No related tags found
1 merge request!3608[experimental] Multistage assembler
...@@ -21,16 +21,17 @@ ...@@ -21,16 +21,17 @@
#include <dumux/common/initialize.hh> #include <dumux/common/initialize.hh>
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
#include <dumux/common/dumuxmessage.hh>
#include <dumux/common/defaultusagemessage.hh>
#include <dumux/linear/seqsolverbackend.hh> #include <dumux/linear/seqsolverbackend.hh>
#include <dumux/linear/pdesolver.hh> #include <dumux/linear/pdesolver.hh>
#include <dumux/assembly/fvassembler.hh>
#include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/io/grid/gridmanager_yasp.hh>
#include <dumux/experimental/assembly/multistagefvassembler.hh>
#include <dumux/experimental/timestepping/multistagemethods.hh>
#include <dumux/experimental/timestepping/multistagetimestepper.hh>
#include "properties.hh" #include "properties.hh"
int main(int argc, char** argv) int main(int argc, char** argv)
...@@ -42,11 +43,6 @@ int main(int argc, char** argv) ...@@ -42,11 +43,6 @@ int main(int argc, char** argv)
// maybe initialize MPI and/or multithreading backend // maybe initialize MPI and/or multithreading backend
Dumux::initialize(argc, argv); Dumux::initialize(argc, argv);
const auto& mpiHelper = Dune::MPIHelper::instance();
//! print dumux start message
if (mpiHelper.rank() == 0)
DumuxMessage::print(/*firstCall=*/true);
// parse the command line arguments and input file // parse the command line arguments and input file
Parameters::init(argc, argv); Parameters::init(argc, argv);
...@@ -97,21 +93,22 @@ int main(int argc, char** argv) ...@@ -97,21 +93,22 @@ int main(int argc, char** argv)
//! instantiate time loop //! instantiate time loop
auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0, dt, tEnd); auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0, dt, tEnd);
auto timeSteppingMethod = std::make_shared<Experimental::MultiStage::ExplicitEuler<Scalar>>();
//! the assembler with time loop for instationary problem //! the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric, /*implicit=*/false>; using Assembler = Experimental::MultiStageFVAssembler<TypeTag, DiffMethod::numeric>;
auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeSteppingMethod, xOld);
//! the linear solver //! the linear solver
using LinearSolver = ExplicitDiagonalSolver; using LinearSolver = ExplicitDiagonalSolver;
auto linearSolver = std::make_shared<LinearSolver>(); auto linearSolver = std::make_shared<LinearSolver>();
//! the system solver //! the system solver
LinearPDESolver<Assembler, LinearSolver> solver(assembler, linearSolver); using Solver = LinearPDESolver<Assembler, LinearSolver>;
auto solver = std::make_shared<Solver>(assembler, linearSolver);
///////////////////////////////////////////////////////////////////////////////////////////////// using TimeStepper = Experimental::MultiStageTimeStepper<Solver>;
// run instationary non-linear simulation TimeStepper timeStepper(solver, timeSteppingMethod);
/////////////////////////////////////////////////////////////////////////////////////////////////
//! set some check points for the time loop //! set some check points for the time loop
timeLoop->setPeriodicCheckPoint(tEnd/10.0); timeLoop->setPeriodicCheckPoint(tEnd/10.0);
...@@ -120,8 +117,8 @@ int main(int argc, char** argv) ...@@ -120,8 +117,8 @@ int main(int argc, char** argv)
timeLoop->start(); timeLoop->start();
while (!timeLoop->finished()) while (!timeLoop->finished())
{ {
// assemble & solve // time integration
solver.solve(x); timeStepper.step(x, timeLoop->time(), timeLoop->timeStepSize());
// make the new solution the old solution // make the new solution the old solution
xOld = x; xOld = x;
...@@ -143,12 +140,7 @@ int main(int argc, char** argv) ...@@ -143,12 +140,7 @@ int main(int argc, char** argv)
timeLoop->finalize(leafGridView.comm()); timeLoop->finalize(leafGridView.comm());
//////////////////////////////////////////////////////////// if (leafGridView.comm().rank() == 0)
// finalize, print dumux message to say goodbye
////////////////////////////////////////////////////////////
//! print dumux end message
if (mpiHelper.rank() == 0)
Parameters::print(); Parameters::print();
return 0; return 0;
......
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