12#ifndef DUMUX_IO_GRID_MANAGER_SP_HH 
   13#define DUMUX_IO_GRID_MANAGER_SP_HH 
   17#include <dune/grid/spgrid.hh> 
   18#include <dune/grid/spgrid/dgfparser.hh> 
   21#ifndef DUMUX_IO_GRID_MANAGER_BASE_HH 
   37template<
class ct, 
int dim, 
template< 
int > 
class Ref, 
class Comm>
 
   42    using Grid = Dune::SPGrid<ct, dim, Ref, Comm>;
 
   43    using ParentType = GridManagerBase<Grid>;
 
   48    void init(
const std::string& paramGroup = 
"")
 
   52            DUNE_THROW(Dune::NotImplemented, 
"dune-spgrid does currently not support zero overlap!");
 
   58            ParentType::maybeRefineGrid(paramGroup);
 
   59            ParentType::loadBalance();
 
   65            using GlobalPosition = Dune::FieldVector<ct, dim>;
 
   69            using IntArray = std::array<int, dim>;
 
   70            IntArray cells; cells.fill(1);
 
   74            init(lowerLeft, upperRight, cells, paramGroup, overlap, periodic);
 
   78            const auto prefix = paramGroup.empty() ? paramGroup : paramGroup + 
".";
 
   79            DUNE_THROW(ParameterException, 
"Please supply a grid file in " << prefix << 
"Grid.File or " << prefix << 
"Grid.UpperRight/Cells.");
 
   83    void init(
const Dune::FieldVector<ct, dim>& lowerLeft,
 
   84              const Dune::FieldVector<ct, dim>& upperRight,
 
   85              const std::array<int, dim>& cells,
 
   86              const std::string& paramGroup = 
"",
 
   87              const int overlap = 1,
 
   88              const std::bitset<dim> periodic = std::bitset<dim>{})
 
   91            DUNE_THROW(Dune::NotImplemented, 
"dune-spgrid does currently not support zero overlap!");
 
   92        using IntArray = std::array<int, dim>;
 
   93        IntArray spOverlap; spOverlap.fill(overlap);
 
   94        using Domain = 
typename Grid::Domain;
 
   95        std::vector< typename Domain::Cube > cubes;
 
   96        cubes.push_back( 
typename Domain::Cube( lowerLeft, upperRight ) );
 
   97        Domain domain( cubes, 
typename Domain::Topology( 
static_cast<unsigned int>(periodic.to_ulong()) ) );
 
   98        ParentType::gridPtr() = std::make_shared<Grid>( domain, cells, spOverlap );
 
   99        ParentType::maybeRefineGrid(paramGroup);
 
  100        ParentType::loadBalance();
 
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 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
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