20 #ifndef LIBMESH_GMSH_IO_H 21 #define LIBMESH_GMSH_IO_H 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/mesh_input.h" 26 #include "libmesh/mesh_output.h" 83 virtual void read (
const std::string &
name)
override;
89 virtual void write (
const std::string &
name)
override;
102 const std::vector<Number> &,
103 const std::vector<std::string> &)
override;
143 const std::vector<Number> * =
nullptr,
144 const std::vector<std::string> * =
nullptr);
163 unsigned gmsh_type_in,
165 unsigned nnodes_in) :
188 out.emplace(eledef.
type, eledef);
192 std::map<ElemType, ElementDefinition>
out;
193 std::map<unsigned int, ElementDefinition>
in;
212 #endif // LIBMESH_GMSH_IO_H
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
ElemType
Defines an enum for geometric element types.
Reading and writing meshes in the Gmsh format.
bool _binary
Flag to write binary data.
virtual void write(const std::string &name) override
This method implements writing a mesh to a specified file in the Gmsh *.msh format.
bool & write_lower_dimensional_elements()
Access to the flag which controls whether boundary elements are written to the Mesh file...
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
This class defines an abstract interface for Mesh output.
bool & binary()
Flag indicating whether or not to write a binary file.
The libMesh namespace provides an interface to certain functionality in the library.
std::map< unsigned int, ElementDefinition > in
This is the MeshBase class.
std::map< ElemType, ElementDefinition > out
ElementDefinition(ElemType type_in, unsigned gmsh_type_in, unsigned dim_in, unsigned nnodes_in)
void write_mesh(std::ostream &out)
This method implements writing a mesh to a specified file.
bool _write_lower_dimensional_elements
If true, lower-dimensional elements based on the boundary conditions get written to the output file...
Defines mapping from libMesh element types to Gmsh element types or vice-versa.
static ElementMaps build_element_maps()
A static function used to construct the _element_maps struct, statically.
static ElementMaps _element_maps
A static ElementMaps object that is built statically and used by all instances of this class...
GmshIO(MeshBase &mesh)
Constructor.
void add_def(const ElementDefinition &eledef)
virtual void read(const std::string &name) override
Reads in a mesh in the Gmsh *.msh format from the ASCII file given by name.
void write_post(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
struct which holds a map from Gmsh to libMesh element numberings and vice-versa.
void read_mesh(std::istream &in)
Implementation of the read() function.
std::vector< unsigned int > nodes