mantaflow  0.10
A framework for fluid simulation
Macros | Functions
interpol.h File Reference
#include "vectorbase.h"

Go to the source code of this file.

Macros

#define BUILD_INDEX
 
#define BUILD_INDEX_SHIFT
 

Functions

Vec3 Manta::fdTangent (const Vec3 &p0, const Vec3 &p1, const Vec3 &p2)
 
Vec3 Manta::crTangent (const Vec3 &p0, const Vec3 &p1, const Vec3 &p2)
 
Vec3 Manta::hermiteSpline (const Vec3 &p0, const Vec3 &p1, const Vec3 &m0, const Vec3 &m1, Real t)
 
template<class T >
Manta::interpol (const T *data, const Vec3i &size, const int Z, const Vec3 &pos)
 
template<int c>
Real Manta::interpolComponent (const Vec3 *data, const Vec3i &size, const int Z, const Vec3 &pos)
 
template<class T >
void Manta::setInterpol (T *data, const Vec3i &size, const int Z, const Vec3 &pos, const T &v, Real *sumBuffer)
 
Vec3 Manta::interpolMAC (const Vec3 *data, const Vec3i &size, const int Z, const Vec3 &pos)
 
void Manta::setInterpolMAC (Vec3 *data, const Vec3i &size, const int Z, const Vec3 &pos, const Vec3 &val, Vec3 *sumBuffer)
 

Macro Definition Documentation

◆ BUILD_INDEX

#define BUILD_INDEX
Value:
Real px=pos.x-0.5f, py=pos.y-0.5f, pz=pos.z-0.5f; \
int xi = (int)px; \
int yi = (int)py; \
int zi = (int)pz; \
Real s1 = px-(Real)xi, s0 = 1.-s1; \
Real t1 = py-(Real)yi, t0 = 1.-t1; \
Real f1 = pz-(Real)zi, f0 = 1.-f1; \
/* clamp to border */ \
if (px < 0.) { xi = 0; s0 = 1.0; s1 = 0.0; } \
if (py < 0.) { yi = 0; t0 = 1.0; t1 = 0.0; } \
if (pz < 0.) { zi = 0; f0 = 1.0; f1 = 0.0; } \
if (xi >= size.x-1) { xi = size.x-2; s0 = 0.0; s1 = 1.0; } \
if (yi >= size.y-1) { yi = size.y-2; t0 = 0.0; t1 = 1.0; } \
if (size.z>1) { if (zi >= size.z-1) { zi = size.z-2; f0 = 0.0; f1 = 1.0; } } \
const int X = 1; \
const int Y = size.x;

◆ BUILD_INDEX_SHIFT

#define BUILD_INDEX_SHIFT
Value:
BUILD_INDEX \
/* shifted coords */ \
int s_xi = (int)pos.x, s_yi = (int)pos.y, s_zi = (int)pos.z; \
Real s_s1 = pos.x-(Real)s_xi, s_s0 = 1.-s_s1; \
Real s_t1 = pos.y-(Real)s_yi, s_t0 = 1.-s_t1; \
Real s_f1 = pos.z-(Real)s_zi, s_f0 = 1.-s_f1; \
/* clamp to border */ \
if (pos.x < 0) { s_xi = 0; s_s0 = 1.0; s_s1 = 0.0; } \
if (pos.y < 0) { s_yi = 0; s_t0 = 1.0; s_t1 = 0.0; } \
if (pos.z < 0) { s_zi = 0; s_f0 = 1.0; s_f1 = 0.0; } \
if (s_xi >= size.x-1) { s_xi = size.x-2; s_s0 = 0.0; s_s1 = 1.0; } \
if (s_yi >= size.y-1) { s_yi = size.y-2; s_t0 = 0.0; s_t1 = 1.0; } \
if (size.z>1) { if (s_zi >= size.z-1) { s_zi = size.z-2; s_f0 = 0.0; s_f1 = 1.0; } }