peclet-dem 1.1.0
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
Loading...
Searching...
No Matches
peclet::dem::binding_checks Namespace Reference

Typedefs

using F3Arg = std::array<float, 3>
 A triple: any sequence of three floats (tuple, list, (3,) array).

Functions

std::string num (double v)
void require (bool ok, const char *who, const std::string &name, const std::string &rule, double v)
void finite (const char *who, const std::string &name, double v, const char *dim)
void positive (const char *who, const std::string &name, double v, const char *dim)
void nonneg (const char *who, const std::string &name, double v, const char *dim)
void restitutionCoef (const char *who, const char *name, double v)
 A restitution coefficient: [0, 1], dimensionless.
void poissonRatio (const char *who, const char *name, double v)
 An isotropic solid's Poisson ratio: (-1, 0.5], dimensionless.
std::string component (const char *name, std::size_t i)
 Per-component forms for a triple (or a quaternion): the parameter is named name[i].
template<class T, std::size_t N>
void finiteEach (const char *who, const char *name, const std::array< T, N > &a, const char *dim)
template<class T, std::size_t N>
void positiveEach (const char *who, const char *name, const std::array< T, N > &a, const char *dim)
template<class T, std::size_t N>
void nonnegEach (const char *who, const char *name, const std::array< T, N > &a, const char *dim)
void count (const char *who, const std::string &name, std::int64_t v, std::int64_t lo)
 A count (capacity, iterations, samples per axis): an integer >= lo.
void sampleCounts (const char *who, int rx, int ry, int rz)
 A reconstruction grid's samples per axis (get_sdf_grid / export_sdf): each >= 1.
void sdfShapeArgs (const char *who, const F3Arg &origin, const F3Arg &spacing, const F3Arg &inv_inertia, float bounding_radius)
 The shared arguments of set_sdf_shape / add_sdf_shape.
void domainCorners (const F3Arg &mn, const F3Arg &mx)
 set_domain(min, max): finite corners, max > min on every axis.
void plane (const F3Arg &p, const F3Arg &n)
 add_plane: a finite point and a finite, non-zero normal.
void mpiBox (const std::tuple< double, double, double > &origin, const std::tuple< double, double, double > &extent, const std::tuple< long, long, long > &cells)
 init_mpi's global box: finite origin, positive extent, at least one ORB cell per axis.
void materialIds (const std::vector< int > &ids)

Variables

constexpr int kMaxMaterialId = peclet::dem::kMaxMaterials - 1
 Material ids index the 8-entry pair tables (narrowphase.hpp kMaxMaterials).

Typedef Documentation

◆ F3Arg

using peclet::dem::binding_checks::F3Arg = std::array<float, 3>

A triple: any sequence of three floats (tuple, list, (3,) array).

Definition at line 26 of file dem_bindings_checks.hpp.

Function Documentation

◆ num()

std::string peclet::dem::binding_checks::num ( double v)
inline

Definition at line 28 of file dem_bindings_checks.hpp.

Referenced by domainCorners(), and require().

◆ require()

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

◆ finite()

void peclet::dem::binding_checks::finite ( const char * who,
const std::string & name,
double v,
const char * dim )
inline

Definition at line 40 of file dem_bindings_checks.hpp.

References require().

Referenced by finiteEach(), and NB_MODULE().

◆ positive()

void peclet::dem::binding_checks::positive ( const char * who,
const std::string & name,
double v,
const char * dim )
inline

Definition at line 43 of file dem_bindings_checks.hpp.

References require().

Referenced by NB_MODULE(), positiveEach(), and sdfShapeArgs().

◆ nonneg()

void peclet::dem::binding_checks::nonneg ( const char * who,
const std::string & name,
double v,
const char * dim )
inline

Definition at line 46 of file dem_bindings_checks.hpp.

References require().

Referenced by NB_MODULE(), and nonnegEach().

◆ restitutionCoef()

void peclet::dem::binding_checks::restitutionCoef ( const char * who,
const char * name,
double v )
inline

A restitution coefficient: [0, 1], dimensionless.

Definition at line 50 of file dem_bindings_checks.hpp.

References require().

Referenced by NB_MODULE().

◆ poissonRatio()

void peclet::dem::binding_checks::poissonRatio ( const char * who,
const char * name,
double v )
inline

An isotropic solid's Poisson ratio: (-1, 0.5], dimensionless.

Definition at line 55 of file dem_bindings_checks.hpp.

References require().

Referenced by NB_MODULE().

◆ component()

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

Per-component forms for a triple (or a quaternion): the parameter is named name[i].

Definition at line 60 of file dem_bindings_checks.hpp.

Referenced by domainCorners(), finiteEach(), materialIds(), mpiBox(), nonnegEach(), and positiveEach().

◆ finiteEach()

template<class T, std::size_t N>
void peclet::dem::binding_checks::finiteEach ( const char * who,
const char * name,
const std::array< T, N > & a,
const char * dim )
inline

Definition at line 64 of file dem_bindings_checks.hpp.

References component(), finite(), and N.

Referenced by domainCorners(), mpiBox(), NB_MODULE(), plane(), and sdfShapeArgs().

◆ positiveEach()

template<class T, std::size_t N>
void peclet::dem::binding_checks::positiveEach ( const char * who,
const char * name,
const std::array< T, N > & a,
const char * dim )
inline

Definition at line 71 of file dem_bindings_checks.hpp.

References component(), N, and positive().

Referenced by mpiBox(), NB_MODULE(), and sdfShapeArgs().

◆ nonnegEach()

template<class T, std::size_t N>
void peclet::dem::binding_checks::nonnegEach ( const char * who,
const char * name,
const std::array< T, N > & a,
const char * dim )
inline

Definition at line 78 of file dem_bindings_checks.hpp.

References component(), N, and nonneg().

Referenced by NB_MODULE(), and sdfShapeArgs().

◆ count()

void peclet::dem::binding_checks::count ( const char * who,
const std::string & name,
std::int64_t v,
std::int64_t lo )
inline

A count (capacity, iterations, samples per axis): an integer >= lo.

Definition at line 85 of file dem_bindings_checks.hpp.

References require().

Referenced by mpiBox(), NB_MODULE(), and sampleCounts().

◆ sampleCounts()

void peclet::dem::binding_checks::sampleCounts ( const char * who,
int rx,
int ry,
int rz )
inline

A reconstruction grid's samples per axis (get_sdf_grid / export_sdf): each >= 1.

A negative count used to abort the interpreter.

Definition at line 90 of file dem_bindings_checks.hpp.

References count().

Referenced by NB_MODULE().

◆ sdfShapeArgs()

void peclet::dem::binding_checks::sdfShapeArgs ( const char * who,
const F3Arg & origin,
const F3Arg & spacing,
const F3Arg & inv_inertia,
float bounding_radius )
inline

The shared arguments of set_sdf_shape / add_sdf_shape.

Definition at line 96 of file dem_bindings_checks.hpp.

References finiteEach(), nonnegEach(), positive(), and positiveEach().

Referenced by NB_MODULE().

◆ domainCorners()

void peclet::dem::binding_checks::domainCorners ( const F3Arg & mn,
const F3Arg & mx )
inline

set_domain(min, max): finite corners, max > min on every axis.

Definition at line 104 of file dem_bindings_checks.hpp.

References component(), finiteEach(), num(), and require().

Referenced by NB_MODULE().

◆ plane()

void peclet::dem::binding_checks::plane ( const F3Arg & p,
const F3Arg & n )
inline

add_plane: a finite point and a finite, non-zero normal.

Definition at line 113 of file dem_bindings_checks.hpp.

References finiteEach(), and require().

Referenced by NB_MODULE().

◆ mpiBox()

void peclet::dem::binding_checks::mpiBox ( const std::tuple< double, double, double > & origin,
const std::tuple< double, double, double > & extent,
const std::tuple< long, long, long > & cells )
inline

init_mpi's global box: finite origin, positive extent, at least one ORB cell per axis.

Definition at line 120 of file dem_bindings_checks.hpp.

References component(), count(), finiteEach(), and positiveEach().

Referenced by NB_MODULE().

◆ materialIds()

void peclet::dem::binding_checks::materialIds ( const std::vector< int > & ids)
inline

Definition at line 135 of file dem_bindings_checks.hpp.

References component(), kMaxMaterialId, and require().

Referenced by NB_MODULE().

Variable Documentation

◆ kMaxMaterialId

int peclet::dem::binding_checks::kMaxMaterialId = peclet::dem::kMaxMaterials - 1
inlineconstexpr

Material ids index the 8-entry pair tables (narrowphase.hpp kMaxMaterials).

Definition at line 134 of file dem_bindings_checks.hpp.

Referenced by materialIds(), and NB_MODULE().