mantaflow  0.10
A framework for fluid simulation
Classes | Macros | Functions | Variables
surfaceturbulence.cpp File Reference
#include <iomanip>
#include "particle.h"

Classes

struct  Manta::SurfaceTurbulence::SurfaceTurbulenceParameters
 
struct  Manta::SurfaceTurbulence::ParticleAccelGrid
 
struct  Manta::SurfaceTurbulence::PointSetWrapper
 
struct  Manta::SurfaceTurbulence::BasicParticleSystemWrapper
 
struct  Manta::SurfaceTurbulence::ParticleDataImplVec3Wrapper
 

Macros

#define LOOP_NEIGHBORS_BEGIN(points, center, radius)
 
#define LOOP_NEIGHBORS_END
 
#define LOOP_GHOSTS_POS_BEGIN(pos, radius)
 
#define LOOP_GHOSTS_POS_NORMAL_BEGIN(pos, normal, radius)
 
#define LOOP_GHOSTS_END   }
 

Functions

Real Manta::SurfaceTurbulence::triangularWeight (Real distance, Real radius)
 
Real Manta::SurfaceTurbulence::exponentialWeight (Real distance, Real radius, Real falloff)
 
Real Manta::SurfaceTurbulence::weightKernelAdvection (Real distance)
 
Real Manta::SurfaceTurbulence::weightKernelCoarseDensity (Real distance)
 
Real Manta::SurfaceTurbulence::weightSurfaceNormal (Real distance)
 
Real Manta::SurfaceTurbulence::weightSurfaceTangent (Real distance)
 
bool Manta::SurfaceTurbulence::isInDomain (Vec3 pos)
 
Real Manta::SurfaceTurbulence::smoothstep (Real edgeLeft, Real edgeRight, Real val)
 
void Manta::SurfaceTurbulence::initFines (BasicParticleSystemWrapper &coarseParticles, BasicParticleSystemWrapper &surfacePoints, FlagGrid &flags)
 
void Manta::SurfaceTurbulence::advectSurfacePoints (BasicParticleSystemWrapper &surfacePoints, BasicParticleSystemWrapper &coarseParticles, ParticleDataImplVec3Wrapper &coarseParticlesPrevPos)
 
Real Manta::SurfaceTurbulence::computeConstraintLevel (BasicParticleSystemWrapper &coarseParticles, Vec3 pos)
 
Vec3 Manta::SurfaceTurbulence::computeConstraintGradient (BasicParticleSystemWrapper &coarseParticles, Vec3 pos)
 
void Manta::SurfaceTurbulence::computeSurfaceNormals (BasicParticleSystemWrapper &surfacePoints, BasicParticleSystemWrapper &coarseParticles, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::computeAveragedNormals (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::assignNormals (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::smoothSurfaceNormals (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::addDeleteSurfacePoints (BasicParticleSystemWrapper &surfacePoints)
 
void Manta::SurfaceTurbulence::computeSurfaceDensities (BasicParticleSystemWrapper &surfacePoints, void *dummy)
 
void Manta::SurfaceTurbulence::computeSurfaceDisplacements (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::applySurfaceDisplacements (BasicParticleSystemWrapper &surfacePoints, void *dummy)
 
void Manta::SurfaceTurbulence::regularizeSurfacePoints (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::constrainSurface (BasicParticleSystemWrapper &surfacePoints, BasicParticleSystemWrapper &coarseParticles)
 
void Manta::SurfaceTurbulence::interpolateNewWaveData (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Real > &surfaceWaveH, ParticleDataImpl< Real > &surfaceWaveDtH, ParticleDataImpl< Real > &surfaceWaveSeed, ParticleDataImpl< Real > &surfaceWaveSeedAmplitude)
 
void Manta::SurfaceTurbulence::surfaceMaintenance (BasicParticleSystemWrapper &coarseParticles, BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals, ParticleDataImpl< Real > &surfaceWaveH, ParticleDataImpl< Real > &surfaceWaveDtH, ParticleDataImpl< Real > &surfaceWaveSeed, ParticleDataImpl< Real > &surfaceWaveSeedAmplitude, int nbIterations)
 
void Manta::SurfaceTurbulence::addSeed (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Real > &surfaceWaveH, ParticleDataImpl< Real > &surfaceWaveSeed)
 
void Manta::SurfaceTurbulence::computeSurfaceWaveNormal (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals, ParticleDataImpl< Real > &surfaceWaveH)
 
void Manta::SurfaceTurbulence::computeSurfaceWaveLaplacians (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals, ParticleDataImpl< Real > &surfaceWaveH)
 
void Manta::SurfaceTurbulence::evolveWave (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Real > &surfaceWaveH, ParticleDataImpl< Real > &surfaceWaveDtH, ParticleDataImpl< Real > &surfaceWaveSeed)
 
void Manta::SurfaceTurbulence::computeSurfaceCurvature (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals)
 
void Manta::SurfaceTurbulence::smoothCurvature (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Real > &surfaceWaveSource)
 
void Manta::SurfaceTurbulence::seedWaves (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Real > &surfaceWaveSeed, ParticleDataImpl< Real > &surfaceWaveSeedAmplitude, ParticleDataImpl< Real > &surfaceWaveSource)
 
void Manta::SurfaceTurbulence::surfaceWaves (BasicParticleSystemWrapper &surfacePoints, ParticleDataImpl< Vec3 > &surfaceNormals, ParticleDataImpl< Real > &surfaceWaveH, ParticleDataImpl< Real > &surfaceWaveDtH, ParticleDataImpl< Real > &surfaceWaveSource, ParticleDataImpl< Real > &surfaceWaveSeed, ParticleDataImpl< Real > &surfaceWaveSeedAmplitude)
 
PYTHON void Manta::SurfaceTurbulence::particleSurfaceTurbulence (FlagGrid &flags, BasicParticleSystem &coarseParts, ParticleDataImpl< Vec3 > &coarsePartsPrevPos, BasicParticleSystem &surfPoints, ParticleDataImpl< Vec3 > &surfaceNormals, ParticleDataImpl< Real > &surfaceWaveH, ParticleDataImpl< Real > &surfaceWaveDtH, BasicParticleSystem &surfacePointsDisplaced, ParticleDataImpl< Real > &surfaceWaveSource, ParticleDataImpl< Real > &surfaceWaveSeed, ParticleDataImpl< Real > &surfaceWaveSeedAmplitude, int res, Real outerRadius=1.0f, int surfaceDensity=20, int nbSurfaceMaintenanceIterations=4, Real dt=0.005f, Real waveSpeed=16.0f, Real waveDamping=0.0f, Real waveSeedFrequency=4, Real waveMaxAmplitude=0.25f, Real waveMaxFrequency=800, Real waveMaxSeedingAmplitude=0.5, Real waveSeedingCurvatureThresholdRegionCenter=0.025f, Real waveSeedingCurvatureThresholdRegionRadius=0.01f, Real waveSeedStepSizeRatioOfMax=0.05f)
 
PYTHON void Manta::SurfaceTurbulence::debugCheckParts (BasicParticleSystem &parts, FlagGrid &flags)
 

Variables

SurfaceTurbulenceParameters Manta::SurfaceTurbulence::params
 
ParticleAccelGrid Manta::SurfaceTurbulence::accelCoarse
 
ParticleAccelGrid Manta::SurfaceTurbulence::accelSurface
 
vector< Vec3 > Manta::SurfaceTurbulence::tempSurfaceVec3
 
vector< Real > Manta::SurfaceTurbulence::tempSurfaceFloat
 
int Manta::SurfaceTurbulence::frameCount = 0
 

Macro Definition Documentation

◆ LOOP_GHOSTS_POS_BEGIN

#define LOOP_GHOSTS_POS_BEGIN (   pos,
  radius 
)
Value:
int flagLOOPGHOSTS = -1; \
Vec3 gPos; \
while(flagLOOPGHOSTS < 6) { \
if (flagLOOPGHOSTS < 0 && pos.x - params.bndXm <= radius) { flagLOOPGHOSTS = 0; gPos = Vec3(2.f*params.bndXm - pos.x, pos.y, pos.z); } \
else if(flagLOOPGHOSTS < 1 && params.bndXp - pos.x <= radius) { flagLOOPGHOSTS = 1; gPos = Vec3(2.f*params.bndXp - pos.x, pos.y, pos.z); } \
else if(flagLOOPGHOSTS < 2 && pos.y - params.bndYm <= radius) { flagLOOPGHOSTS = 2; gPos = Vec3(pos.x, 2.f*params.bndYm - pos.y, pos.z); } \
else if(flagLOOPGHOSTS < 3 && params.bndYp - pos.y <= radius) { flagLOOPGHOSTS = 3; gPos = Vec3(pos.x, 2.f*params.bndYp - pos.y, pos.z); } \
else if(flagLOOPGHOSTS < 4 && pos.z - params.bndZm <= radius) { flagLOOPGHOSTS = 4; gPos = Vec3(pos.x, pos.y, 2.f*params.bndZm - pos.z); } \
else if(flagLOOPGHOSTS < 5 && params.bndZp - pos.Z <= radius) { flagLOOPGHOSTS = 5; gPos = Vec3(pos.x, pos.y, 2.f*params.bndZp - pos.z); } \
else { flagLOOPGHOSTS = 6; gPos = Vec3(pos.x, pos.y, pos.z); }
Vector3D< Real > Vec3
3D vector class of type Real (typically float)
Definition: randomstream.h:545

◆ LOOP_GHOSTS_POS_NORMAL_BEGIN

#define LOOP_GHOSTS_POS_NORMAL_BEGIN (   pos,
  normal,
  radius 
)
Value:
int flagLOOPGHOSTS = -1; \
Vec3 gPos, gNormal; \
while(flagLOOPGHOSTS < 6) { \
if (flagLOOPGHOSTS < 0 && pos.x - params.bndXm <= radius) { flagLOOPGHOSTS = 0; gPos = Vec3(2.f*params.bndXm - pos.x, pos.y, pos.z); gNormal = Vec3(-normal.x, normal.y, normal.z); } \
else if(flagLOOPGHOSTS < 1 && params.bndXp - pos.x <= radius) { flagLOOPGHOSTS = 1; gPos = Vec3(2.f*params.bndXp - pos.x, pos.y, pos.z); gNormal = Vec3(-normal.x, normal.y, normal.z); } \
else if(flagLOOPGHOSTS < 2 && pos.y - params.bndYm <= radius) { flagLOOPGHOSTS = 2; gPos = Vec3(pos.x, 2.f*params.bndYm - pos.y, pos.z); gNormal = Vec3( normal.x, -normal.y, normal.z); } \
else if(flagLOOPGHOSTS < 3 && params.bndYp - pos.y <= radius) { flagLOOPGHOSTS = 3; gPos = Vec3(pos.x, 2.f*params.bndYp - pos.y, pos.z); gNormal = Vec3( normal.x, -normal.y, normal.z); } \
else if(flagLOOPGHOSTS < 4 && pos.z - params.bndZm <= radius) { flagLOOPGHOSTS = 4; gPos = Vec3(pos.x, pos.y, 2.f*params.bndZm - pos.z); gNormal = Vec3( normal.x, normal.y, -normal.z); } \
else if(flagLOOPGHOSTS < 5 && params.bndZp - pos.Z <= radius) { flagLOOPGHOSTS = 5; gPos = Vec3(pos.x, pos.y, 2.f*params.bndZp - pos.z); gNormal = Vec3( normal.x, normal.y, -normal.z); } \
else { flagLOOPGHOSTS = 6; gPos = pos; gNormal = normal; }
Vector3D< Real > Vec3
3D vector class of type Real (typically float)
Definition: randomstream.h:545

◆ LOOP_NEIGHBORS_BEGIN

#define LOOP_NEIGHBORS_BEGIN (   points,
  center,
  radius 
)
Value:
int minI = clamp<int>(floor((center.x-radius)/params.res*points.accel->res), 0, points.accel->res-1); \
int maxI = clamp<int>(floor((center.x+radius)/params.res*points.accel->res), 0, points.accel->res-1); \
int minJ = clamp<int>(floor((center.y-radius)/params.res*points.accel->res), 0, points.accel->res-1); \
int maxJ = clamp<int>(floor((center.y+radius)/params.res*points.accel->res), 0, points.accel->res-1); \
int minK = clamp<int>(floor((center.z-radius)/params.res*points.accel->res), 0, points.accel->res-1); \
int maxK = clamp<int>(floor((center.z+radius)/params.res*points.accel->res), 0, points.accel->res-1); \
for(int i=minI; i<=maxI; i++) { \
for(int j=minJ; j<=maxJ; j++) { \
for(int k=minK; k<=maxK; k++) { \
for(int idLOOPNEIGHBORS=0;idLOOPNEIGHBORS<(int)points.accel->indices[i][j][k].size();idLOOPNEIGHBORS++) { \
int idn = points.accel->indices[i][j][k][idLOOPNEIGHBORS]; \
if(points.isActive(idn)) {

◆ LOOP_NEIGHBORS_END

#define LOOP_NEIGHBORS_END
Value:
} \
} \
}}}