12#ifndef DUMUX_IO_GRID_MANAGER_FOAM_HH 
   13#define DUMUX_IO_GRID_MANAGER_FOAM_HH 
   17#include <dune/foamgrid/foamgrid.hh> 
   18#include <dune/foamgrid/dgffoam.hh> 
   21#ifndef DUMUX_IO_GRID_MANAGER_BASE_HH 
   46template<
int dim, 
int dimworld>
 
   51    using Grid = Dune::FoamGrid<dim, dimworld>;
 
   52    using ParentType = GridManagerBase<Grid>;
 
   57    void init(
const std::string& modelParamGroup = 
"")
 
   63            ParentType::maybeRefineGrid(modelParamGroup);
 
   64            ParentType::loadBalance();
 
   72            ParentType::maybeRefineGrid(modelParamGroup);
 
   73            ParentType::loadBalance();
 
   79            const auto prefix = modelParamGroup.empty() ? modelParamGroup : modelParamGroup + 
".";
 
   80            DUNE_THROW(ParameterException, 
"Please supply one of the parameters " 
   81                                           << prefix + 
"Grid.UpperRight" 
   82                                           << 
", or a grid file in " << prefix + 
"Grid.File");
 
  103template<
int dimworld>
 
  108    using Grid = Dune::FoamGrid<1, dimworld>;
 
  109    using ParentType = GridManagerBase<Grid>;
 
  114    void init(
const std::string& modelParamGroup = 
"")
 
  120            ParentType::maybeRefineGrid(modelParamGroup);
 
  121            ParentType::loadBalance();
 
  126        using GlobalPosition = Dune::FieldVector<typename Grid::ctype, dimworld>;
 
  129        using CellArray = std::array<unsigned int, 1>;
 
  133        Dune::GridFactory<Grid> factory;
 
  135        constexpr auto geomType = Dune::GeometryTypes::line;
 
  138        GlobalPosition step = upperRight;
 
  139        step -= lowerLeft, step /= cells[0];
 
  142        GlobalPosition globalPos = lowerLeft;
 
  143        for (
unsigned int vIdx = 0; vIdx <= cells[0]; vIdx++, globalPos += step)
 
  144            factory.insertVertex(globalPos);
 
  147        for(
unsigned int eIdx = 0; eIdx < cells[0]; eIdx++)
 
  148            factory.insertElement(geomType, {eIdx, eIdx+1});
 
  150        ParentType::gridPtr() = std::shared_ptr<Grid>(factory.createGrid());
 
  151        ParentType::maybeRefineGrid(modelParamGroup);
 
  152        ParentType::loadBalance();
 
  160template<
int dim, 
int dimworld>
 
  164    static bool eval(
const GV&) 
 
The grid manager base interface (public) and methods common to most grid manager specializations (pro...
Definition gridmanager_base.hh:55
Grid Grid
Definition gridmanager_base.hh:57
void makeStructuredGrid(CellType cellType, const std::string &modelParamGroup)
Definition gridmanager_base.hh:278
void init(const std::string &modelParamGroup="")
Definition gridmanager_base.hh:63
The grid manager (this is the class used by the user) for all supported grid managers that constructs...
Definition gridmanager_base.hh:336
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 gridcapabilities.hh:57
Definition gridcapabilities.hh:67
static bool eval(const GV &)
Definition gridcapabilities.hh:69