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

Namespaces

namespace  detail
 

Classes

struct  Box
 Axis-aligned solid box of half-extents half: standard exact box SDF, negative inside. More...
 
struct  Complement
 Negation: the solid and the void swap (sdf -> -sdf). More...
 
struct  GridSdf
 A signed-distance field sampled on a regular axis-aligned grid (negative inside solid). More...
 
struct  HollowCylinder
 Solid hollow cylinder (a tube wall) of given outer/inner radius and height about axis. More...
 
struct  Sphere
 Solid ball: negative inside. More...
 
struct  VtiVector
 A sampled vector field on a regular grid (3 interleaved components per point, x-fastest). More...
 

Functions

template<typename S >
GridSdf sample (const S &shape, IVec< 3 > dims, Vec< 3 > origin, Vec< 3 > spacing)
 Sample any analytic SDF onto a grid, producing a GridSdf (e.g. to bake geometry for a solver).
 
template<typename S >
Vec< 3 > gradient (const S &shape, const Vec< 3 > &p, double h=1e-4)
 Generic outward normal via central differences; works for any shape with eval().
 
void 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.
 
GridSdf readVti (const std::string &path)
 Read a VTK ImageData (.vti) written by writeVti (ASCII PointData scalar) into a GridSdf.
 
void 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 readVtiVector (const std::string &path)
 Read a vector-field VTI written by writeVtiVector.
 

Function Documentation

◆ sample()

template<typename S >
GridSdf peclet::core::geom::sample ( const S shape,
IVec< 3 >  dims,
Vec< 3 >  origin,
Vec< 3 >  spacing 
)

Sample any analytic SDF onto a grid, producing a GridSdf (e.g. to bake geometry for a solver).

Definition at line 63 of file grid_sdf.hpp.

References peclet::core::geom::GridSdf::dims, peclet::core::geom::GridSdf::origin, peclet::core::geom::GridSdf::spacing, and peclet::core::geom::GridSdf::values.

◆ gradient()

template<typename S >
Vec< 3 > peclet::core::geom::gradient ( const S shape,
const Vec< 3 > &  p,
double  h = 1e-4 
)

Generic outward normal via central differences; works for any shape with eval().

Definition at line 78 of file sdf.hpp.

◆ writeVti()

void peclet::core::geom::writeVti ( const std::string &  path,
const GridSdf g,
const std::string &  name = "sdf" 
)
inline

Write a GridSdf as a VTK ImageData (.vti), PointData Float32 scalar, ASCII.

Definition at line 24 of file vti_io.hpp.

References peclet::core::geom::GridSdf::dims, peclet::core::geom::GridSdf::origin, peclet::core::geom::GridSdf::spacing, and peclet::core::geom::GridSdf::values.

◆ readVti()

GridSdf peclet::core::geom::readVti ( const std::string &  path)
inline

Read a VTK ImageData (.vti) written by writeVti (ASCII PointData scalar) into a GridSdf.

Definition at line 58 of file vti_io.hpp.

References peclet::core::geom::GridSdf::dims, peclet::core::geom::GridSdf::origin, peclet::core::geom::GridSdf::spacing, peclet::core::geom::GridSdf::values, and peclet::core::geom::detail::vtiAttr().

◆ writeVtiVector()

void peclet::core::geom::writeVtiVector ( const std::string &  path,
const VtiVector g,
const std::string &  name = "vector" 
)
inline

Write a 3-component vector field as a VTK ImageData PointData vector (ASCII), ParaView-openable.

Definition at line 99 of file vti_io.hpp.

References peclet::core::geom::VtiVector::dims, peclet::core::geom::VtiVector::origin, peclet::core::geom::VtiVector::spacing, and peclet::core::geom::VtiVector::values.

◆ readVtiVector()

VtiVector peclet::core::geom::readVtiVector ( const std::string &  path)
inline