27#ifndef EWOMS_STRUCTURED_GRID_VANGUARD_HH
28#define EWOMS_STRUCTURED_GRID_VANGUARD_HH
34#include <dune/grid/yaspgrid.hh>
35#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
38#include <dune/alugrid/grid.hh>
39#include <dune/alugrid/dgf.hh>
42#include <dune/common/fvector.hh>
43#include <dune/common/version.hh>
50template <
class TypeTag>
51class StructuredGridVanguard;
65static const int dim = 2;
67static const int dim = GRIDDIM;
72template<
class TypeTag>
75template<
class TypeTag>
79template<
class TypeTag>
91template <
class TypeTag>
99 using GridPointer = std::unique_ptr<Grid>;
101 static const int dim = Grid::dimension;
109 Parameters::registerParam<TypeTag, Properties::GridGlobalRefinements>
110 (
"The number of global refinements of the grid "
111 "executed after it was loaded");
112 Parameters::registerParam<TypeTag, Properties::DomainSizeX>
113 (
"The size of the domain in x direction");
114 Parameters::registerParam<TypeTag, Properties::CellsX>
115 (
"The number of intervalls in x direction");
117 Parameters::registerParam<TypeTag, Properties::DomainSizeY>
118 (
"The size of the domain in y direction");
119 Parameters::registerParam<TypeTag, Properties::CellsY>
120 (
"The number of intervalls in y direction");
123 Parameters::registerParam<TypeTag, Properties::DomainSizeZ>
124 (
"The size of the domain in z direction");
125 Parameters::registerParam<TypeTag, Properties::CellsZ>
126 (
"The number of intervalls in z direction");
136 Dune::FieldVector<int, dim> cellRes;
138 using GridScalar = double;
139 Dune::FieldVector<GridScalar, dim> upperRight;
140 Dune::FieldVector<GridScalar, dim> lowerLeft( 0 );
142 upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
143 upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
145 cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
146 cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
148 upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
149 cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
152 std::stringstream dgffile;
153 dgffile <<
"DGF" << std::endl;
154 dgffile <<
"INTERVAL" << std::endl;
155 dgffile << lowerLeft << std::endl;
156 dgffile << upperRight << std::endl;
157 dgffile << cellRes << std::endl;
158 dgffile <<
"#" << std::endl;
159 dgffile <<
"GridParameter" << std::endl;
160 dgffile <<
"overlap 1" << std::endl;
161 dgffile <<
"#" << std::endl;
162 dgffile <<
"Simplex" << std::endl;
163 dgffile <<
"#" << std::endl;
166 gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
168 unsigned numRefinements = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
169 gridPtr_->globalRefine(
static_cast<int>(numRefinements));
178 {
return *gridPtr_; }
184 {
return *gridPtr_; }
187 GridPointer gridPtr_;
Provides the base class for most (all?) simulator vanguards.
Definition: basevanguard.hh:49
void finalizeInit_()
Definition: basevanguard.hh:115
Helper class for grid instantiation of the lens problem.
Definition: structuredgridvanguard.hh:93
StructuredGridVanguard(Simulator &simulator)
Create the grid for the lens problem.
Definition: structuredgridvanguard.hh:133
static void registerParameters()
Register all run-time parameters for the structured grid simulator vanguard.
Definition: structuredgridvanguard.hh:107
const Grid & grid() const
Return a constant reference to the grid object.
Definition: structuredgridvanguard.hh:183
Grid & grid()
Return a reference to the grid object.
Definition: structuredgridvanguard.hh:177
Definition: blackoilmodel.hh:72
static const int dim
Definition: structuredgridvanguard.hh:65
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.
Dune::YaspGrid< dim > type
Definition: structuredgridvanguard.hh:76
The type of the DUNE grid.
Definition: basicproperties.hh:93
UndefinedProperty type
Definition: basicproperties.hh:93
Definition: structuredgridvanguard.hh:59
Property which provides a Vanguard (manages grids)
Definition: basicproperties.hh:89