pnm 1.0.3
peclet.pnm — pore-network extraction from SDF geometry (Kokkos)
Loading...
Searching...
No Matches
synthetic_sdf.hpp File Reference
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  pnm
 
namespace  pnm::test
 

Functions

float pnm::test::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 pnm::test::trigSdf (int gx, int gy, int gz, std::array< int, 3 > gd)
 Smooth trigonometric field with wrap-around components (exercises the periodic images).
 
float pnm::test::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 pnm::test::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 > 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.