<figcaption><b> Fig.2 </b> - Setup for the rotation-symmetric problem. The pressure boundary conditions are shown by the colored lines and the simulation domain is depicted in grey.</figcaption>

</center>

</figure>

This could, for example, represent a cross section of an injection/extraction well in a homogeneous

and isotropic porous medium, where the well with radius $`r_1`$ is cut out and the

injection/extraction pressure $`p_1`$ is prescribed as a Dirichlet boundary condition. At the outer

radius $`r_2`$, we set the pressure $`p_2`$. In the polar coordinates $`r`$ and $`\varphi`$, the

solution to this problem is independent of the angular coordinate $`\varphi`$ and can be reduced to

a one-dimensional problem in the radial coordinate $`r`$. Therefore, in this example, we want to

solve the problem on a one-dimensional computational domain as illustrated by the orange line in

the above figure.

## Mathematical model

In this example we are using the single-phase model of DuMu<sup>x</sup>, which considers Darcy's law to relate

the Darcy velocity $`\textbf u`$ to gradients of the pressure $`p`$. In the case of rotational

symmetry, the mass balance equation for the fluid phase can be transformed using polar coordinates:

<!-- Important: This file has been automatically generated by generate_example_docs.py. Do not edit this file directly! -->

| [:arrow_left: Back to the main documentation](../README.md) | [:arrow_left: Go back to part 1](problem.md) | [:arrow_right: Continue with part 3](paraview.md) |

|---|---|---:|

# Part 2: Main program flow

We want to solve a rotational symmetric Laplace problem on a disc and

conduct a grid convergence study against an analytical solution.

The main program flow is implemented in file `main.cc` described below.

The code documentation is structured as follows:

[[_TOC_]]

## The main program (`main.cc`)

This file contains the main program flow. In this example, we solve a stationary

and rotationally symmetric single-phase problem for a sequence of refined grids

and compute the convergence rates.

<detailsopen>

<summary><b>Click to hide/show the file documentation</b> (or inspect the [source code](../main.cc))</summary>

### Includes

<details><summary> Click to show includes</summary>

```cpp

#include<config.h>

#include<iostream>

#include<dune/common/parallel/mpihelper.hh>

#include<dumux/common/properties.hh> // for GetPropType

#include<dumux/common/parameters.hh> // for getParam

#include<dumux/common/integrate.hh> // for integrateL2Error

#include<dumux/linear/seqsolverbackend.hh> // for UMFPackBackend

#include<dumux/linear/pdesolver.hh> // for LinearPDESolver

#include<dumux/assembly/fvassembler.hh>

#include<dumux/assembly/diffmethod.hh>

#include<dumux/io/vtkoutputmodule.hh>

#include<dumux/io/grid/gridmanager_yasp.hh>

#include"properties.hh"

```

</details>

### Beginning of the main function

```cpp

intmain(intargc,char**argv)try

{

usingnamespaceDumux;

// We initialize MPI. Finalization is done automatically on exit.

Dune::MPIHelper::instance(argc,argv);

// We parse the command line arguments.

Parameters::init(argc,argv);

// Convenience alias for the type tag of the problem.

usingTypeTag=Properties::TTag::OnePRotSym;

```

### Create the grid and the grid geometry

```cpp

// The grid manager can be used to create a grid from the input file

| [:arrow_left: Back to the main documentation](../README.md) | [:arrow_left: Go back to part 1](problem.md) | [:arrow_right: Continue with part 3](paraview.md) |