4#ifndef DUNE_GRID_IO_FILE_GMSH_GRIDCREATORS_CONTINUOUSGRIDCREATOR_HH
5#define DUNE_GRID_IO_FILE_GMSH_GRIDCREATORS_CONTINUOUSGRIDCREATOR_HH
20namespace Dune::Impl::Gmsh
25 struct ContinuousGridCreator
26 :
public GridCreatorInterface<Grid, ContinuousGridCreator<Grid> >
28 using Super = GridCreatorInterface<Grid, ContinuousGridCreator<Grid> >;
29 using GlobalCoordinate =
typename Super::GlobalCoordinate;
37 template <
class NodeAttributes>
43 vertexShift_ = nodeTagRange.
first;
44 nodes_.resize(numNodes);
46 size_t vertexIndex = 0;
48 for (
auto const& entityBlock : entityBlocks) {
49 for (
auto const& node : entityBlock.nodes) {
52 nodes_[vertexIndex] = p;
53 vertexMap_[node.tag - vertexShift_] = vertexIndex++;
58 template <
class ElementAttributes,
class BoundaryEntities>
62 BoundaryEntities
const& )
68 for (
auto const& entityBlock : entityBlocks) {
72 auto type = gmshNumberToGeometryType(entityBlock.elementType);
76 auto refElem = referenceElement<double,Grid::dimension>(cell.type());
79 for (
auto const& element : entityBlock.elements) {
82 auto index = vertexMap_[element.nodes[j] - vertexShift_];
85 factory().insertVertex(nodes_.at(
index));
88 connectivity[cell.gmshVertexToDuneVertex(j)] =
vertex;
91 factory().insertElement(cell.type(), connectivity);
107 template <
class Gr
id>
108 ContinuousGridCreator(GridFactory<Grid>&)
109 -> ContinuousGridCreator<Grid>;
std::ptrdiff_t index() const
Macro for wrapping error checks and throwing exceptions.
#define GMSH4_ASSERT(cond)
check if condition cond holds; otherwise, throw a Gmsh4Error.
Definition errors.hh:34
@ vertex
Definition common.hh:133
static constexpr int dimension
The dimension of the grid.
Definition common/grid.hh:405
Provide a generic factory class for unstructured grids.