Commit c788bbdb authored by hanchuan's avatar hanchuan Committed by Timo Koch
Browse files

[examples] Use Dumux::NumEqVector in examples and update documentation

parent 28cac626
Pipeline #3767 waiting for manual action with stages
...@@ -246,6 +246,12 @@ Include the `BoundaryTypes` class which specifies the boundary types set in this ...@@ -246,6 +246,12 @@ Include the `BoundaryTypes` class which specifies the boundary types set in this
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
``` ```
Include the `NumEqVector` class which specifies a field vector with size number of equations in this problem.
```cpp
#include <dumux/common/numeqvector.hh>
```
### The problem class ### The problem class
We enter the problem class where all necessary boundary conditions and initial We enter the problem class where all necessary boundary conditions and initial
...@@ -270,7 +276,7 @@ class TracerTestProblem : public PorousMediumFlowProblem<TypeTag> ...@@ -270,7 +276,7 @@ class TracerTestProblem : public PorousMediumFlowProblem<TypeTag>
using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>; using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>;
using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using Element = typename GridGeometry::GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
// Include the `BoundaryTypes` class which specifies the boundary types set in this problem. // Include the `BoundaryTypes` class which specifies the boundary types set in this problem.
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
// Include the `NumEqVector` class which specifies a field vector with size number of equations in this problem.
#include <dumux/common/numeqvector.hh> #include <dumux/common/numeqvector.hh>
// ### The problem class // ### The problem class
......
...@@ -151,13 +151,14 @@ struct Formulation<TypeTag, TTag::PointSourceExample> ...@@ -151,13 +151,14 @@ struct Formulation<TypeTag, TTag::PointSourceExample>
### Includes ### Includes
We start with includes for `PorousMediumFlowProblem`, `readFileToContainer`, We start with includes for `PorousMediumFlowProblem`, `readFileToContainer`,
`BoundaryTypes` and `GetPropType` (used below). `BoundaryTypes`, `GetPropType` and `NumEqVector` (used below).
```cpp ```cpp
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/io/container.hh> #include <dumux/io/container.hh>
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/numeqvector.hh>
``` ```
### Problem class ### Problem class
...@@ -188,7 +189,7 @@ The class implementation starts with some alias declarations and index definitio ...@@ -188,7 +189,7 @@ The class implementation starts with some alias declarations and index definitio
using PointSource = GetPropType<TypeTag, Properties::PointSource>; using PointSource = GetPropType<TypeTag, Properties::PointSource>;
using BoundaryTypes = Dumux::BoundaryTypes<PrimaryVariables::size()>; using BoundaryTypes = Dumux::BoundaryTypes<PrimaryVariables::size()>;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
enum { enum {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
// //
// ### Includes // ### Includes
// We start with includes for `PorousMediumFlowProblem`, `readFileToContainer`, // We start with includes for `PorousMediumFlowProblem`, `readFileToContainer`,
// `BoundaryTypes` and `GetPropType` (used below). // `BoundaryTypes`, `GetPropType` and `NumEqVector` (used below).
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/io/container.hh> #include <dumux/io/container.hh>
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
......
...@@ -40,6 +40,7 @@ conditions for the biominearalization example. ...@@ -40,6 +40,7 @@ conditions for the biominearalization example.
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/common/boundarytypes.hh> // for `BoundaryTypes` #include <dumux/common/boundarytypes.hh> // for `BoundaryTypes`
#include <dumux/common/properties.hh> // GetPropType #include <dumux/common/properties.hh> // GetPropType
#include <dumux/common/numeqvector.hh> // for `NumEqVector`
#include <dumux/material/components/ammonia.hh> #include <dumux/material/components/ammonia.hh>
#include <dumux/discretization/evalgradients.hh> #include <dumux/discretization/evalgradients.hh>
#include <dumux/io/container.hh> #include <dumux/io/container.hh>
...@@ -101,7 +102,7 @@ class MICPColumnProblemSimpleChemistry : public PorousMediumFlowProblem<TypeTag> ...@@ -101,7 +102,7 @@ class MICPColumnProblemSimpleChemistry : public PorousMediumFlowProblem<TypeTag>
}; };
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
using BoundaryTypes = Dumux::BoundaryTypes<PrimaryVariables::size()>; using BoundaryTypes = Dumux::BoundaryTypes<PrimaryVariables::size()>;
using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <dumux/porousmediumflow/problem.hh> #include <dumux/porousmediumflow/problem.hh>
#include <dumux/common/boundarytypes.hh> // for `BoundaryTypes` #include <dumux/common/boundarytypes.hh> // for `BoundaryTypes`
#include <dumux/common/properties.hh> // GetPropType #include <dumux/common/properties.hh> // GetPropType
#include <dumux/common/numeqvector.hh> #include <dumux/common/numeqvector.hh> // for `NumEqVector`
#include <dumux/material/components/ammonia.hh> #include <dumux/material/components/ammonia.hh>
#include <dumux/discretization/evalgradients.hh> #include <dumux/discretization/evalgradients.hh>
#include <dumux/io/container.hh> #include <dumux/io/container.hh>
......
...@@ -147,6 +147,7 @@ conditions for the Navier-Stokes single-phase flow simulation. ...@@ -147,6 +147,7 @@ conditions for the Navier-Stokes single-phase flow simulation.
```cpp ```cpp
#include <dumux/common/properties.hh> #include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
#include <dumux/common/numeqvector.hh>
``` ```
Include the `NavierStokesProblem` class, the base Include the `NavierStokesProblem` class, the base
...@@ -178,8 +179,8 @@ class LidDrivenCavityExampleProblem : public NavierStokesProblem<TypeTag> ...@@ -178,8 +179,8 @@ class LidDrivenCavityExampleProblem : public NavierStokesProblem<TypeTag>
using FVElementGeometry = typename GridGeometry::LocalView; using FVElementGeometry = typename GridGeometry::LocalView;
using SubControlVolume = typename GridGeometry::SubControlVolume; using SubControlVolume = typename GridGeometry::SubControlVolume;
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using Element = typename GridGeometry::GridView::template Codim<0>::Entity;
......
...@@ -168,6 +168,12 @@ Include the `BoundaryTypes` class which specifies the boundary types set in this ...@@ -168,6 +168,12 @@ Include the `BoundaryTypes` class which specifies the boundary types set in this
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
``` ```
Include the `NumEqVector` class which specifies a field vector with size number of equations in this problem.
```cpp
#include <dumux/common/numeqvector.hh>
```
### The problem class ### The problem class
We enter the problem class where all necessary boundary conditions and initial conditions are set for our simulation. We enter the problem class where all necessary boundary conditions and initial conditions are set for our simulation.
In addition the analytical solution of the problem is calculated. In addition the analytical solution of the problem is calculated.
...@@ -186,7 +192,6 @@ class RoughChannelProblem : public ShallowWaterProblem<TypeTag> ...@@ -186,7 +192,6 @@ class RoughChannelProblem : public ShallowWaterProblem<TypeTag>
using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using NeumannFluxes = GetPropType<TypeTag, Properties::NumEqVector>;
using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView;
...@@ -195,7 +200,8 @@ class RoughChannelProblem : public ShallowWaterProblem<TypeTag> ...@@ -195,7 +200,8 @@ class RoughChannelProblem : public ShallowWaterProblem<TypeTag>
using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView; using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
using Element = typename GridView::template Codim<0>::Entity; using Element = typename GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using NumEqVector = Dumux::NumEqVector<PrimaryVariables>;
using NeumannFluxes = NumEqVector;
using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolume = typename FVElementGeometry::SubControlVolume;
public: public:
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <dumux/freeflow/shallowwater/boundaryfluxes.hh> #include <dumux/freeflow/shallowwater/boundaryfluxes.hh>
// Include the `BoundaryTypes` class which specifies the boundary types set in this problem. // Include the `BoundaryTypes` class which specifies the boundary types set in this problem.
#include <dumux/common/boundarytypes.hh> #include <dumux/common/boundarytypes.hh>
// Include the `NumEqVector` class which specifies a field vector with size number of equations in this problem.
#include <dumux/common/numeqvector.hh> #include <dumux/common/numeqvector.hh>
// ### The problem class // ### The problem class
......
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