27#ifndef EWOMS_STRUCTURED_GRID_VANGUARD_HH
28#define EWOMS_STRUCTURED_GRID_VANGUARD_HH
37#include <dune/grid/yaspgrid.hh>
38#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
41#include <dune/alugrid/grid.hh>
42#include <dune/alugrid/dgf.hh>
45#include <dune/common/fvector.hh>
46#include <dune/common/version.hh>
52template <
class TypeTag>
53class StructuredGridVanguard;
57namespace Opm::Properties {
67static const int dim = 2;
69static const int dim = GRIDDIM;
74template<
class TypeTag>
75struct Grid<TypeTag, TTag::
StructuredGridVanguard> {
using type = Dune::ALUGrid< dim, dim, Dune::cube, Dune::nonconforming >; };
77template<
class TypeTag>
81template<
class TypeTag>
93template <
class TypeTag>
101 using GridPointer = std::unique_ptr<Grid>;
103 static constexpr int dim = Grid::dimension;
111 Parameters::Register<Parameters::GridGlobalRefinements>
112 (
"The number of global refinements of the grid "
113 "executed after it was loaded");
114 Parameters::Register<Parameters::DomainSizeX<Scalar>>
115 (
"The size of the domain in x direction");
116 Parameters::Register<Parameters::CellsX>
117 (
"The number of intervalls in x direction");
119 Parameters::Register<Parameters::DomainSizeY<Scalar>>
120 (
"The size of the domain in y direction");
121 Parameters::Register<Parameters::CellsY>
122 (
"The number of intervalls in y direction");
124 if constexpr (dim > 2) {
125 Parameters::Register<Parameters::DomainSizeZ<Scalar>>
126 (
"The size of the domain in z direction");
127 Parameters::Register<Parameters::CellsZ>
128 (
"The number of intervalls in z direction");
138 Dune::FieldVector<int, dim> cellRes;
140 using GridScalar = double;
141 Dune::FieldVector<GridScalar, dim> upperRight;
142 Dune::FieldVector<GridScalar, dim> lowerLeft( 0 );
144 upperRight[0] = Parameters::Get<Parameters::DomainSizeX<Scalar>>();
145 upperRight[1] = Parameters::Get<Parameters::DomainSizeY<Scalar>>();
147 cellRes[0] = Parameters::Get<Parameters::CellsX>();
148 cellRes[1] = Parameters::Get<Parameters::CellsY>();
149 if constexpr (dim == 3) {
150 upperRight[2] = Parameters::Get<Parameters::DomainSizeZ<Scalar>>();
151 cellRes[2] = Parameters::Get<Parameters::CellsZ>();
154 std::stringstream dgffile;
155 dgffile <<
"DGF" << std::endl;
156 dgffile <<
"INTERVAL" << std::endl;
157 dgffile << lowerLeft << std::endl;
158 dgffile << upperRight << std::endl;
159 dgffile << cellRes << std::endl;
160 dgffile <<
"#" << std::endl;
161 dgffile <<
"GridParameter" << std::endl;
162 dgffile <<
"overlap 1" << std::endl;
163 dgffile <<
"#" << std::endl;
164 dgffile <<
"Simplex" << std::endl;
165 dgffile <<
"#" << std::endl;
168 gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
170 unsigned numRefinements = Parameters::Get<Parameters::GridGlobalRefinements>();
171 gridPtr_->globalRefine(
static_cast<int>(numRefinements));
173 this->finalizeInit_();
180 {
return *gridPtr_; }
186 {
return *gridPtr_; }
189 GridPointer gridPtr_;
Provides the base class for most (all?) simulator vanguards.
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
Helper class for grid instantiation of the lens problem.
Definition structuredgridvanguard.hh:95
StructuredGridVanguard(Simulator &simulator)
Create the grid for the lens problem.
Definition structuredgridvanguard.hh:135
static void registerParameters()
Register all run-time parameters for the structured grid simulator vanguard.
Definition structuredgridvanguard.hh:109
const Grid & grid() const
Return a constant reference to the grid object.
Definition structuredgridvanguard.hh:185
Grid & grid()
Return a reference to the grid object.
Definition structuredgridvanguard.hh:179
This file contains a set of helper functions used by VFPProd / VFPInj.
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.
The type of the DUNE grid.
Definition basicproperties.hh:100
Definition structuredgridvanguard.hh:61
Property which provides a Vanguard (manages grids)
Definition basicproperties.hh:96