26#ifndef DUMUX_TEST_IO_GMSHBOUNDARYFLAG_TEST_HH
27#define DUMUX_TEST_IO_GMSHBOUNDARYFLAG_TEST_HH
39 using GridView =
typename Grid::LeafGridView;
40 using Scalar = double;
41 static const int dim = Grid::dimension;
43 using ReferenceElements =
typename Dune::ReferenceElements<Scalar, dim>;
47 template<
class Gr
idGeometry>
49 std::shared_ptr<const GridGeometry> gridGeometry,
53 for(
const auto& element : elements(leafGridView))
55 auto fvGeometry =
localView(*gridGeometry);
56 fvGeometry.bind(element);
58 for (
auto&& scvf : scvfs(fvGeometry))
62 const auto boundaryMarkerId = gridData->getBoundaryDomainMarker(scvf.boundaryFlag());
63 const auto& pos = scvf.center();
64 std::cout <<
"z-coordinate: " << pos[dim-1] <<
", actual ID = " << boundaryMarkerId <<
", ";
73 const int bottomId = 0;
76 const bool isTop = pos[dim-1] > 1.0 - eps_;
77 const bool isBottom = pos[dim-1] < eps_;
78 const bool isSide = !isTop && !isBottom;
82 std::cout <<
"correct ID = " << topId <<
" (is top surface)" << std::endl;
83 if (boundaryMarkerId != topId)
84 DUNE_THROW(Dune::Exception,
"BoundaryMarkerId for top is wrong!");
88 std::cout <<
"correct ID = " << bottomId <<
" (is bottom surface)" << std::endl;
89 if (boundaryMarkerId != bottomId)
90 DUNE_THROW(Dune::Exception,
"BoundaryMarkerId for bottom is wrong!");
94 std::cout <<
"correct ID = " << sideId <<
" (is side surface)" << std::endl;
95 if (boundaryMarkerId != sideId)
96 DUNE_THROW(Dune::Exception,
"BoundaryMarkerId for side is wrong!");
104 static constexpr Scalar eps_ = 1e-4;
The available discretization methods in Dumux.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Class for grid data attached to dgf or gmsh grid files.
Definition: griddata.hh:66
The grid manager (this is the class used by the user) for all supported grid managers that constructs...
Definition: gridmanager_base.hh:312
Definition: gmshboundaryflagtest.hh:38
static void testGmshBoundaryFlag(const GridView &leafGridView, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< const GridData< Grid > > gridData)
Definition: gmshboundaryflagtest.hh:48
Convience header that includes all grid manager specializations.