Implementations of the Dune grid interface
Implementations of the Dune grid interface
Set grid types via properties specialization:
#include <dune/grid/yaspgrid.hh>
...
template<class TypeTag>
struct Grid<TypeTag, TTag::Injection2p>{
using type = Dune::YaspGrid<2>;
};
File:
dumux-course/exercises/exercise-grids/properties.hh
Include the matching grid manager header files in main file and create the grid via a grid manager instance
#include <dumux/io/grid/gridmanager_yasp.hh>
...
using Grid = GetPropType<TypeTag, Properties::Grid>;
GridManager<Grid> gridManager;
gridManager.init();
File:
dumux/test/porousmediumflow/2p/incompressible/main.cc
The grid manager looks for grid information in the runtime parameter tree
Grid from basic parameters
File:
dumux/test/porousmediumflow/2p/incompressible/params.input
Read in grid from file (specified in input-file) using a relative or absolute path to the grid file
File:
dumux/test/io/gridmanager/test_gridmanager_dgf.input
Supported grid file formats
*.grdecl
file, via
opm-grid)Consult the documentation of the grid implementation, e.g.
constructing a Dune::YaspGrid
:
constexpr int dim = 2;
using Yasp = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<
double, dim>>;
std::array<int, dim> cells; cells.fill(30);
Dune::FieldVector<double, dim> lowerLeft(1.1), upperRight(2.2);
Yasp yasp(lowerLeft, upperRight, cells);
File:
dumux/test/geometry/test_intersectingentity_cartesiangrid.cc