pnm 1.0.3
peclet.pnm — pore-network extraction from SDF geometry (Kokkos)
Loading...
Searching...
No Matches
pnm::test Namespace Reference

Functions

float sphereLatticeSdf (int gx, int gy, int gz, std::array< int, 3 > gd)
 2x2x2 lattice of SOLID spheres in a periodic box (min-image distance); pores at the interstices.
 
float trigSdf (int gx, int gy, int gz, std::array< int, 3 > gd)
 Smooth trigonometric field with wrap-around components (exercises the periodic images).
 
float spherePoreSdf (int gx, int gy, int gz, std::array< int, 3 > c, float radius)
 One spherical PORE (SDF > 0 inside) of radius radius centred on the integer voxel c; solid everywhere outside.
 
float twoSpherePoresSdf (int gx, int gy, int gz, std::array< int, 3 > c1, std::array< int, 3 > c2, float radius)
 Two overlapping spherical pores (the union = max of the two SDFs); a throat at the mid-plane when the centres are closer than 2*radius.
 
template<class SdfFn >
std::vector< float > sampleGrid (std::array< int, 3 > gd, const SdfFn &fn)
 Sample fn(gx, gy, gz) over the whole gd grid in pnm's flat x-fastest layout.
 

Function Documentation

◆ sphereLatticeSdf()

float pnm::test::sphereLatticeSdf ( int  gx,
int  gy,
int  gz,
std::array< int, 3 >  gd 
)
inline

2x2x2 lattice of SOLID spheres in a periodic box (min-image distance); pores at the interstices.

Sphere centres at gd*(2c+1)/4 per axis, radius 0.22*min(gd).

Definition at line 18 of file synthetic_sdf.hpp.

Referenced by main().

◆ trigSdf()

float pnm::test::trigSdf ( int  gx,
int  gy,
int  gz,
std::array< int, 3 >  gd 
)
inline

Smooth trigonometric field with wrap-around components (exercises the periodic images).

Definition at line 36 of file synthetic_sdf.hpp.

Referenced by main().

◆ spherePoreSdf()

float pnm::test::spherePoreSdf ( int  gx,
int  gy,
int  gz,
std::array< int, 3 >  c,
float  radius 
)
inline

One spherical PORE (SDF > 0 inside) of radius radius centred on the integer voxel c; solid everywhere outside.

The SDF peak is exactly radius at c (no distance rounding).

Definition at line 44 of file synthetic_sdf.hpp.

Referenced by twoSpherePoresSdf().

◆ twoSpherePoresSdf()

float pnm::test::twoSpherePoresSdf ( int  gx,
int  gy,
int  gz,
std::array< int, 3 >  c1,
std::array< int, 3 >  c2,
float  radius 
)
inline

Two overlapping spherical pores (the union = max of the two SDFs); a throat at the mid-plane when the centres are closer than 2*radius.

Definition at line 51 of file synthetic_sdf.hpp.

References spherePoreSdf().

◆ sampleGrid()

template<class SdfFn >
std::vector< float > pnm::test::sampleGrid ( std::array< int, 3 >  gd,
const SdfFn &  fn 
)

Sample fn(gx, gy, gz) over the whole gd grid in pnm's flat x-fastest layout.

Definition at line 58 of file synthetic_sdf.hpp.