4#ifndef DUNE_GRID_IO_FILE_GMSH_GRIDCREATORINTERFACE_HH
5#define DUNE_GRID_IO_FILE_GMSH_GRIDCREATORINTERFACE_HH
14namespace Dune::Impl::Gmsh
23 template <
class G,
class Derived>
24 class GridCreatorInterface
28 using GlobalCoordinate =
typename Grid::template Codim<0>::Entity::Geometry::GlobalCoordinate;
32 GridCreatorInterface (GridFactory<Grid>& factory)
37 template <
class NodeAttributes>
38 void insertVertices (std::size_t numNodes,
39 std::pair<std::size_t,std::size_t> nodeTagRange,
40 std::vector<NodeAttributes>
const& entityBlocks)
42 asDerived().insertVerticesImpl(numNodes, nodeTagRange, entityBlocks);
46 template <
class ElementAttributes,
class BoundaryEntities>
47 void insertElements (std::size_t numElements,
48 std::pair<std::size_t,std::size_t> elementTagRange,
49 std::vector<ElementAttributes>
const& entityBlocks,
50 BoundaryEntities
const& boundaryEntities)
52 asDerived().insertElementsImpl(numElements, elementTagRange, entityBlocks, boundaryEntities);
56 void insertPieces (std::vector<std::string>
const& pieces)
58 asDerived().insertPiecesImpl(pieces);
62 GridFactory<Grid>& factory ()
68 GridFactory<Grid>
const& factory ()
const
76 return MPIHelper::getCommunication();
83 return static_cast<Derived&
>(*this);
86 const Derived& asDerived ()
const
88 return static_cast<const Derived&
>(*this);
93 template <
class NodeAttributes>
94 void insertVerticesImpl (std::size_t numNodes,
95 std::pair<std::size_t,std::size_t> nodeTagRange,
96 std::vector<NodeAttributes>
const& entityBlocks)
101 template <
class ElementAttributes,
class BoundaryEntities>
102 void insertElementsImpl (std::size_t numElements,
103 std::pair<std::size_t,std::size_t> elementTagRange,
104 std::vector<ElementAttributes>
const& entityBlocks,
105 BoundaryEntities
const& boundaryEntities)
110 void insertPiecesImpl (std::vector<std::string>
const&)
116 GridFactory<Grid>* factory_;
Provide a generic factory class for unstructured grids.