27#ifndef EWOMS_CUBE_GRID_VANGUARD_HH
28#define EWOMS_CUBE_GRID_VANGUARD_HH
36#include <dune/grid/utility/structuredgridfactory.hh>
38#include <dune/common/fvector.hh>
51template <
class TypeTag>
59 using GridPointer = std::unique_ptr<Grid>;
60 using CoordScalar =
typename Grid::ctype;
62 dim = Grid::dimension,
63 dimWorld = Grid::dimensionworld,
65 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
73 Parameters::Register<Parameters::GridGlobalRefinements>
74 (
"The number of global refinements of the grid "
75 "executed after it was loaded");
76 Parameters::Register<Parameters::DomainSizeX<Scalar>>
77 (
"The size of the domain in x direction");
78 Parameters::Register<Parameters::CellsX>
79 (
"The number of intervalls in x direction");
81 if constexpr (dim > 1) {
82 Parameters::Register<Parameters::DomainSizeY<Scalar>>
83 (
"The size of the domain in y direction");
84 Parameters::Register<Parameters::CellsY>
85 (
"The number of intervalls in y direction");
87 if constexpr (dim > 2) {
88 Parameters::Register<Parameters::DomainSizeZ<Scalar>>
89 (
"The size of the domain in z direction");
90 Parameters::Register<Parameters::CellsZ>
91 (
"The number of intervalls in z direction");
101 std::array<unsigned int, dim> cellRes;
102 GlobalPosition upperRight(0.0);
103 GlobalPosition lowerLeft(0.0);
105 for (
unsigned i = 0; i < dim; ++i)
108 upperRight[0] = Parameters::Get<Parameters::DomainSizeX<Scalar>>();
109 cellRes[0] = Parameters::Get<Parameters::CellsX>();
111 if constexpr (dim > 1) {
112 upperRight[1] = Parameters::Get<Parameters::DomainSizeY<Scalar>>();
113 cellRes[1] = Parameters::Get<Parameters::CellsY>();
115 if constexpr (dim > 2) {
116 upperRight[2] = Parameters::Get<Parameters::DomainSizeZ<Scalar>>();
117 cellRes[2] = Parameters::Get<Parameters::CellsZ>();
120 unsigned numRefinements = Parameters::Get<Parameters::GridGlobalRefinements>();
121 cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
122 cubeGrid_->globalRefine(
static_cast<int>(numRefinements));
Defines some fundamental parameters for all models.
Defines a type tags and some fundamental properties all models.
Provides the base class for most (all?) simulator vanguards.
Definition: basevanguard.hh:49
void finalizeInit_()
Definition: basevanguard.hh:115
Provides a simulator vanguad which creates a regular grid made of quadrilaterals.
Definition: cubegridvanguard.hh:53
const Grid & grid() const
Returns a reference to the grid.
Definition: cubegridvanguard.hh:136
GridPointer cubeGrid_
Definition: cubegridvanguard.hh:140
Grid & grid()
Returns a reference to the grid.
Definition: cubegridvanguard.hh:130
CubeGridVanguard(Simulator &simulator)
Create the grid.
Definition: cubegridvanguard.hh:98
static void registerParameters()
Register all run-time parameters for the simulator vanguad.
Definition: cubegridvanguard.hh:71
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:235
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.