VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
fmm::detail_interp Namespace Reference

Classes

struct  KernelTables
 

Functions

const KernelTablestables ()
 
std::pair< double, double > lookup2 (const double *tA, const double *tB, double xi)
 

Variables

static constexpr int TABLE_SIZE = 2049
 
static constexpr double XI_MAX_INTERP = 5.0
 
static constexpr double INV_STEP = (TABLE_SIZE - 1) / XI_MAX_INTERP
 

Function Documentation

◆ lookup2()

std::pair< double, double > fmm::detail_interp::lookup2 ( const double *  tA,
const double *  tB,
double  xi 
)
inline

Definition at line 197 of file simple_math.h.

197 {
198 double idx_f = xi * INV_STEP;
199 int idx = static_cast<int>(idx_f);
200 if (idx >= TABLE_SIZE - 1) idx = TABLE_SIZE - 2;
201 double frac = idx_f - idx;
202 double a = tA[idx] * (1.0 - frac) + tA[idx + 1] * frac;
203 double b = tB[idx] * (1.0 - frac) + tB[idx + 1] * frac;
204 return {a, b};
205}
static constexpr int TABLE_SIZE
static constexpr double INV_STEP

◆ tables()

const KernelTables & fmm::detail_interp::tables ( )
inline

Definition at line 192 of file simple_math.h.

192 {
193 static const KernelTables t;
194 return t;
195}

Variable Documentation

◆ INV_STEP

constexpr double fmm::detail_interp::INV_STEP = (TABLE_SIZE - 1) / XI_MAX_INTERP
staticconstexpr

Definition at line 162 of file simple_math.h.

◆ TABLE_SIZE

constexpr int fmm::detail_interp::TABLE_SIZE = 2049
staticconstexpr

Definition at line 160 of file simple_math.h.

◆ XI_MAX_INTERP

constexpr double fmm::detail_interp::XI_MAX_INTERP = 5.0
staticconstexpr

Definition at line 161 of file simple_math.h.