4#ifndef DUNE_GRID_IO_FILE_GMSH_GMSH4READER_HH
5#define DUNE_GRID_IO_FILE_GMSH_GMSH4READER_HH
17namespace Dune::Impl::Gmsh
33 template <
class Gr
id,
class Gr
idCreator = ContinuousGr
idCreator<Gr
id>,
class SizeType = std::
size_t>
35 :
public FileReader<Grid, Gmsh4Reader<Grid, GridCreator> >
39 NO_SECTION = 0, MESH_FORMAT, PHYSICAL_NAMES, ENTITIES, PARTITIONED_ENTITIES, NODES, ELEMENTS, PERIODIC,
40 GHOST_ELEMENTS, PARAMETRIZATION, NODE_DATA, ELEMENT_DATA, ELEMENT_NODE_DATA, INTERPOLATION_SCHEME
43 using Entity =
typename Grid::template Codim<0>::Entity;
44 using GlobalCoordinate =
typename Entity::Geometry::GlobalCoordinate;
47 using size_type = SizeType;
50 template <
class ... Args,
52 explicit Gmsh4Reader (Args&&... args)
57 explicit Gmsh4Reader (GridCreator& creator)
72 void read (
std::string const& filename,
bool fillCreator =
true);
83 void readSerialFileFromStream (
std::ifstream& input,
bool fillCreator =
true);
91 void readParallelFileFromStream (
std::ifstream& input,
int rank,
int size,
bool fillCreator =
true);
95 void fillGridCreator (
bool insertPieces =
true);
107 static void fillFactoryImpl (GridFactory<Grid>& factory,
std::string const& filename)
109 Gmsh4Reader reader{factory};
110 reader.read(filename);
118 double& version,
int& file_type,
int& data_size);
141 Sections parent = Sections::NO_SECTION)
const
143 bool result =
line.substr(1, key.
length()) == key;
144 if (result && current != parent)
160 physicalNames_.clear();
168 ghostEntities_.clear();
169 partitionedPoints_.clear();
170 partitionedCurves_.clear();
171 partitionedSurfaces_.clear();
172 partitionedVolumes_.clear();
185 ghostElements_.clear();
186 parametrization_.clear();
188 elementData_.clear();
189 elementNodeData_.clear();
190 interpolationScheme_.clear();
200 struct PhysicalNamesAttributes;
201 struct PointAttributes;
202 struct EntityAttributes;
204 template <
class Attr>
205 struct PartitionedAttributes :
public Attr
212 struct GhostAttributes;
213 struct NodeAttributes;
214 struct ElementAttributes;
215 struct PeriodicAttributes;
217 struct GhostElementAttributes {};
218 struct ParametrizationAttributes {};
219 struct NodeDataAttributes {};
220 struct ElementDataAttributes {};
221 struct ElementNodeDataAttributes {};
222 struct InterpolationSchemeAttributes {};
242 size_type numPartitions_ = 0;
249 size_type numNodes_ = 0;
250 size_type minNodeTag_ = 0;
251 size_type maxNodeTag_ = 0;
254 size_type numElements_ = 0;
255 size_type minElementTag_ = 0;
256 size_type maxElementTag_ = 0;
274 template <
class Gr
id>
275 Gmsh4Reader (GridFactory<Grid>&)
276 -> Gmsh4Reader<Grid, ContinuousGridCreator<Grid> >;
278 template <
class GridCreator,
280 Gmsh4Reader (GridCreator&)
281 -> Gmsh4Reader<typename GridCreator::Grid, GridCreator>;
283 template <
class GridCreator,
286 -> Gmsh4Reader<typename GridCreator::Grid, GridCreator>;
#define DUNE_THROW(E,...)
std::shared_ptr< T > stackobject_to_shared_ptr(T &t)
@ line
Definition common.hh:134
static Communication< MPICommunicator > getCommunication()