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

Functions

std::string num (double v)
void require (bool ok, const char *who, const std::string &name, const std::string &rule, double v)
std::string component (const char *name, std::size_t i)
void triple (const char *who, const char *name, std::size_t size)
 A z-y-x triple: exactly three values.
void finiteEach (const char *who, const char *name, const std::vector< double > &a, const char *dim)
 Each component finite once narrowed to float32 (a coordinate: any sign).
void positiveEach (const char *who, const char *name, const std::vector< double > &a, const char *dim)
 Each component finite and > 0 once narrowed to float32 (a cell size).
void countEach (const char *who, const char *name, const std::vector< int > &a, int lo)
 Each component an integer >= lo (a voxel count).
void spacingZyx (const char *who, const std::vector< double > &spacing)
 spacing_zyx: the grid's cell size per axis, three values > 0 (length units).
void grid (const char *who, const std::vector< double > &origin, const std::vector< double > &spacing)
 origin_zyx + spacing_zyx of extract_pores / extract_pore_network(_mpi).
void globalShapeZyx (const char *who, const std::vector< int > &shape, bool sized)
 The global grid of the ORB decomposition: at least one voxel per axis.
void topologyShape (const std::optional< std::vector< int > > &shape)
 extract_topology's shape_zyx, when given as three values: voxel counts >= 0 whose product fits in std::size_t (a wrapped product could match the flat array's length).
void initPore (Pore *p, float x, float y, float z, float radius)
 Pore(x, y, z, radius): a finite centre and a finite radius >= 0 (Pore() is all zeros).

Function Documentation

◆ num()

std::string pnm::binding_checks::num ( double v)
inline

Definition at line 29 of file pnm_bindings_checks.hpp.

Referenced by require().

◆ require()

void pnm::binding_checks::require ( bool ok,
const char * who,
const std::string & name,
const std::string & rule,
double v )
inline

Definition at line 34 of file pnm_bindings_checks.hpp.

References num().

Referenced by countEach(), finiteEach(), initPore(), positiveEach(), and topologyShape().

◆ component()

std::string pnm::binding_checks::component ( const char * name,
std::size_t i )
inline

Definition at line 41 of file pnm_bindings_checks.hpp.

Referenced by countEach(), finiteEach(), and positiveEach().

◆ triple()

void pnm::binding_checks::triple ( const char * who,
const char * name,
std::size_t size )
inline

A z-y-x triple: exactly three values.

Definition at line 46 of file pnm_bindings_checks.hpp.

Referenced by globalShapeZyx(), grid(), and spacingZyx().

◆ finiteEach()

void pnm::binding_checks::finiteEach ( const char * who,
const char * name,
const std::vector< double > & a,
const char * dim )
inline

Each component finite once narrowed to float32 (a coordinate: any sign).

Definition at line 53 of file pnm_bindings_checks.hpp.

References component(), and require().

Referenced by grid().

◆ positiveEach()

void pnm::binding_checks::positiveEach ( const char * who,
const char * name,
const std::vector< double > & a,
const char * dim )
inline

Each component finite and > 0 once narrowed to float32 (a cell size).

Definition at line 61 of file pnm_bindings_checks.hpp.

References component(), and require().

Referenced by spacingZyx().

◆ countEach()

void pnm::binding_checks::countEach ( const char * who,
const char * name,
const std::vector< int > & a,
int lo )
inline

Each component an integer >= lo (a voxel count).

Definition at line 70 of file pnm_bindings_checks.hpp.

References component(), and require().

Referenced by globalShapeZyx(), and topologyShape().

◆ spacingZyx()

void pnm::binding_checks::spacingZyx ( const char * who,
const std::vector< double > & spacing )
inline

spacing_zyx: the grid's cell size per axis, three values > 0 (length units).

Definition at line 80 of file pnm_bindings_checks.hpp.

References positiveEach(), and triple().

Referenced by grid(), and NB_MODULE().

◆ grid()

void pnm::binding_checks::grid ( const char * who,
const std::vector< double > & origin,
const std::vector< double > & spacing )
inline

origin_zyx + spacing_zyx of extract_pores / extract_pore_network(_mpi).

Definition at line 85 of file pnm_bindings_checks.hpp.

References finiteEach(), spacingZyx(), and triple().

Referenced by NB_MODULE().

◆ globalShapeZyx()

void pnm::binding_checks::globalShapeZyx ( const char * who,
const std::vector< int > & shape,
bool sized )
inline

The global grid of the ORB decomposition: at least one voxel per axis.

sized = the length was already checked (mpi_block's own RuntimeError predates this round).

Definition at line 93 of file pnm_bindings_checks.hpp.

References countEach(), and triple().

Referenced by NB_MODULE().

◆ topologyShape()

void pnm::binding_checks::topologyShape ( const std::optional< std::vector< int > > & shape)
inline

extract_topology's shape_zyx, when given as three values: voxel counts >= 0 whose product fits in std::size_t (a wrapped product could match the flat array's length).

A wrong length is left to the binding's own RuntimeError.

Definition at line 102 of file pnm_bindings_checks.hpp.

References countEach(), and require().

Referenced by NB_MODULE().

◆ initPore()

void pnm::binding_checks::initPore ( Pore * p,
float x,
float y,
float z,
float radius )
inline

Pore(x, y, z, radius): a finite centre and a finite radius >= 0 (Pore() is all zeros).

Definition at line 115 of file pnm_bindings_checks.hpp.

References require().

Referenced by NB_MODULE().