core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::geom::GridSdf Struct Reference

A signed-distance field sampled on a regular axis-aligned grid (negative inside solid). More...

#include <grid_sdf.hpp>

Public Member Functions

double at (Index i, Index j, Index k) const
 Raw sample lookup at integer grid index (i,j,k); no bounds checking.
 
double eval (const Vec< 3 > &p) const
 Trilinearly-interpolated signed distance at world point p.
 

Public Attributes

std::vector< floatvalues
 Sample values, x-fastest: idx = i + j*nx + k*nx*ny.
 
IVec< 3 > dims {}
 Sample count per axis (nx, ny, nz).
 
Vec< 3 > origin {}
 World position of sample (0,0,0).
 
Vec< 3 > spacing {1, 1, 1}
 World-space distance between samples per axis.
 

Detailed Description

A signed-distance field sampled on a regular axis-aligned grid (negative inside solid).

Models the peclet::core::geom::Sdf concept via eval(). Storage is x-fastest, matching the suite indexing convention and the VTI fields produced by flow/dem.

Definition at line 23 of file grid_sdf.hpp.

Member Function Documentation

◆ at()

double peclet::core::geom::GridSdf::at ( Index  i,
Index  j,
Index  k 
) const
inline

Raw sample lookup at integer grid index (i,j,k); no bounds checking.

Definition at line 30 of file grid_sdf.hpp.

References dims, and values.

Referenced by eval().

◆ eval()

double peclet::core::geom::GridSdf::eval ( const Vec< 3 > &  p) const
inline

Trilinearly-interpolated signed distance at world point p.

Queries outside the sampled box clamp to the nearest in-domain sample.

Definition at line 36 of file grid_sdf.hpp.

References at(), dims, origin, and spacing.

Member Data Documentation

◆ values

std::vector<float> peclet::core::geom::GridSdf::values

Sample values, x-fastest: idx = i + j*nx + k*nx*ny.

Definition at line 24 of file grid_sdf.hpp.

Referenced by at(), peclet::core::geom::readVti(), peclet::core::geom::sample(), and peclet::core::geom::writeVti().

◆ dims

IVec<3> peclet::core::geom::GridSdf::dims {}

Sample count per axis (nx, ny, nz).

Definition at line 25 of file grid_sdf.hpp.

Referenced by at(), eval(), peclet::core::geom::readVti(), peclet::core::geom::sample(), and peclet::core::geom::writeVti().

◆ origin

Vec<3> peclet::core::geom::GridSdf::origin {}

World position of sample (0,0,0).

Definition at line 26 of file grid_sdf.hpp.

Referenced by eval(), peclet::core::geom::readVti(), peclet::core::geom::sample(), and peclet::core::geom::writeVti().

◆ spacing

Vec<3> peclet::core::geom::GridSdf::spacing {1, 1, 1}

World-space distance between samples per axis.

Definition at line 27 of file grid_sdf.hpp.

Referenced by eval(), peclet::core::geom::readVti(), peclet::core::geom::sample(), and peclet::core::geom::writeVti().


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