27 #ifndef EWOMS_STRUCTURED_GRID_MANAGER_HH
28 #define EWOMS_STRUCTURED_GRID_MANAGER_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>
50 template <
class TypeTag>
53 namespace Properties {
72 static const int dim = 2;
74 static const int dim = GRIDDIM;
92 template <
class TypeTag>
96 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
98 typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
100 typedef std::unique_ptr<Grid> GridPointer;
102 static const
int dim = Grid::dimension;
111 "The number of global refinements of the grid "
112 "executed after it was loaded");
114 "The size of the domain in x direction");
116 "The number of intervalls in x direction");
119 "The size of the domain in y direction");
121 "The number of intervalls in y direction");
125 "The size of the domain in z direction");
127 "The number of intervalls in z direction");
137 Dune::FieldVector<int, dim> cellRes;
139 typedef double GridScalar;
140 Dune::FieldVector<GridScalar, dim> upperRight;
141 Dune::FieldVector<GridScalar, dim> lowerLeft( 0 );
153 std::stringstream dgffile;
154 dgffile <<
"DGF" << std::endl;
155 dgffile <<
"INTERVAL" << std::endl;
156 dgffile << lowerLeft << std::endl;
157 dgffile << upperRight << std::endl;
158 dgffile << cellRes << std::endl;
159 dgffile <<
"#" << std::endl;
160 dgffile <<
"GridParameter" << std::endl;
161 dgffile <<
"overlap 1" << std::endl;
162 dgffile <<
"#" << std::endl;
163 dgffile <<
"Simplex" << std::endl;
164 dgffile <<
"#" << std::endl;
167 gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
169 unsigned numRefinements =
EWOMS_GET_PARAM(TypeTag,
unsigned, GridGlobalRefinements);
170 gridPtr_->globalRefine(static_cast<int>(numRefinements));
172 this->finalizeInit_();
179 {
return *gridPtr_; }
185 {
return *gridPtr_; }
188 GridPointer gridPtr_;
Provides the base class for most (all?) grid managers.
Grid & grid()
Return a reference to the grid object.
Definition: structuredgridmanager.hh:178
Helper class for grid instantiation of the lens problem.
Definition: structuredgridmanager.hh:51
#define NEW_TYPE_TAG(...)
Define a new type tag.
Definition: propertysystem.hh:169
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
static void registerParameters()
Register all run-time parameters for the grid manager.
Definition: structuredgridmanager.hh:108
StructuredGridManager(Simulator &simulator)
Create the grid for the lens problem.
Definition: structuredgridmanager.hh:134
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
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
const Grid & grid() const
Return a constant reference to the grid object.
Definition: structuredgridmanager.hh:184