27#ifndef EWOMS_SIMPLEX_GRID_VANGUARD_HH
28#define EWOMS_SIMPLEX_GRID_VANGUARD_HH
30#include <dune/common/fvector.hh>
32#include <dune/grid/utility/structuredgridfactory.hh>
48template <
class TypeTag>
56 using GridPointer = std::unique_ptr<Grid>;
57 using CoordScalar =
typename Grid::ctype;
59 dim = Grid::dimension,
60 dimWorld = Grid::dimensionworld,
62 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
70 Parameters::Register<Parameters::GridGlobalRefinements>
71 (
"The number of global refinements of the grid "
72 "executed after it was loaded");
73 Parameters::Register<Parameters::DomainSizeX<Scalar>>
74 (
"The size of the domain in x direction");
75 Parameters::Register<Parameters::CellsX>
76 (
"The number of intervalls in x direction");
78 Parameters::Register<Parameters::DomainSizeY<Scalar>>
79 (
"The size of the domain in y direction");
80 Parameters::Register<Parameters::CellsY>
81 (
"The number of intervalls in y direction");
83 if constexpr (dim > 2) {
84 Parameters::Register<Parameters::DomainSizeZ<Scalar>>
85 (
"The size of the domain in z direction");
86 Parameters::Register<Parameters::CellsZ>
87 (
"The number of intervalls in z direction");
97 std::array<unsigned, dim> cellRes{};
98 GlobalPosition upperRight;
99 GlobalPosition lowerLeft;
102 upperRight[0] = Parameters::Get<Parameters::DomainSizeX<Scalar>>();
103 cellRes[0] = Parameters::Get<Parameters::CellsX>();
104 if constexpr (dim > 1) {
106 upperRight[1] = Parameters::Get<Parameters::DomainSizeY<Scalar>>();
107 cellRes[1] = Parameters::Get<Parameters::CellsY>();
109 if constexpr (dim > 2) {
111 upperRight[2] = Parameters::Get<Parameters::DomainSizeZ<Scalar>>();
112 cellRes[2] = Parameters::Get<Parameters::CellsZ>();
115 simplexGrid_ = Dune::StructuredGridFactory<Grid>::createSimplexGrid(lowerLeft,
119 const unsigned numRefinments = Parameters::Get<Parameters::GridGlobalRefinements>();
120 simplexGrid_->globalRefine(numRefinments);
122 this->finalizeInit_();
129 {
return simplexGrid_; }
135 {
return *simplexGrid_; }
138 GridPointer simplexGrid_;
Defines a type tags and some fundamental properties all models.
Provides the base class for most (all?) simulator vanguards.
Definition: basevanguard.hh:50
Provides a simulator vanguard which a creates regular grid made of simplices.
Definition: simplexvanguard.hh:50
static void registerParameters()
Register all run-time parameters for the grid manager.
Definition: simplexvanguard.hh:68
SimplexGridVanguard(Simulator &simulator)
Create the Grid.
Definition: simplexvanguard.hh:94
const Grid & grid() const
Returns a reference to the grid.
Definition: simplexvanguard.hh:134
Grid & grid()
Returns a reference to the grid.
Definition: simplexvanguard.hh:128
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.