core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
vti_io.hpp File Reference

VTK ImageData (.vti) I/O for sampled SDF / scalar / vector grid fields. More...

#include <fstream>
#include <ios>
#include <sstream>
#include <stdexcept>
#include <string>
#include "peclet/core/common/types.hpp"
#include "peclet/core/geom/grid_sdf.hpp"

Go to the source code of this file.

Classes

struct  peclet::core::geom::VtiVector
 A sampled vector field on a regular grid (3 interleaved components per point, x-fastest). More...
 

Namespaces

namespace  peclet
 
namespace  peclet::core
 
namespace  peclet::core::geom
 
namespace  peclet::core::geom::detail
 

Functions

void peclet::core::geom::writeVti (const std::string &path, const GridSdf &g, const std::string &name="sdf")
 Write a GridSdf as a VTK ImageData (.vti), PointData Float32 scalar, ASCII.
 
std::string peclet::core::geom::detail::vtiAttr (const std::string &s, const std::string &key)
 
GridSdf peclet::core::geom::readVti (const std::string &path)
 Read a VTK ImageData (.vti) written by writeVti (ASCII PointData scalar) into a GridSdf.
 
void peclet::core::geom::writeVtiVector (const std::string &path, const VtiVector &g, const std::string &name="vector")
 Write a 3-component vector field as a VTK ImageData PointData vector (ASCII), ParaView-openable.
 
VtiVector peclet::core::geom::readVtiVector (const std::string &path)
 Read a vector-field VTI written by writeVtiVector.
 

Detailed Description

VTK ImageData (.vti) I/O for sampled SDF / scalar / vector grid fields.

Writes/reads a GridSdf as an ImageData PointData scalar in ASCII format — human-readable, exact float round-trip, and openable in ParaView. This is the interchange format flow and dem already use for SDF/field grids; consolidating their readers onto this is a follow-up. The reader is tolerant (attribute scan, not a full XML parse) but expects the ASCII inline layout this writer emits; binary/base64 "appended" VTI (what some existing files use) is a noted TODO.

Definition in file vti_io.hpp.