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>
53template <
class TypeTag>
54class StructuredGridVanguard;
68static constexpr int dim = 2;
70static constexpr int dim = GRIDDIM;
75template<
class TypeTag>
77{
using type = Dune::ALUGrid< dim, dim, Dune::cube, Dune::nonconforming >; };
79template<
class TypeTag>
81{
using type = Dune::YaspGrid< dim >; };
84template<
class TypeTag>
97template <
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);
184 {
return *gridPtr_; }
190 {
return *gridPtr_; }
193 GridPointer gridPtr_;
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:50
void finalizeInit_()
Definition: basevanguard.hh:127
Helper class for grid instantiation of the lens problem.
Definition: structuredgridvanguard.hh:99
StructuredGridVanguard(Simulator &simulator)
Create the grid for the lens problem.
Definition: structuredgridvanguard.hh:139
static void registerParameters()
Register all run-time parameters for the structured grid simulator vanguard.
Definition: structuredgridvanguard.hh:113
const Grid & grid() const
Return a constant reference to the grid object.
Definition: structuredgridvanguard.hh:189
Grid & grid()
Return a reference to the grid object.
Definition: structuredgridvanguard.hh:183
Definition: blackoilmodel.hh:79
static constexpr int dim
Definition: structuredgridvanguard.hh:68
Definition: blackoilboundaryratevector.hh:39
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.
The Opm property system, traits with inheritance.
Dune::YaspGrid< dim > type
Definition: structuredgridvanguard.hh:81
The type of the DUNE grid.
Definition: basicproperties.hh:100
UndefinedProperty type
Definition: basicproperties.hh:100
Definition: structuredgridvanguard.hh:62
Property which provides a Vanguard (manages grids)
Definition: basicproperties.hh:96