flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
peclet::flow::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)
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 fraction (const char *who, const std::string &name, double v)
 A volume fraction or a dimensionless coefficient bounded by one: [0, 1].
void count (const char *who, const std::string &name, std::int64_t v, std::int64_t lo)
 A count (cells, levels, iterations): an integer >= lo.
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)
void finiteEach (const char *who, const char *name, const std::vector< double > &a, const char *dim)
template<class T, std::size_t N>
void countEach (const char *who, const char *name, const std::array< T, N > &a, std::int64_t lo)
void instanceMotion (const std::array< double, 3 > &lin, const std::array< double, 3 > &ang, const std::optional< std::array< double, 3 > > &center)
 set_instance_motion: finite velocities and, when given, a finite rotation center.
void instanceTransform (const std::array< double, 3 > &t, const std::array< double, 4 > &q)
 set_instance_transform: a finite translation and a finite quaternion.
void vofSeeds (const std::optional< std::vector< std::array< double, 4 > > > &seeds)
 enable_vof_blocks: each seed sphere (cx, cy, cz, radius) in cell units, global indices.
void propertyTable (const std::vector< double > &x, const std::vector< double > &y)
 set_property_table: finite abscissae and values.
void globalDims (const char *who, int gnx, int gny, int gnz)
 init_mpi / the global grid: at least one cell per axis.
void scalarArgs (double diffusivity, const std::optional< int > &iters)
 add_scalar: a non-negative diffusivity and, when given, at least one sweep.
template<class S>
void initCells (S *self, int nx, int ny, int nz)
 Solver(nx, ny, nz): at least one cell per axis (a negative count asked Kokkos for 16 EiB).
template<class S>
void initPhysical (S *self, std::array< long, 3 > cells, std::optional< std::array< double, 3 > > extent, std::array< double, 3 > origin, std::optional< std::array< long, 3 > > global_cells)
 Solver(cells, extent=None, origin=(0, 0, 0), global_cells=None).
template<class S>
void setRho (S &s, double rho)
template<class S>
void setMu (S &s, double mu)
 mu = 0 is admitted: the inviscid limit (scripts/pressure_h_independence.py and others use it).
template<class S>
void setDt (S &s, double dt)
template<class S>
void setVelocityResidualTolerance (S &s, double rtol)
 rtol < 0 follows the pressure solver's rtol and 0 is the legacy criterion: finite only.
template<class S>
void setBackflowStabilization (S &s, double beta)
template<class S>
void setPressureSolverParams (S &s, int iters)
template<class S>
void setPressureMultigrid (S &s, bool, int levels)
 levels = 0 is the automatic depth.
void krylovArgs (const char *who, int max_iter, double rtol)
 The three pressure drivers share the cap/tolerance pair: >= 1 iteration, rtol >= 0 (0 runs to the cap).
template<class S>
void setPressureChebyshev (S &s, bool on, int max_iter, double rtol)
template<class S>
void setPressurePcg (S &s, bool on, int max_iter, double rtol)
template<class S>
void setPressureFcg (S &s, bool on, int max_iter, double rtol)
template<class S>
void setVelocityMultigrid (S &s, bool on, int levels, int vcycles)
 The solver used to clamp levels and vcycles below 1 up to 1 silently.
template<class S>
void setBodyForce (S &s, std::array< double, 3 > force)
template<class S>
void setVofCflLimit (S &s, double value)
template<class S>
void setCapillaryCfl (S &s, double factor)
template<class S>
void setMassFluxUniform (S &s, double mdot)
 The sign is the direction (positive = evaporation): finite only.
template<class S>
void setPropertyTable (S &s, const std::string &target, const std::string &field, const std::vector< double > &x, const std::vector< double > &y)

Function Documentation

◆ num()

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

Definition at line 28 of file flow_bindings_checks.hpp.

Referenced by require().

◆ require()

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

Definition at line 33 of file flow_bindings_checks.hpp.

References num().

Referenced by count(), finite(), fraction(), nonneg(), and positive().

◆ finite()

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

◆ positive()

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

Definition at line 43 of file flow_bindings_checks.hpp.

References require().

Referenced by setCapillaryCfl(), setDt(), setRho(), setVofCflLimit(), and vofSeeds().

◆ nonneg()

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

Definition at line 46 of file flow_bindings_checks.hpp.

References require().

Referenced by krylovArgs(), scalarArgs(), and setMu().

◆ fraction()

void peclet::flow::binding_checks::fraction ( const char * who,
const std::string & name,
double v )
inline

A volume fraction or a dimensionless coefficient bounded by one: [0, 1].

Definition at line 50 of file flow_bindings_checks.hpp.

References require().

Referenced by setBackflowStabilization().

◆ count()

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

A count (cells, levels, iterations): an integer >= lo.

Definition at line 55 of file flow_bindings_checks.hpp.

References require().

Referenced by countEach(), globalDims(), initCells(), krylovArgs(), scalarArgs(), setPressureMultigrid(), setPressureSolverParams(), and setVelocityMultigrid().

◆ component()

std::string peclet::flow::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 59 of file flow_bindings_checks.hpp.

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

◆ finiteEach() [1/2]

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

◆ finiteEach() [2/2]

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

Definition at line 69 of file flow_bindings_checks.hpp.

References component(), and finite().

◆ countEach()

template<class T, std::size_t N>
void peclet::flow::binding_checks::countEach ( const char * who,
const char * name,
const std::array< T, N > & a,
std::int64_t lo )
inline

Definition at line 76 of file flow_bindings_checks.hpp.

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

Referenced by initPhysical().

◆ instanceMotion()

void peclet::flow::binding_checks::instanceMotion ( const std::array< double, 3 > & lin,
const std::array< double, 3 > & ang,
const std::optional< std::array< double, 3 > > & center )
inline

set_instance_motion: finite velocities and, when given, a finite rotation center.

Definition at line 86 of file flow_bindings_checks.hpp.

References finiteEach().

◆ instanceTransform()

void peclet::flow::binding_checks::instanceTransform ( const std::array< double, 3 > & t,
const std::array< double, 4 > & q )
inline

set_instance_transform: a finite translation and a finite quaternion.

Definition at line 95 of file flow_bindings_checks.hpp.

References finiteEach().

◆ vofSeeds()

void peclet::flow::binding_checks::vofSeeds ( const std::optional< std::vector< std::array< double, 4 > > > & seeds)
inline

enable_vof_blocks: each seed sphere (cx, cy, cz, radius) in cell units, global indices.

Definition at line 100 of file flow_bindings_checks.hpp.

References finite(), and positive().

◆ propertyTable()

void peclet::flow::binding_checks::propertyTable ( const std::vector< double > & x,
const std::vector< double > & y )
inline

set_property_table: finite abscissae and values.

Definition at line 114 of file flow_bindings_checks.hpp.

References finiteEach().

Referenced by setPropertyTable().

◆ globalDims()

void peclet::flow::binding_checks::globalDims ( const char * who,
int gnx,
int gny,
int gnz )
inline

init_mpi / the global grid: at least one cell per axis.

Definition at line 119 of file flow_bindings_checks.hpp.

References count().

◆ scalarArgs()

void peclet::flow::binding_checks::scalarArgs ( double diffusivity,
const std::optional< int > & iters )
inline

add_scalar: a non-negative diffusivity and, when given, at least one sweep.

Definition at line 125 of file flow_bindings_checks.hpp.

References count(), and nonneg().

◆ initCells()

template<class S>
void peclet::flow::binding_checks::initCells ( S * self,
int nx,
int ny,
int nz )

Solver(nx, ny, nz): at least one cell per axis (a negative count asked Kokkos for 16 EiB).

Definition at line 136 of file flow_bindings_checks.hpp.

References count().

◆ initPhysical()

template<class S>
void peclet::flow::binding_checks::initPhysical ( S * self,
std::array< long, 3 > cells,
std::optional< std::array< double, 3 > > extent,
std::array< double, 3 > origin,
std::optional< std::array< long, 3 > > global_cells )

Solver(cells, extent=None, origin=(0, 0, 0), global_cells=None).

The extent is checked by the solver (setPhysicalDomain); the cell-count message and type are the ones it always had.

Definition at line 145 of file flow_bindings_checks.hpp.

References countEach(), and finiteEach().

◆ setRho()

template<class S>
void peclet::flow::binding_checks::setRho ( S & s,
double rho )

Definition at line 162 of file flow_bindings_checks.hpp.

References positive().

◆ setMu()

template<class S>
void peclet::flow::binding_checks::setMu ( S & s,
double mu )

mu = 0 is admitted: the inviscid limit (scripts/pressure_h_independence.py and others use it).

Definition at line 168 of file flow_bindings_checks.hpp.

References nonneg().

◆ setDt()

template<class S>
void peclet::flow::binding_checks::setDt ( S & s,
double dt )

Definition at line 173 of file flow_bindings_checks.hpp.

References positive().

◆ setVelocityResidualTolerance()

template<class S>
void peclet::flow::binding_checks::setVelocityResidualTolerance ( S & s,
double rtol )

rtol < 0 follows the pressure solver's rtol and 0 is the legacy criterion: finite only.

Definition at line 179 of file flow_bindings_checks.hpp.

References finite().

◆ setBackflowStabilization()

template<class S>
void peclet::flow::binding_checks::setBackflowStabilization ( S & s,
double beta )

Definition at line 184 of file flow_bindings_checks.hpp.

References fraction().

◆ setPressureSolverParams()

template<class S>
void peclet::flow::binding_checks::setPressureSolverParams ( S & s,
int iters )

Definition at line 189 of file flow_bindings_checks.hpp.

References count().

◆ setPressureMultigrid()

template<class S>
void peclet::flow::binding_checks::setPressureMultigrid ( S & s,
bool ,
int levels )

levels = 0 is the automatic depth.

Definition at line 195 of file flow_bindings_checks.hpp.

References count().

◆ krylovArgs()

void peclet::flow::binding_checks::krylovArgs ( const char * who,
int max_iter,
double rtol )
inline

The three pressure drivers share the cap/tolerance pair: >= 1 iteration, rtol >= 0 (0 runs to the cap).

Definition at line 201 of file flow_bindings_checks.hpp.

References count(), and nonneg().

Referenced by setPressureChebyshev(), setPressureFcg(), and setPressurePcg().

◆ setPressureChebyshev()

template<class S>
void peclet::flow::binding_checks::setPressureChebyshev ( S & s,
bool on,
int max_iter,
double rtol )

Definition at line 206 of file flow_bindings_checks.hpp.

References krylovArgs().

◆ setPressurePcg()

template<class S>
void peclet::flow::binding_checks::setPressurePcg ( S & s,
bool on,
int max_iter,
double rtol )

Definition at line 211 of file flow_bindings_checks.hpp.

References krylovArgs().

◆ setPressureFcg()

template<class S>
void peclet::flow::binding_checks::setPressureFcg ( S & s,
bool on,
int max_iter,
double rtol )

Definition at line 216 of file flow_bindings_checks.hpp.

References krylovArgs().

◆ setVelocityMultigrid()

template<class S>
void peclet::flow::binding_checks::setVelocityMultigrid ( S & s,
bool on,
int levels,
int vcycles )

The solver used to clamp levels and vcycles below 1 up to 1 silently.

Definition at line 222 of file flow_bindings_checks.hpp.

References count().

◆ setBodyForce()

template<class S>
void peclet::flow::binding_checks::setBodyForce ( S & s,
std::array< double, 3 > force )

Definition at line 228 of file flow_bindings_checks.hpp.

References finiteEach().

◆ setVofCflLimit()

template<class S>
void peclet::flow::binding_checks::setVofCflLimit ( S & s,
double value )

Definition at line 233 of file flow_bindings_checks.hpp.

References positive(), and value().

◆ setCapillaryCfl()

template<class S>
void peclet::flow::binding_checks::setCapillaryCfl ( S & s,
double factor )

Definition at line 238 of file flow_bindings_checks.hpp.

References positive().

◆ setMassFluxUniform()

template<class S>
void peclet::flow::binding_checks::setMassFluxUniform ( S & s,
double mdot )

The sign is the direction (positive = evaporation): finite only.

Definition at line 244 of file flow_bindings_checks.hpp.

References finite().

◆ setPropertyTable()

template<class S>
void peclet::flow::binding_checks::setPropertyTable ( S & s,
const std::string & target,
const std::string & field,
const std::vector< double > & x,
const std::vector< double > & y )

Definition at line 249 of file flow_bindings_checks.hpp.

References propertyTable().