27 #ifndef EWOMS_STRUCTURED_GRID_VANGUARD_HH 28 #define EWOMS_STRUCTURED_GRID_VANGUARD_HH 30 #include <dune/common/fvector.hh> 31 #include <dune/common/version.hh> 33 #include <dune/grid/yaspgrid.hh> 34 #include <dune/grid/io/file/dgfparser/dgfyasp.hh> 44 #include <dune/alugrid/grid.hh> 45 #include <dune/alugrid/dgf.hh> 53 template <
class TypeTag>
68 static constexpr
int dim = 2;
70 static constexpr
int dim = GRIDDIM;
75 template<
class TypeTag>
77 {
using type = Dune::ALUGrid< dim, dim, Dune::cube, Dune::nonconforming >; };
79 template<
class TypeTag>
81 {
using type = Dune::YaspGrid< dim >; };
84 template<
class TypeTag>
97 template <
class TypeTag>
105 using GridPointer = std::unique_ptr<Grid>;
107 static constexpr
int dim = Grid::dimension;
115 Parameters::Register<Parameters::GridGlobalRefinements>
116 (
"The number of global refinements of the grid " 117 "executed after it was loaded");
118 Parameters::Register<Parameters::DomainSizeX<Scalar>>
119 (
"The size of the domain in x direction");
120 Parameters::Register<Parameters::CellsX>
121 (
"The number of intervalls in x direction");
122 if constexpr (dim > 1) {
123 Parameters::Register<Parameters::DomainSizeY<Scalar>>
124 (
"The size of the domain in y direction");
125 Parameters::Register<Parameters::CellsY>
126 (
"The number of intervalls in y direction");
128 if constexpr (dim > 2) {
129 Parameters::Register<Parameters::DomainSizeZ<Scalar>>
130 (
"The size of the domain in z direction");
131 Parameters::Register<Parameters::CellsZ>
132 (
"The number of intervalls in z direction");
142 Dune::FieldVector<int, dim> cellRes;
144 using GridScalar = double;
145 Dune::FieldVector<GridScalar, dim> upperRight;
146 Dune::FieldVector<GridScalar, dim> lowerLeft( 0 );
148 upperRight[0] = Parameters::Get<Parameters::DomainSizeX<Scalar>>();
149 upperRight[1] = Parameters::Get<Parameters::DomainSizeY<Scalar>>();
151 cellRes[0] = Parameters::Get<Parameters::CellsX>();
152 cellRes[1] = Parameters::Get<Parameters::CellsY>();
153 if constexpr (dim == 3) {
154 upperRight[2] = Parameters::Get<Parameters::DomainSizeZ<Scalar>>();
155 cellRes[2] = Parameters::Get<Parameters::CellsZ>();
158 std::stringstream dgffile;
159 dgffile <<
"DGF" <<
'\n' 160 <<
"INTERVAL" <<
'\n' 162 << upperRight <<
'\n' 165 <<
"GridParameter" <<
'\n' 166 <<
"overlap 1" <<
'\n' 172 gridPtr_.reset(Dune::GridPtr<Grid>(dgffile).release());
174 const int numRefinements = Parameters::Get<Parameters::GridGlobalRefinements>();
175 gridPtr_->globalRefine(numRefinements);
177 this->finalizeInit_();
184 {
return *gridPtr_; }
190 {
return *gridPtr_; }
193 GridPointer gridPtr_;
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:233
This file provides the infrastructure to retrieve run-time parameters.
Grid & grid()
Return a reference to the grid object.
Definition: structuredgridvanguard.hh:183
StructuredGridVanguard(Simulator &simulator)
Create the grid for the lens problem.
Definition: structuredgridvanguard.hh:139
Provides the base class for most (all?) simulator vanguards.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Defines some fundamental parameters for all models.
Definition: structuredgridvanguard.hh:62
The type of the DUNE grid.
Definition: basicproperties.hh:104
Property which provides a Vanguard (manages grids)
Definition: basicproperties.hh:100
The Opm property system, traits with inheritance.
Helper class for grid instantiation of the lens problem.
Definition: structuredgridvanguard.hh:54
Provides the base class for most (all?) simulator vanguards.
Definition: basevanguard.hh:49
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:83
Definition: blackoilmodel.hh:80
Defines a type tags and some fundamental properties all models.
const Grid & grid() const
Return a constant reference to the grid object.
Definition: structuredgridvanguard.hh:189
static void registerParameters()
Register all run-time parameters for the structured grid simulator vanguard.
Definition: structuredgridvanguard.hh:113