24#ifndef DUMUX_IO_GRID_MANAGER_SP_HH
25#define DUMUX_IO_GRID_MANAGER_SP_HH
29#include <dune/grid/spgrid.hh>
30#include <dune/grid/spgrid/dgfparser.hh>
33#ifndef DUMUX_IO_GRID_MANAGER_BASE_HH
49template<
class ct,
int dim,
template<
int >
class Ref,
class Comm>
54 using Grid = Dune::SPGrid<ct, dim, Ref, Comm>;
55 using ParentType = GridManagerBase<Grid>;
60 void init(
const std::string& paramGroup =
"")
64 DUNE_THROW(Dune::NotImplemented,
"dune-spgrid does currently not support zero overlap!");
70 ParentType::maybeRefineGrid(paramGroup);
71 ParentType::loadBalance();
77 using GlobalPosition = Dune::FieldVector<ct, dim>;
81 using IntArray = std::array<int, dim>;
82 IntArray cells; cells.fill(1);
86 IntArray spOverlap; spOverlap.fill(overlap);
88 using Domain =
typename Grid::Domain;
89 std::vector< typename Domain::Cube > cubes;
90 cubes.push_back(
typename Domain::Cube( lowerLeft, upperRight ) );
91 Domain domain( cubes,
typename Domain::Topology(
static_cast<unsigned int>(periodic.to_ulong()) ) );
92 ParentType::gridPtr() = std::make_shared<Grid>( domain, cells, spOverlap );
93 ParentType::maybeRefineGrid(paramGroup);
94 ParentType::loadBalance();
98 const auto prefix = paramGroup.empty() ? paramGroup : paramGroup +
".";
99 DUNE_THROW(ParameterException,
"Please supply a grid file in " << prefix <<
"Grid.File or " << prefix <<
"Grid.UpperRight/Cells.");
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:375
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:391
The grid manager (this is the class used by the user) for all supported grid managers that constructs...
Definition gridmanager_base.hh:320
The grid manager base interface (public) and methods common to most grid manager specializations (pro...
Definition gridmanager_base.hh:73
Grid Grid
Definition gridmanager_base.hh:75
void init(const std::string &modelParamGroup="")
Definition gridmanager_base.hh:81