hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
hpfem::io::VtkWriter< Dim > Class Template Reference

#include <vtk.hpp>

Classes

struct  Array
 One data array of the file; public so that write_vtu_facets can reuse the encoder. More...
 

Public Member Functions

 VtkWriter (const mesh::Mesh< Dim > &mesh, VtkFormat format=VtkFormat::kBinary)
 
Index num_points () const noexcept
 Number of points written: vertices, plus one edge node per edge for order-2 meshes.
 
VtkWriter & cell_scalars (std::string name, std::span< const Real > values)
 
VtkWriter & cell_scalars (std::string name, std::span< const Complex > values)
 
VtkWriter & cell_scalars (std::string name, std::span< const Index > values)
 
VtkWriter & cell_vectors (std::string name, std::span< const Point< Dim > > values)
 
VtkWriter & cell_vectors (std::string name, std::span< const Eigen::Matrix< Complex, Dim, 1 > > values)
 
VtkWriter & point_scalars (std::string name, std::span< const Real > values)
 
VtkWriter & point_scalars (std::string name, std::span< const Complex > values)
 
VtkWriter & point_vectors (std::string name, std::span< const Point< Dim > > values)
 
VtkWriter & point_vectors (std::string name, std::span< const Eigen::Matrix< Complex, Dim, 1 > > values)
 
void write (std::ostream &out) const
 
void write (const std::filesystem::path &file) const
 

Detailed Description

template<int Dim>
class hpfem::io::VtkWriter< Dim >

Builds a .vtu file from a mesh. Cells are written as (quadratic) triangles or tetrahedra; a second-order mesh exports its edge nodes as additional points, so curved cells are shown curved. The cell tag is always written as cell data cell_tag.

Data arrays are attached fluently; sizes must match mesh.num_cells() for cell data and num_points() for point data. Complex arrays are written as two real arrays <name>_re and <name>_im (convention exp(-iωt), CLAUDE.md §6). Vectors are padded to three components as VTK requires.

Constructor & Destructor Documentation

◆ VtkWriter()

template<int Dim>
hpfem::io::VtkWriter< Dim >::VtkWriter ( const mesh::Mesh< Dim > &  mesh,
VtkFormat  format = VtkFormat::kBinary 
)
explicit

Member Function Documentation

◆ cell_scalars() [1/3]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::cell_scalars ( std::string  name,
std::span< const Complex >  values 
)

◆ cell_scalars() [2/3]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::cell_scalars ( std::string  name,
std::span< const Index >  values 
)

◆ cell_scalars() [3/3]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::cell_scalars ( std::string  name,
std::span< const Real >  values 
)

◆ cell_vectors() [1/2]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::cell_vectors ( std::string  name,
std::span< const Eigen::Matrix< Complex, Dim, 1 > >  values 
)

◆ cell_vectors() [2/2]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::cell_vectors ( std::string  name,
std::span< const Point< Dim > >  values 
)

◆ num_points()

template<int Dim>
Index hpfem::io::VtkWriter< Dim >::num_points ( ) const
noexcept

Number of points written: vertices, plus one edge node per edge for order-2 meshes.

◆ point_scalars() [1/2]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::point_scalars ( std::string  name,
std::span< const Complex >  values 
)

◆ point_scalars() [2/2]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::point_scalars ( std::string  name,
std::span< const Real >  values 
)

◆ point_vectors() [1/2]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::point_vectors ( std::string  name,
std::span< const Eigen::Matrix< Complex, Dim, 1 > >  values 
)

◆ point_vectors() [2/2]

template<int Dim>
VtkWriter & hpfem::io::VtkWriter< Dim >::point_vectors ( std::string  name,
std::span< const Point< Dim > >  values 
)

◆ write() [1/2]

template<int Dim>
void hpfem::io::VtkWriter< Dim >::write ( const std::filesystem::path &  file) const
Exceptions
InvalidArgumentif the file cannot be created.

◆ write() [2/2]

template<int Dim>
void hpfem::io::VtkWriter< Dim >::write ( std::ostream &  out) const

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