Commit 83a2a880 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[examples] put captions in headers, remove double whitespaces

parent 82f1e25c
......@@ -17,8 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// We look now at the main file for the tracer problem. We set up two problems in this file and solve them sequentially, first the 1p problem and afterwards the tracer problem. The result of the 1p problem is the pressure distribution in the problem domain. We use it to calculate the volume fluxes, which act as an input for the tracer problem. Based on this volume fluxes, we calculate the transport of a tracer in the following tracer problem.
// ### Includes
// ## Main program flow (`main.cc`)
//
//
// This file contains the main program flow. In this example, we solve a single-phase flow problem
// to obtain a pressure distribution on the domain. Subsequently, the distribution of volume fluxes
// is computed from that pressure distribution, which is then passed to a tracer problem to solve
// the transport of an initial contamination through the model domain.
// ### Included header files
#include <config.h>
// We include both problems in the main file, the `problem_1p.hh` and the `problem_tracer.hh`.
......
......@@ -17,11 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ### Header guard
#ifndef DUMUX_ONEP_TEST_PROBLEM_HH
#define DUMUX_ONEP_TEST_PROBLEM_HH
// ## The file `problem_1p.hh`
//
//
// Before we enter the problem class containing initial and boundary conditions, we include necessary files and introduce properties.
// ### Include files
// We use `YaspGrid`, an implementation of the dune grid interface for structured grids:
......@@ -130,7 +131,7 @@ public:
OnePTestProblem(std::shared_ptr<const GridGeometry> gridGeometry)
: ParentType(gridGeometry) {}
// First, we define the type of boundary conditions depending on the location. Two types of boundary conditions
// First, we define the type of boundary conditions depending on the location. Two types of boundary conditions
// can be specified: Dirichlet or Neumann boundary condition. On a Dirichlet boundary, the values of the
// primary variables need to be fixed. On a Neumann boundary condition, values for derivatives need to be fixed.
// Mixed boundary conditions (different types for different equations on the same boundary) are not accepted for
......@@ -154,7 +155,7 @@ public:
return values;
}
// Second, we specify the values for the Dirichlet boundaries. We need to fix values of our primary variable
// Second, we specify the values for the Dirichlet boundaries. We need to fix values of our primary variable
PrimaryVariables dirichlet(const Element &element,
const SubControlVolumeFace &scvf) const
{
......
......@@ -17,10 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ### Header guard
#ifndef DUMUX_TRACER_TEST_PROBLEM_HH
#define DUMUX_TRACER_TEST_PROBLEM_HH
// ## The file `problem_tracer.hh`
//
//
//Before we enter the problem class containing initial and boundary conditions, we include necessary files and introduce properties.
// ### Include files
// Again, we use YaspGrid, the implementation of the dune grid interface for structured grids:
......
......@@ -17,10 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// the header guard
#ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
#define DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
// ## The file `spatialparams_1p.hh`
//
//
// In this file, we generate a random permeability field in the constructor of the `OnePTestSpatialParams` class.
// For this, we use the random number generation facilities provided by the C++ standard library.
#include <random>
......
......@@ -17,12 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// the header guard
#ifndef DUMUX_TRACER_TEST_SPATIAL_PARAMS_HH
#define DUMUX_TRACER_TEST_SPATIAL_PARAMS_HH
// ## The file `spatialparams_tracer.hh`
//
//
// In this file, we define spatial properties of the porous medium such as the permeability and the porosity in various functions for the tracer problem.
// Furthermore, spatial dependent properties of the tracer fluid system are defined and in the end two functions handle the calculated volume fluxes from the solution of the 1p problem.
// We use the properties for porous medium flow models, declared in the file `properties.hh`.
......
......@@ -16,7 +16,9 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ## The main file
// ## The file `main.cc`
//
//
// This is the main file for the 2pinfiltration example. Here we can see the programme sequence and how the system is solved using Newton's method
// ### Includes
#include <config.h>
......@@ -110,7 +112,7 @@ int main(int argc, char** argv) try
// In the problem, we define the boundary and initial conditions.
using Problem = GetPropType<TypeTag, Properties::Problem>;
auto problem = std::make_shared<Problem>(gridGeometry);
// We call the `computePointSourceMap` method to compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file.
// We call the `computePointSourceMap` method to compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file.
problem->computePointSourceMap();
// We initialize the solution vector,
......@@ -160,7 +162,7 @@ int main(int argc, char** argv) try
}
}
// Depending on the initial conditions, another grid adaptation might be necessary. The gridadaptindicator uses the input parameters `Adaptive.RefineTolerance` and `Adaptive.CoarsenTolerance` for this step.
// Depending on the initial conditions, another grid adaptation might be necessary. The gridadaptindicator uses the input parameters `Adaptive.RefineTolerance` and `Adaptive.CoarsenTolerance` for this step.
indicator.calculate(x, refineTol, coarsenTol);
//we mark the elements that were adapted
......
......@@ -17,13 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ## Header guard
// The header guard (or include guard) prevents compilation errors due to duplicate definitions.
// Here, a unique name needs to be defined for the header file:
#ifndef DUMUX_LENSPROBLEM_POINTSOURCE_ADAPTIVE_HH
#define DUMUX_LENSPROBLEM_POINTSOURCE_ADAPTIVE_HH
// ## Include files
// ## The file `problem.hh`
//
//
// ### Include files
// The grid we use
#include <dune/alugrid/grid.hh>
......@@ -125,7 +125,7 @@ namespace Dumux {
//We leave the namespace Properties.
}
// ## The problem class
// ### The problem class
// We enter the problem class where all necessary boundary conditions and initial conditions are set for our simulation.
// As this is a porous medium problem, we inherit from the basic PorousMediumFlowProblem.
template <class TypeTag >
......
......@@ -17,10 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// the header guard
#ifndef DUMUX_TWOP_INCOMPRESSIBLE_EXAMPLE_SPATIAL_PARAMS_HH
#define DUMUX_TWOP_INCOMPRESSIBLE_EXAMPLE_SPATIAL_PARAMS_HH
// ## The file `spatialparams.hh`
//
//
//we include the basic spatial parameters for finite volumes file from which we will inherit
#include <dumux/material/spatialparams/fv.hh>
......
......@@ -17,6 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ## The file `main.cc`
//
//
// We look now at the main file for the channel problem.
// ### Includes
// Necessary files are included.
......
......@@ -17,10 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ### Header guard
#ifndef DUMUX_CHANNEL_TEST_PROBLEM_HH
#define DUMUX_CHANNEL_TEST_PROBLEM_HH
// ## The file `problem.hh`
//
//
// ### The problem class
// We enter the problem class where all necessary initial and boundary conditions are set for our simulation.
......@@ -72,11 +73,11 @@ public:
// </details>
//
// Now, we define the type of initial and boundary conditions depending on location.
// Two types of boundary conditions can be specified: Dirichlet and Neumann. On a Dirichlet boundary,
// Two types of boundary conditions can be specified: Dirichlet and Neumann. On a Dirichlet boundary,
// the values of the primary variables need to be fixed.
// On a Neumann boundary condition, values for derivatives need to be fixed.
// When Dirichlet conditions are set for the pressure, the derivative of the velocity
// vector with respect to the direction normal to the boundary is automatically set to
// vector with respect to the direction normal to the boundary is automatically set to
// zero. This boundary condition is called in-/outflow boundary condition in Dumux.
// In the following we specify Dirichlet boundaries for velocity on the left of our domain
// if isInlet_ is true, Dirichlet boundaries for pressure on the right of our domain
......
......@@ -16,7 +16,10 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ## The main file
// ## The file `main.cc`
//
//
// This is the main file for the shallow water example. Here we can see the programme sequence and how the system is solved using newton's method.
// ### Includes
#include <config.h>
......
......@@ -17,11 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// ## Header guard
// The header guard (or include guard) prevents compilation errors due to duplicate definitions. Here, a unique name needs to be defined for the header file:
#ifndef DUMUX_ROUGH_CHANNEL_TEST_PROBLEM_HH
#define DUMUX_ROUGH_CHANNEL_TEST_PROBLEM_HH
// ## The file `problem.hh`
//
//
// ## Include files
// We use the dune yasp grid.
#include <dune/grid/yaspgrid.hh>
......@@ -222,7 +223,11 @@ public:
return bcTypes;
}
// We specify the neumann boundary. Due to the weak imposition we calculate the flux at the boundary, with a Rieman solver. For this the state of a virtual cell outside of the boundary is needed (`boundaryStateVariables`), wich is calculated with the Riemann invariants (see Yoon and Kang, Finite Volume Model for Two-Dimensional Shallow Water Flows on Unstructured Grids) . The calculation of the Riemann invariants differ depending on the type of the boundary (h, q or no-flow boundary).
// We specify the neumann boundary. Due to the weak imposition we calculate the flux at the
// boundary, with a Rieman solver. For this the state of a virtual cell outside of the boundary
// is needed (`boundaryStateVariables`), wich is calculated with the Riemann invariants
// (see Yoon and Kang, Finite Volume Model for Two-Dimensional Shallow Water Flows on Unstructured Grids).
// The calculation of the Riemann invariants differ depending on the type of the boundary (h, q or no-flow boundary).
NeumannFluxes neumann(const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
......
......@@ -17,10 +17,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
// the header guard
#ifndef DUMUX_ROUGH_CHANNEL_SPATIAL_PARAMETERS_HH
#define DUMUX_ROUGH_CHANNEL_SPATIAL_PARAMETERS_HH
// ## The file `spatialparams.hh`
//
//
// We include the basic spatial parameters for finite volumes file from which we will inherit
#include <dumux/material/spatialparams/fv.hh>
// The parameters header is needed to retrieve run-time parameters.
......
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