27 #ifndef EWOMS_CUBE_GRID_MANAGER_HH
28 #define EWOMS_CUBE_GRID_MANAGER_HH
35 #include <dune/grid/utility/structuredgridfactory.hh>
37 #include <dune/common/fvector.hh>
42 namespace Properties {
64 template <
class TypeTag>
68 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
70 typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
72 typedef Dune::shared_ptr<Grid> GridPointer;
73 typedef typename Grid::ctype CoordScalar;
74 enum { dimWorld = Grid::dimensionworld };
75 typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
84 "The number of global refinements of the grid "
85 "executed after it was loaded");
87 "The size of the domain in x direction");
89 "The number of intervalls in x direction");
92 "The size of the domain in y direction");
94 "The number of intervalls in y direction");
98 "The size of the domain in z direction");
100 "The number of intervalls in z direction");
110 Dune::array<unsigned int, dimWorld> cellRes;
111 GlobalPosition upperRight(0.0);
112 GlobalPosition lowerLeft(0.0);
114 for (
unsigned i = 0; i < dimWorld; ++i)
128 unsigned numRefinements =
EWOMS_GET_PARAM(TypeTag,
unsigned, GridGlobalRefinements);
129 cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
130 cubeGrid_->globalRefine(static_cast<int>(numRefinements));
132 this->finalizeInit_();
139 {
return *cubeGrid_; }
145 {
return *cubeGrid_; }
148 GridPointer cubeGrid_;
Grid & grid()
Returns a reference to the grid.
Definition: cubegridmanager.hh:138
Provides the base class for most (all?) grid managers.
Provides the base class for most (all?) grid managers.
Definition: basegridmanager.hh:58
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description)
Register a run-time parameter.
Definition: parametersystem.hh:68
This file provides the infrastructure to retrieve run-time parameters.
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName)
Retrieve a runtime parameter.
Definition: parametersystem.hh:99
const Grid & grid() const
Returns a reference to the grid.
Definition: cubegridmanager.hh:144
Provides the magic behind the eWoms property system.
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:75
#define NEW_PROP_TAG(PTagName)
Define a property tag.
Definition: propertysystem.hh:247
static void registerParameters()
Register all run-time parameters for the grid manager.
Definition: cubegridmanager.hh:81
Provides a grid manager which a regular grid made of quadrilaterals.
Definition: cubegridmanager.hh:65
Defines a type tags and some fundamental properties all models.
CubeGridManager(Simulator &simulator)
Create the grid.
Definition: cubegridmanager.hh:107