MFEM v4.7.0
Finite element discretization library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
vtk.hpp File Reference

Go to the source code of this file.

Classes

struct  mfem::VTKGeometry
 Helper class for converting between MFEM and VTK geometry types. More...
 

Namespaces

namespace  mfem
 

Enumerations

enum class  mfem::VTKFormat { mfem::ASCII , mfem::BINARY , mfem::BINARY32 }
 Data array format for VTK and VTU files. More...
 

Functions

void mfem::CreateVTKElementConnectivity (Array< int > &con, Geometry::Type geom, int ref)
 Create the VTK element connectivity array for a given element geometry and refinement level.
 
void mfem::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.
 
int mfem::BarycentricToVTKTriangle (int *b, int ref)
 Return the VTK node index of the barycentric point b in a triangle with refinement level ref.
 
const char * mfem::VTKByteOrder ()
 Determine the byte order and return either "BigEndian" or "LittleEndian".
 
template<typename T >
void mfem::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.
 
template<>
void mfem::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 interpreting val as a character.)
 
template<>
void mfem::WriteBinaryOrASCII< double > (std::ostream &os, std::vector< char > &buf, const double &val, const char *suffix, VTKFormat format)
 Specialization of WriteBinaryOrASCII for double.
 
template<>
void mfem::WriteBinaryOrASCII< float > (std::ostream &os, std::vector< char > &buf, const float &val, const char *suffix, VTKFormat format)
 Specialization of WriteBinaryOrASCII<T> for float.
 
void mfem::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 header) and clear the buffer.