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;
Reading and writing meshes in the Gmsh format.
bool & binary()
Flag indicating whether or not to write a binary file.
bool & write_lower_dimensional_elements()
Access to the flag which controls whether boundary elements are written to the Mesh file.
virtual void write(const std::string &name) override
This method implements writing a mesh to a specified file in the Gmsh *.msh format.
void write_mesh(std::ostream &out)
This method implements writing a mesh to a specified file.
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...
void read_mesh(std::istream &in)
Implementation of the read() function.
bool _binary
Flag to write binary data.
virtual void read(const std::string &name) override
Reads in a mesh in the Gmsh *.msh format from the ASCII file given by name.
bool _write_lower_dimensional_elements
If true, lower-dimensional elements based on the boundary conditions get written to the output 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...
static ElementMaps _element_maps
A static ElementMaps object that is built statically and used by all instances of this class.
static ElementMaps build_element_maps()
A static function used to construct the _element_maps struct, statically.
This is the MeshBase class.
This class defines an abstract interface for Mesh output.
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
Defines mapping from libMesh element types to Gmsh element types or vice-versa.
std::vector< unsigned int > nodes
ElementDefinition(ElemType type_in, unsigned gmsh_type_in, unsigned dim_in, unsigned nnodes_in)
struct which holds a map from Gmsh to libMesh element numberings and vice-versa.
std::map< ElemType, ElementDefinition > out
std::map< unsigned int, ElementDefinition > in
void add_def(const ElementDefinition &eledef)