9#include "gmsh_file_v4.h"
58 stream <<
"PYRAMID14";
73 stream <<
"PYRAMID13";
191 LF_VERIFY_MSG(
false,
"unknown Gmsh element type");
241 false,
"Reference element not supported for GmshElement type " << et);
286 LF_VERIFY_MSG(
false,
"Unknown GmshElement Type.");
295bool ParseGmshFileV4Text(std::string::const_iterator begin,
296 std::string::const_iterator end, GMshFileV4* result);
298bool ParseGmshFileV4Binary(std::string::const_iterator begin,
299 std::string::const_iterator end,
int one,
305 std::string::const_iterator end,
306 const std::string& version,
bool is_binary,
307 int size_t_size,
int one,
308 const std::string& filename) {
309 LF_VERIFY_MSG(version ==
"4.1",
"Only version 4.1 is supported so far");
310 LF_VERIFY_MSG(size_t_size ==
sizeof(std::size_t),
311 "size of size_t must be " <<
sizeof(std::size_t));
318 bool succesful =
false;
320 succesful = detail::ParseGmshFileV4Text(begin, end, &result);
322 succesful = detail::ParseGmshFileV4Binary(begin, end, one, &result);
325 LF_VERIFY_MSG(succesful,
"Could not parse file " << filename);
331 if (p.affine_transform) {
332 p.affine_transform->transposeInPlace();
Represents a reference element with all its properties.
static constexpr RefEl kSegment()
Returns the (1-dimensional) reference segment.
static constexpr RefEl kPoint()
Returns the (0-dimensional) reference point.
static constexpr RefEl kTria()
Returns the reference triangle.
static constexpr RefEl kQuad()
Returns the reference quadrilateral.
Mesh input (from file) and output (in various formats) facilities.
GMshFileV4 ReadGmshFileV4(std::string::const_iterator begin, std::string::const_iterator end, const std::string &version, bool is_binary, int size_t_size, int one, const std::string &filename)
Read a GmshFile with format 4 and return it as an in-memory struct.
int DimOf(GMshFileV2::ElementType et)
Dimension of the GmshElement type.
base::RefEl RefElOf(GMshFileV2::ElementType et)
Reference element type of a GmshElementType.
std::ostream & operator<<(std::ostream &stream, GMshFileV2::ElementType et)
Output the element type onto the console:
size_type NumNodes(GMshFileV2::ElementType et)
Number of nodes that this element type has.
A representation of a .msh file (V4) in a c++ data structure.
std::vector< PeriodicLink > periodic_links
ElementType
All possible element types (see GMSH documentation)
std::string version_number
The version of GMSH of the msh file, equals usually 4.1.
int size_t_size
how many bytes is a size_t?
bool is_binary
Is it a binary file?