3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Loading...
Searching...
No Matches
Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > > Class Template Reference

Provides a grid manager for YaspGrids from information in the input file. More...

#include <dumux/io/grid/gridmanager_yasp.hh>

Inheritance diagram for Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >:

Description

template<class Coordinates, int dim>
class Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >

Provides a grid manager for YaspGrids from information in the input file.

All keys are expected to be in group GridParameterGroup. The following keys are recognized:

  • File : a DGF file to load the coarse grid from
  • LowerLeft : lower left corner of the domain (only for EquidistantOffsetCoordinates, otherwise 0-origin)
  • UpperRight : upper right corner of the domain
  • Cells : the number of cells in each direction
  • Periodic : true or false for each direction
  • Overlap : overlap size in cells
  • Partitioning : a non-standard load-balancing, number of processors per direction
  • KeepPyhsicalOverlap : whether to keep the physical overlap in physical size or in number of cells upon refinement
  • Refinement : the number of global refines to apply initially.

Public Types

using Grid = typename Dune::YaspGrid<dim, Coordinates>
using ParentType = GridManagerBase<Grid>
using Grid
using GridData

Public Member Functions

void init (const std::string &modelParamGroup="")
 Make the grid. This is implemented by specializations of this method.
void init (const GlobalPosition &upperRight, const std::array< int, dim > &cells, const std::string &modelParamGroup="", const int overlap=1, const std::bitset< dim > periodic=std::bitset< dim >{})
 Make the grid using input data not read from the input file.
void init (const GlobalPosition &lowerLeft, const GlobalPosition &upperRight, const std::array< int, dim > &cells, const std::string &modelParamGroup="", const int overlap=1, const std::bitset< dim > periodic=std::bitset< dim >{})
 Make the grid using input data not read from the input file.
void init (const std::string &modelParamGroup="")
 Make the grid. Implement this method in the specialization of this class for a grid type.
Dune::YaspGrid< dim, Coordinates > & grid ()
 Returns a reference to the grid.
void loadBalance ()
 Call loadBalance() function of the grid.
std::shared_ptr< GridDatagetGridData () const
 Get an owning pointer to grid data associated with the grid.
bool hasGridData () const
 Check whether there is data associated with the grid.

Protected Types

enum  CellType
 The cell types for structured grids. More...

Protected Member Functions

std::shared_ptr< Dune::YaspGrid< dim, Coordinates > > & gridPtr ()
 Returns a reference to the grid pointer (std::shared_ptr<Grid>).
Dune::GridPtr< Dune::YaspGrid< dim, Coordinates > > & dgfGridPtr ()
 Returns a reference to the DGF grid pointer (Dune::GridPtr<Grid>).
std::string getFileExtension (const std::string &fileName) const
 Returns the filename extension of a given filename.
void makeGridFromFile (const std::string &fileName, const std::string &modelParamGroup)
 Makes a grid from a file. We currently support.
void makeGridFromDgfFile (const std::string &fileName)
 Makes a grid from a DGF file. This is used by grid managers that only support DGF.
void makeStructuredGrid (CellType cellType, const std::string &modelParamGroup)
 Makes a structured cube grid using the structured grid factory.
void maybeRefineGrid (const std::string &modelParamGroup)
 Refines a grid after construction if GridParameterGroup.Refinement is set in the input file.
void makeStructuredGrid (CellType cellType, const std::string &modelParamGroup)
 Makes a structured cube grid using the structured grid factory.

Protected Attributes

bool enableDgfGridPointer_
 A state variable if the DGF Dune::GridPtr has been enabled. It is always enabled if a DGF grid file was used to create the grid.
bool enableGmshDomainMarkers_
 A state variable if domain markers have been read from a Gmsh file.
std::shared_ptr< Dune::YaspGrid< dim, Coordinates > > gridPtr_
Dune::GridPtr< Dune::YaspGrid< dim, Coordinates > > dgfGridPtr_
std::shared_ptr< GridDatagridData_

Member Typedef Documentation

◆ Grid [1/2]

using Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::Dune::YaspGrid< dim, Coordinates >

◆ Grid [2/2]

template<class Coordinates, int dim>
using Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >::Grid = typename Dune::YaspGrid<dim, Coordinates>

◆ GridData

using Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::GridData

◆ ParentType

template<class Coordinates, int dim>
using Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >::ParentType = GridManagerBase<Grid>

Member Enumeration Documentation

◆ CellType

The cell types for structured grids.

Member Function Documentation

◆ dgfGridPtr()

Dune::GridPtr< Dune::YaspGrid< dim, Coordinates > > & Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::dgfGridPtr ( )
inlineprotected

Returns a reference to the DGF grid pointer (Dune::GridPtr<Grid>).

◆ getFileExtension()

std::string Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::getFileExtension ( const std::string & fileName) const
inlineprotected

Returns the filename extension of a given filename.

◆ getGridData()

std::shared_ptr< GridData > Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::getGridData ( ) const
inline

Get an owning pointer to grid data associated with the grid.

Note
Throws if no grid data is available

◆ grid()

Dune::YaspGrid< dim, Coordinates > & Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::grid ( )
inline

Returns a reference to the grid.

◆ gridPtr()

std::shared_ptr< Dune::YaspGrid< dim, Coordinates > > & Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::gridPtr ( )
inlineprotected

Returns a reference to the grid pointer (std::shared_ptr<Grid>).

◆ hasGridData()

bool Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::hasGridData ( ) const
inline

Check whether there is data associated with the grid.

◆ init() [1/4]

template<class Coordinates, int dim>
void Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >::init ( const GlobalPosition & lowerLeft,
const GlobalPosition & upperRight,
const std::array< int, dim > & cells,
const std::string & modelParamGroup = "",
const int overlap = 1,
const std::bitset< dim > periodic = std::bitset<dim>{} )
inline

Make the grid using input data not read from the input file.

Note
Use this function for EquidistantOffsetCoordinates.

◆ init() [2/4]

template<class Coordinates, int dim>
void Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >::init ( const GlobalPosition & upperRight,
const std::array< int, dim > & cells,
const std::string & modelParamGroup = "",
const int overlap = 1,
const std::bitset< dim > periodic = std::bitset<dim>{} )
inline

Make the grid using input data not read from the input file.

Note
Use this function for EquidistantCoordinates where lowerLeft is always zero.

◆ init() [3/4]

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::init ( const std::string & modelParamGroup = "")
inline

Make the grid. Implement this method in the specialization of this class for a grid type.

◆ init() [4/4]

template<class Coordinates, int dim>
void Dumux::GridManager< Dune::YaspGrid< dim, Coordinates > >::init ( const std::string & modelParamGroup = "")
inline

Make the grid. This is implemented by specializations of this method.

◆ loadBalance()

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::loadBalance ( )
inline

Call loadBalance() function of the grid.

◆ makeGridFromDgfFile()

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::makeGridFromDgfFile ( const std::string & fileName)
inlineprotected

Makes a grid from a DGF file. This is used by grid managers that only support DGF.

◆ makeGridFromFile()

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::makeGridFromFile ( const std::string & fileName,
const std::string & modelParamGroup )
inlineprotected

Makes a grid from a file. We currently support.

  • dgf (Dune Grid Format)
  • msh (Gmsh mesh format)
  • vtp/vtu (VTK file formats)

◆ makeStructuredGrid() [1/2]

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::makeStructuredGrid ( CellType cellType,
const std::string & modelParamGroup )
inlineprotected

Makes a structured cube grid using the structured grid factory.

◆ makeStructuredGrid() [2/2]

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::makeStructuredGrid ( CellType cellType,
const std::string & modelParamGroup )
inlineprotectedinherited

Makes a structured cube grid using the structured grid factory.

◆ maybeRefineGrid()

void Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::maybeRefineGrid ( const std::string & modelParamGroup)
inlineprotected

Refines a grid after construction if GridParameterGroup.Refinement is set in the input file.

Member Data Documentation

◆ dgfGridPtr_

Dune::GridPtr<Dune::YaspGrid< dim, Coordinates >> Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::dgfGridPtr_
protected

◆ enableDgfGridPointer_

bool Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::enableDgfGridPointer_
protected

A state variable if the DGF Dune::GridPtr has been enabled. It is always enabled if a DGF grid file was used to create the grid.

◆ enableGmshDomainMarkers_

bool Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::enableGmshDomainMarkers_
protected

A state variable if domain markers have been read from a Gmsh file.

◆ gridData_

std::shared_ptr<GridData> Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::gridData_
protected

◆ gridPtr_

std::shared_ptr<Dune::YaspGrid< dim, Coordinates >> Dumux::GridManagerBase< Dune::YaspGrid< dim, Coordinates > >::gridPtr_
protected

The documentation for this class was generated from the following file: