15#ifndef INCG7fedf7cf1a0246a98b2bf431cfa34da2
16#define INCG7fedf7cf1a0246a98b2bf431cfa34da2
17#include <lf/mesh/mesh.h>
18#include <lf/mesh/utils/utils.h>
25#include "gmsh_file_v2.h"
26#include "gmsh_file_v4.h"
79 [[nodiscard]] std::shared_ptr<mesh::Mesh>
mesh() {
return mesh_; }
84 [[nodiscard]] std::shared_ptr<const mesh::Mesh>
mesh()
const {
return mesh_; }
100 dim_t codim = -1)
const;
115 dim_t codim = -1)
const;
124 [[nodiscard]] std::vector<std::pair<size_type, std::string>>
PhysicalEntities(
150 size_type physical_entity_nr)
const;
159 GmshReader(std::unique_ptr<mesh::MeshFactory> factory,
173 GmshReader(std::unique_ptr<mesh::MeshFactory> factory,
174 const std::string& filename);
183 std::shared_ptr<mesh::utils::AllCodimMeshDataSet<std::vector<size_type>>>
187 std::multimap<std::string, std::pair<size_type, dim_t>>
name_2_nr_;
190 std::multimap<size_type, std::pair<std::string, dim_t>>
nr_2_name_;
196std::variant<GMshFileV2, GMshFileV4>
ReadGmshFile(
const std::string& filename);
Reads a Gmsh *.msh file into a mesh::MeshFactory and provides a link between mesh::Entity objects and...
void InitGmshFile(const GMshFileV2 &msh_file)
std::shared_ptr< mesh::Mesh > mesh_
The underlying grid created by the grid factory.
std::shared_ptr< const mesh::Mesh > mesh() const
Get the mesh that was read by this reader.
bool IsPhysicalEntity(const mesh::Entity &e, size_type physical_entity_nr) const
Test whether the given entity belongs to a Gmsh physical entity.
std::vector< size_type > PhysicalEntityNr(const mesh::Entity &e) const
Return the Physical Entity Numbers associated with this mesh entity, sorted ascending.
mesh::Mesh::size_type size_type
std::shared_ptr< mesh::Mesh > mesh()
Get the mesh that was read by this reader.
std::shared_ptr< mesh::utils::AllCodimMeshDataSet< std::vector< size_type > > > physical_nrs_
The PhysicalEntityNr of every entity (0 if not set):
std::string PhysicalEntityNr2Name(size_type number, dim_t codim=-1) const
Gives the name of a physical entity (inverse of PhysicalEntityName2Nr())
std::multimap< size_type, std::pair< std::string, dim_t > > nr_2_name_
Map from physicalEntity nr -> name, codim.
GmshReader(std::unique_ptr< mesh::MeshFactory > factory, const GmshFileVariant &msh_file)
Create a new GmshReader from the given MshFile (advanced usage)
std::multimap< std::string, std::pair< size_type, dim_t > > name_2_nr_
Map from physicalEntity name -> nr, codim.
size_type PhysicalEntityName2Nr(const std::string &name, dim_t codim=-1) const
maps the name of a physical entity to the physical entity number of gmsh.
std::vector< std::pair< size_type, std::string > > PhysicalEntities(dim_t codim) const
Retrieve a list of all (Gmsh) physical entities of the given codim.
std::variant< GMshFileV2, GMshFileV4 > GmshFileVariant
std::unique_ptr< mesh::MeshFactory > mesh_factory_
Interface class representing a topological entity in a cellular complex
lf::base::size_type size_type
Mesh input (from file) and output (in various formats) facilities.
std::variant< GMshFileV2, GMshFileV4 > ReadGmshFile(const std::string &filename)
A representation of a .msh file (V2) in a c++ data structure.
A representation of a .msh file (V4) in a c++ data structure.