Commit 884677ab authored by Timo Koch's avatar Timo Koch
Browse files

[example][1ptracer] Lower solver requirements (only use dune-istl)

parent a3b08f9a
...@@ -3,7 +3,6 @@ dune_symlink_to_source_files(FILES "params.input") ...@@ -3,7 +3,6 @@ dune_symlink_to_source_files(FILES "params.input")
dumux_add_test(NAME example_1ptracer dumux_add_test(NAME example_1ptracer
LABELS porousmediumflow tracer example LABELS porousmediumflow tracer example
SOURCES main.cc SOURCES main.cc
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_1ptracer_transport-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_1ptracer_transport-reference.vtu
......
...@@ -159,7 +159,8 @@ The grid variables are used store variables (primary and secondary variables) on ...@@ -159,7 +159,8 @@ The grid variables are used store variables (primary and secondary variables) on
``` ```
We now instantiate the assembler class, assemble the linear system and solve it with the linear We now instantiate the assembler class, assemble the linear system and solve it with the linear
solver UMFPack. Besides that, the time needed for assembly and solve is measured and printed. solver ILUnBiCGSTABBackend (a bi-conjugate gradient solver preconditioned by an incomplete LU-factorization preconditioner).
Besides that, the time needed for assembly and solve is measured and printed.
```cpp ```cpp
using OnePAssembler = FVAssembler<OnePTypeTag, DiffMethod::analytic>; using OnePAssembler = FVAssembler<OnePTypeTag, DiffMethod::analytic>;
...@@ -173,7 +174,7 @@ solver UMFPack. Besides that, the time needed for assembly and solve is measured ...@@ -173,7 +174,7 @@ solver UMFPack. Besides that, the time needed for assembly and solve is measured
(*r) *= -1.0; // We want to solve `Ax = -r`. (*r) *= -1.0; // We want to solve `Ax = -r`.
using LinearSolver = UMFPackBackend; using LinearSolver = ILUnBiCGSTABBackend;
Dune::Timer solverTimer; std::cout << "Solving linear system ..." << std::flush; Dune::Timer solverTimer; std::cout << "Solving linear system ..." << std::flush;
auto linearSolver = std::make_shared<LinearSolver>(); auto linearSolver = std::make_shared<LinearSolver>();
linearSolver->solve(*A, p, *r); linearSolver->solve(*A, p, *r);
......
...@@ -125,7 +125,8 @@ int main(int argc, char** argv) try ...@@ -125,7 +125,8 @@ int main(int argc, char** argv) try
onePGridVariables->init(p); onePGridVariables->init(p);
// We now instantiate the assembler class, assemble the linear system and solve it with the linear // We now instantiate the assembler class, assemble the linear system and solve it with the linear
// solver UMFPack. Besides that, the time needed for assembly and solve is measured and printed. // solver ILUnBiCGSTABBackend (a bi-conjugate gradient solver preconditioned by an incomplete LU-factorization preconditioner).
// Besides that, the time needed for assembly and solve is measured and printed.
using OnePAssembler = FVAssembler<OnePTypeTag, DiffMethod::analytic>; using OnePAssembler = FVAssembler<OnePTypeTag, DiffMethod::analytic>;
auto assemblerOneP = std::make_shared<OnePAssembler>(problemOneP, gridGeometry, onePGridVariables); auto assemblerOneP = std::make_shared<OnePAssembler>(problemOneP, gridGeometry, onePGridVariables);
assemblerOneP->setLinearSystem(A, r); // tell assembler to use our previously defined system assemblerOneP->setLinearSystem(A, r); // tell assembler to use our previously defined system
...@@ -137,7 +138,7 @@ int main(int argc, char** argv) try ...@@ -137,7 +138,7 @@ int main(int argc, char** argv) try
(*r) *= -1.0; // We want to solve `Ax = -r`. (*r) *= -1.0; // We want to solve `Ax = -r`.
using LinearSolver = UMFPackBackend; using LinearSolver = ILUnBiCGSTABBackend;
Dune::Timer solverTimer; std::cout << "Solving linear system ..." << std::flush; Dune::Timer solverTimer; std::cout << "Solving linear system ..." << std::flush;
auto linearSolver = std::make_shared<LinearSolver>(); auto linearSolver = std::make_shared<LinearSolver>();
linearSolver->solve(*A, p, *r); linearSolver->solve(*A, p, *r);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment