27#ifndef EWOMS_CUBE_GRID_VANGUARD_HH
28#define EWOMS_CUBE_GRID_VANGUARD_HH
35#include <dune/grid/utility/structuredgridfactory.hh>
37#include <dune/common/fvector.hh>
50template <
class TypeTag>
58 using GridPointer = std::unique_ptr<Grid>;
59 using CoordScalar =
typename Grid::ctype;
60 enum { dimWorld = Grid::dimensionworld };
61 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
69 Parameters::registerParam<TypeTag, Properties::GridGlobalRefinements>
70 (
"The number of global refinements of the grid "
71 "executed after it was loaded");
72 Parameters::registerParam<TypeTag, Properties::DomainSizeX>
73 (
"The size of the domain in x direction");
74 Parameters::registerParam<TypeTag, Properties::CellsX>
75 (
"The number of intervalls in x direction");
77 Parameters::registerParam<TypeTag, Properties::DomainSizeY>
78 (
"The size of the domain in y direction");
79 Parameters::registerParam<TypeTag, Properties::CellsY>
80 (
"The number of intervalls in y direction");
83 Parameters::registerParam<TypeTag, Properties::DomainSizeZ>
84 (
"The size of the domain in z direction");
85 Parameters::registerParam<TypeTag, Properties::CellsZ>
86 (
"The number of intervalls in z direction");
96 std::array<unsigned int, dimWorld> cellRes;
97 GlobalPosition upperRight(0.0);
98 GlobalPosition lowerLeft(0.0);
100 for (
unsigned i = 0; i < dimWorld; ++i)
103 upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
104 cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
106 upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
107 cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
110 upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
111 cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
114 unsigned numRefinements = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
115 cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
116 cubeGrid_->globalRefine(
static_cast<int>(numRefinements));
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:52
const Grid & grid() const
Returns a reference to the grid.
Definition: cubegridvanguard.hh:130
GridPointer cubeGrid_
Definition: cubegridvanguard.hh:134
Grid & grid()
Returns a reference to the grid.
Definition: cubegridvanguard.hh:124
CubeGridVanguard(Simulator &simulator)
Create the grid.
Definition: cubegridvanguard.hh:93
static void registerParameters()
Register all run-time parameters for the simulator vanguad.
Definition: cubegridvanguard.hh:67
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:242
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.