17 #include "../fem/geom.hpp" 18 #include "../general/binaryio.hpp" 40 static const int CUBE = 12;
94 static int GetOrder(
int vtk_geom,
int npoints);
124 uint32_t nbytes,
int compression_level);
146 template <
typename T>
158 const uint8_t &val,
const char *suffix,
168 const double &val,
const char *suffix,
178 const float &val,
const char *suffix,
186 int compression_level);
static const int BIQUADRATIC_SQUARE
static const int HighOrderMap[Geometry::NUM_GEOMETRIES]
Map from MFEM's Geometry::Type to arbitrary-order Lagrange VTK geometries.
static const int QUADRATIC_TETRAHEDRON
Data arrays will be written in ASCII format.
void WriteBinaryOrASCII(std::ostream &os, std::vector< char > &buf, const T &val, const char *suffix, VTKFormat format)
Write either ASCII data to the stream or binary data to the buffer depending on the given format...
static const int QUADRATIC_PYRAMID
static bool IsLagrange(int vtk_geom)
Does the given VTK geometry type describe an arbitrary-order Lagrange element?
void WriteBinaryOrASCII< uint8_t >(std::ostream &os, std::vector< char > &buf, const uint8_t &val, const char *suffix, VTKFormat format)
Specialization of WriteBinaryOrASCII for uint8_t to ensure ASCII output is numeric (rather than inter...
void WriteBinaryOrASCII< float >(std::ostream &os, std::vector< char > &buf, const float &val, const char *suffix, VTKFormat format)
Specialization of WriteBinaryOrASCII<T> for float.
static const int LAGRANGE_CUBE
static const int QUADRATIC_TRIANGLE
int BarycentricToVTKTriangle(int *b, int ref)
Return the VTK node index of the barycentric point b in a triangle with refinement level ref...
static const int TRIQUADRATIC_CUBE
static const int Map[Geometry::NUM_GEOMETRIES]
Map from MFEM's Geometry::Type to linear VTK geometries.
static const int LAGRANGE_SEGMENT
Helper class for converting between MFEM and VTK geometry types.
VTKFormat
Data array format for VTK and VTU files.
static const int LAGRANGE_SQUARE
void WriteBinaryOrASCII< double >(std::ostream &os, std::vector< char > &buf, const double &val, const char *suffix, VTKFormat format)
Specialization of WriteBinaryOrASCII for double.
static const int BIQUADRATIC_QUADRATIC_PRISM
static const int QuadraticMap[Geometry::NUM_GEOMETRIES]
Map from MFEM's Geometry::Type to legacy quadratic VTK geometries/.
void WriteVTKEncodedCompressed(std::ostream &os, const void *bytes, uint32_t nbytes, int compression_level)
Outputs encoded binary data in the base 64 format needed by VTK.
static Geometry::Type GetMFEMGeometry(int vtk_geom)
Given a VTK geometry type, return the corresponding MFEM Geometry::Type.
static const int TRIANGLE
static const int LAGRANGE_TETRAHEDRON
static const int QUADRATIC_SEGMENT
static const int TETRAHEDRON
const char * VTKByteOrder()
Determine the byte order and return either "BigEndian" or "LittleEndian".
static const int QUADRATIC_PRISM
void AppendBytes(std::vector< char > &vec, const T &val)
Append the binary representation of val to the byte buffer vec.
static const int LAGRANGE_TRIANGLE
static const int PrismMap[6]
Permutation from MFEM's prism ordering to VTK's prism ordering.
void CreateVTKElementConnectivity(Array< int > &con, Geometry::Type geom, int ref)
Create the VTK element connectivity array for a given element geometry and refinement level...
static bool IsQuadratic(int vtk_geom)
Does the given VTK geometry type describe a legacy quadratic element?
static const int * VertexPermutation[Geometry::NUM_GEOMETRIES]
Permutation from MFEM's vertex ordering to VTK's vertex ordering.
static const int LAGRANGE_PYRAMID
void WriteBase64WithSizeAndClear(std::ostream &os, std::vector< char > &buf, int compression_level)
Encode in base 64 (and potentially compress) the given data, write it to the output stream (with a he...
static int GetOrder(int vtk_geom, int npoints)
For the given VTK geometry type and number of points, return the order of the element.
static const int LAGRANGE_PRISM