Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/de/d1d/classdolfinx_1_1io_1_1VTKFile.html
DOLFINx  0.5.1
DOLFINx C++ interface
Public Member Functions | List of all members
VTKFile Class Reference

Output of meshes and functions in VTK/ParaView format. Isoparametric meshes of arbitrary degree are supported. For finite element functions, cell-based (DG0) and Lagrange (point-based) functions can be saved. For vertex-based functions the output must be isoparametic, i.e. the geometry and the finite element functions must be defined using the same basis. More...

#include <VTKFile.h>

Public Member Functions

 VTKFile (MPI_Comm comm, const std::filesystem::path &filename, const std::string &file_mode)
 Create VTK file.
 
 ~VTKFile ()
 Destructor.
 
void close ()
 Close file.
 
void flush ()
 Flushes XML files to disk.
 
void write (const mesh::Mesh &mesh, double time=0.0)
 Write a mesh to file. Supports arbitrary order Lagrange isoparametric cells. More...
 
template<typename T >
void write (const std::vector< std::reference_wrapper< const fem::Function< T >>> &u, double t)
 Write finite elements function with an associated timestep. More...
 

Detailed Description

Output of meshes and functions in VTK/ParaView format. Isoparametric meshes of arbitrary degree are supported. For finite element functions, cell-based (DG0) and Lagrange (point-based) functions can be saved. For vertex-based functions the output must be isoparametic, i.e. the geometry and the finite element functions must be defined using the same basis.

Warning
This format is not suitable to checkpointing

Member Function Documentation

◆ write() [1/2]

void write ( const mesh::Mesh mesh,
double  time = 0.0 
)

Write a mesh to file. Supports arbitrary order Lagrange isoparametric cells.

Parameters
[in]meshThe Mesh to write to file
[in]timeTime parameter to associate with mesh

◆ write() [2/2]

void write ( const std::vector< std::reference_wrapper< const fem::Function< T >>> &  u,
double  t 
)
inline

Write finite elements function with an associated timestep.

Parameters
[in]uList of functions to write to file
[in]tTime parameter to associate with u
Precondition
All Functions in u must share the same mesh
All Functions in u with point-wise data must use the same element type (up to the block size) and the element must be (discontinuous) Lagrange
Functions in u cannot be sub-Functions. Interpolate sub-Functions before output

The documentation for this class was generated from the following files: