Skip to content
Snippets Groups Projects
Commit df9b047a authored by Martin Schneider's avatar Martin Schneider Committed by Ivan Buntic
Browse files

[main] Correct readme

parent 920675db
No related branches found
No related tags found
1 merge request!266Cleanup/ex main
# Exercise Mainfiles (DuMuX course)
<br>
## Problem set-up
......@@ -24,9 +23,7 @@ In the beginning, there is a uniform pressure of $1\cdot 10^5 Pa$ in the whole d
* Navigate to the directory `dumux-course/exercises/exercise-mainfile`
<br><br>
### Task 1: Getting familiar with the code
<hr>
## Task 1: Getting familiar with the code
Locate all the files you will need for this exercise
* The __main file__ for the __incompressible, stationary__ problem : `exercise1pamain.cc`
......@@ -40,8 +37,8 @@ Locate all the files you will need for this exercise
* The __input file__ for the __compressible, instationary__ problem: `exercise_mainfile_c.input`
Please pay special attention to the similarities and differences in the three main files.
The first main file is solved linearly and does not need a newton solver or any other nonlinear solver method.
The second problem is a nonlinear problem and uses newton's method to solve the system.
The first main file is solved linearly and does not need a Newton solver or any other nonlinear solver method.
The second problem is a nonlinear problem and uses Newton's method to solve the system.
The third problem is nonlinear and additionally instationary.
Therefore, a time loop needs to be included in the main file.
......@@ -72,15 +69,15 @@ auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
// the problem (initial and boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
auto problem = std::make_shared<Problem>(fvGridGeometry);
auto problem = std::make_shared<Problem>(gridGeometry);
// the solution vector
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
SolutionVector x(fvGridGeometry->numDofs());
SolutionVector x(gridGeometry->numDofs());
// the grid variables
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry);
auto gridVariables = std::make_shared<GridVariables>(problem, gridGeometry);
gridVariables->init(x);
// initialize the vtk output module
......@@ -108,7 +105,7 @@ timeLoop->setMaxTimeStepSize(maxDt);
// the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop);
auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld);
// the linear solver
using LinearSolver = ILUBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>;
......@@ -149,9 +146,7 @@ timeLoop->start(); do
timeLoop->finalize(leafGridView.comm());
```
<br><br><br>
### Task 2: Compiling and running an executable
<hr>
## Task 2: Compiling and running an executable
* Change to the build-directory
......@@ -179,9 +174,7 @@ make exercise_mainfile_a exercise_mainfile_b exercise_mainfile_c
paraview 1p_incompressible_stationary.pvd
```
<br><br><br>
### Task 3: Analytical differentiation
<hr>
## Task 3: Analytical differentiation
In the input file `exercise_mainfile_a.input`, you will see that there is a variable `BaseEpsilon`.
This defines the base value for the epsilon used in the numeric differentiation.
......
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