![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Base class for exporting a mesh to VTK file formats. More...
#include <mesh_exporter.hpp>
Public Types | |
| using | index_t = MeshDerived::index_t |
| The index type used by the mesh. | |
Public Member Functions | |
| MeshExporterBase (const MeshDerived &mesh, const VtuOptions &options={}) | |
| Constructs a MeshExporterBase for a given mesh. | |
| void | save (const std::string &filename, const std::optional< VtuOptions > &options=std::nullopt) const |
| Saves the mesh data to a file. | |
| const auto & | getMesh () const |
| Gets a constant reference to the mesh. | |
| const auto & | getVtkGrids () const |
| Gets a constant reference to the generated VTK grids. | |
Protected Member Functions | |
| void | savePvtu (const std::string &filename, const VtuOptions &write_options) const |
| Saves the mesh data to a parallel VTU file. | |
| void | initializeMeshForExport () const |
| Initializes the mesh for export, modifying if necessary. | |
| const MeshDerived & | getMeshRef () const |
| Gets a reference to the mesh for export (original/modified). | |
Protected Attributes | |
| const MeshDerived & | m_mesh |
| VtuOptions | m_export_options |
| std::vector< vtkSmartPointer< vtkUnstructuredGrid > > | m_vtk_grids |
| std::optional< MeshDerived > | m_modified_mesh |
Base class for exporting a mesh to VTK file formats.
This template class provides the core functionality for converting a mesh data structure into one or more VTK unstructured grids and saving them to a file. It handles the common tasks of writing VTU or VTK files.
| MeshDerived | The derived mesh class, which must be derived from MeshBase |
| using vulpes::geometry::MeshExporterBase< MeshDerived >::index_t = MeshDerived::index_t |
The index type used by the mesh.
|
inlineexplicit |
Constructs a MeshExporterBase for a given mesh.
| mesh | The mesh to be exported. |
| options | Export options including precision settings. |
|
inline |
Gets a constant reference to the mesh.
|
inlineprotected |
Gets a reference to the mesh for export (original/modified).
|
inline |
Gets a constant reference to the generated VTK grids.
|
inlineprotected |
Initializes the mesh for export, modifying if necessary.
If the mesh requires modification (e.g., closed periodic 2D mesh), this creates a modified copy stored in m_modified_mesh for use during export.
| void vulpes::geometry::MeshExporterBase< MeshDerived >::save | ( | const std::string & | filename, |
| const std::optional< VtuOptions > & | options = std::nullopt ) const |
Saves the mesh data to a file.
This method writes the internal VTK grid data to the specified filename. It supports .vtu (VTK Unstructured Grid XML) and .vtk (legacy VTK) file formats.
| filename | The name of the output file. |
| options | Optional override for writer options (compressor_type and data_mode). If not provided, uses the options passed to the constructor. Note: coordinate_precision cannot be changed here as it affects point data already built in the VTK grids. |
|
protected |
Saves the mesh data to a parallel VTU file.
This method writes the internal VTK grid data using the parallel .pvtu XML format. It is intended for ParallelMesh exporters.
| filename | The name of the output .pvtu file. |
| write_options | Writer options used for the output files. |
|
protected |
|
protected |
|
mutableprotected |
|
protected |