![]() |
deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
|
Functions | |
| vtkSmartPointer< vtkUnstructuredGrid > | load_vtk_file (const std::string &vtk_filename, const bool cleanup=true, const double relative_tolerance=0.0) |
| vtkSmartPointer< vtkUnstructuredGrid > | convert_to_unstructured_grid (const vtkSmartPointer< vtkDataObject > &data_object) |
| void | write_vtk (const std::string &vtk_filename, const vtkSmartPointer< vtkDataObject > &data_object) |
| vtkSmartPointer< vtkUnstructuredGrid > VTKWrappers::internal::load_vtk_file | ( | const std::string & | vtk_filename, |
| const bool | cleanup = true, |
||
| const double | relative_tolerance = 0.0 |
||
| ) |
Load a VTK file containing an unstructured grid and return the unstructured grid object.
If cleanup is true, overlapping points in the VTK file are merged using VTK's cleaning utilities (only available in VTK >= 9.3).
If the read operation fails, an exception is thrown.
| vtk_filename | |
| cleanup | |
| relative_tolerance |
Definition at line 139 of file utilities.cc.
| vtkSmartPointer< vtkUnstructuredGrid > VTKWrappers::internal::convert_to_unstructured_grid | ( | const vtkSmartPointer< vtkDataObject > & | data_object | ) |
Convert a VTK data object to a vtkUnstructuredGrid if the smart pointer points to one of the supported VTK dataset types listed below.
Supported input types:
vtkUnstructuredGrid -> returned as-is (shallow copy)vtkStructuredGrid -> hexahedral cells extracted from the structured connectivityvtkRectilinearGrid / vtkStructuredPoints -> hexahedral cells reconstructed from grid dimensionsvtkPolyData -> triangles, lines, and polygons converted to their unstructured grid equivalentsIf the input is not a supported dataset type, an exception is thrown. Point and cell data are copied to the output.
This function is used internally by load_vtk_file and write_vtk to normalize all VTK data to a single unstructured grid representation.
| data_object | The VTK data object to convert. |
vtkUnstructuredGrid. Definition at line 101 of file utilities.cc.
| void VTKWrappers::internal::write_vtk | ( | const std::string & | vtk_filename, |
| const vtkSmartPointer< vtkDataObject > & | data_object | ||
| ) |
Write a VTK file to disk from any VTK dataset that can be converted to an unstructured grid.
The output format is determined by the file extension:
.vtu -> VTK XML UnstructuredGrid format.vtk -> legacy VTK UnstructuredGrid formatSupported input types are the same as those handled by convert_to_unstructured_grid: unstructured grids, structured grids, rectilinear grids, structured points, and polydata. Each type is converted to an unstructured grid internally before writing.
If the write operation fails, an exception is thrown.
| [in] | vtk_filename | Path to the output file. The extension determines the format: .vtu for XML format, .vtk for legacy format. |
| [in] | data_object | The VTK data object to write. Must point to a valid dataset that can be converted to an unstructured grid. |
Definition at line 213 of file utilities.cc.