13#ifndef DUMUX_IO_GRID_MANAGER_FOAM_HH
14#define DUMUX_IO_GRID_MANAGER_FOAM_HH
18#include <dune/foamgrid/foamgrid.hh>
19#include <dune/foamgrid/dgffoam.hh>
22#ifndef DUMUX_IO_GRID_MANAGER_BASE_HH
51template<
int dim,
int dimworld>
56 using Grid = Dune::FoamGrid<dim, dimworld>;
62 void init(
const std::string& modelParamGroup =
"")
84 const auto prefix = modelParamGroup.empty() ? modelParamGroup : modelParamGroup +
".";
86 << prefix +
"Grid.UpperRight"
87 <<
", or a grid file in " << prefix +
"Grid.File");
112template<
int dimworld>
117 using Grid = Dune::FoamGrid<1, dimworld>;
123 void init(
const std::string& modelParamGroup =
"")
135 using GlobalPosition = Dune::FieldVector<typename Grid::ctype, dimworld>;
138 using CellArray = std::array<unsigned int, 1>;
142 Dune::GridFactory<Grid> factory;
144 constexpr auto geomType = Dune::GeometryTypes::line;
147 GlobalPosition step = upperRight;
148 step -= lowerLeft, step /= cells[0];
151 GlobalPosition globalPos = lowerLeft;
152 for (
unsigned int vIdx = 0; vIdx <= cells[0]; vIdx++, globalPos += step)
153 factory.insertVertex(globalPos);
156 for(
unsigned int eIdx = 0; eIdx < cells[0]; eIdx++)
157 factory.insertElement(geomType, {eIdx, eIdx+1});
165namespace Grid::Capabilities {
169template<
int dim,
int dimworld>
void init(const std::string &modelParamGroup="")
Make the grid. This is implemented by specializations of this method.
Definition gridmanager_foam.hh:123
GridManagerBase< Grid > ParentType
Definition gridmanager_foam.hh:118
Dune::FoamGrid< 1, dimworld > Grid
Definition gridmanager_foam.hh:117
Dune::FoamGrid< dim, dimworld > Grid
Definition gridmanager_foam.hh:56
GridManagerBase< Grid > ParentType
Definition gridmanager_foam.hh:57
void init(const std::string &modelParamGroup="")
Make the grid. This is implemented by specializations of this method.
Definition gridmanager_foam.hh:62
The grid manager base interface (public) and methods common to most grid manager specializations (pro...
Definition gridmanager_base.hh:56
void maybeRefineGrid(const std::string &modelParamGroup)
Definition gridmanager_base.hh:315
void makeGridFromFile(const std::string &fileName, const std::string &modelParamGroup)
Definition gridmanager_base.hh:205
void makeStructuredGrid(CellType cellType, const std::string &modelParamGroup)
Definition gridmanager_base.hh:286
void loadBalance()
Definition gridmanager_base.hh:98
@ Simplex
Definition gridmanager_base.hh:280
std::shared_ptr< Grid > & gridPtr()
Definition gridmanager_base.hh:163
The grid manager (this is the class used by the user) for all supported grid managers that constructs...
Definition gridmanager_base.hh:344
Exception thrown if a run-time parameter is not specified correctly.
Definition exceptions.hh:48
dune-grid capabilities compatibility layer
Provides a grid manager for all supported grid managers with input file interfaces....
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:149
bool hasParamInGroup(const std::string ¶mGroup, const std::string ¶m)
Check whether a key exists in the parameter tree with a model group prefix.
Definition parameters.hh:165
Definition common/pdesolver.hh:24
static bool eval(const GV &)
Definition gridmanager_foam.hh:173
Definition gridcapabilities.hh:27