Welcome to SPlisHSPlasH’s documentation!¶
Getting started¶
This page should give you a short overview of SPlisHSPlasH.
SPlisHSPlasH currently consists of a simulators and different tools which are introduced in the following:
SPHSimulator¶
This application reads a SPlisHSPlasH scene file and performs a simulation of the scene.
The scene file format is explained here.
Command line options:¶
-h, –help: Print help text.
–no-cache: Disable caching of boundary samples/maps.
–state-file: Load a simulation state of the corresponding scene.
–output-dir: Output directory for log file and partio files.
–no-initial-pause: Disable caching of boundary samples/maps.
–no-gui: Disable graphical user interface. The simulation is run only in the command line without graphical output. The “stopAt” option must be set in the scene file or by the next parameter.
–stopAt arg: Sets or overwrites the stopAt parameter of the scene.
–param arg: Sets or overwrites a parameter of the scene.
Setting a fluid parameter:
: : Example: –param Fluid:viscosity:0.01
Setting a configuration parameter:
: Example: –param cflMethod:1
Hotkeys¶
Space: pause/contiunue simulation
r: reset simulation
w: wireframe rendering of meshes
i: print all field information of the selected particles to the console
s: save current simulation state
l: load simulation state (currently only Windows)
ESC: exit
Python bindings¶
SPlisHSPlasH implements bindings for python using pybind11. See the getting started guide.
Impatient installation guide¶
In order to install, simply clone the repository and run pip install on the repository. It is recommended, that you set up a virtual environment for this, because cache files will be stored in the directory of the python installation along with models and scene files.
git clone https://github.com/InteractiveComputerGraphics/SPlisHSPlasH.git
pip install SPlisHSPlasH/
Tools¶
partio2vtk¶
A tool to convert partion files in vtk files. In this way the particle data which is exported from SPlisHSPlasH can be converted to the vtk format. This is useful to import the data in ParaView for visualization.
PartioViewer¶
The simulators can export the particle simulation data using the partio file format. The PartioViewer can read such a file and render the particle data using OpenGL. This tool is able to handle multiphase data and rigid body data. It can create image sequences and movies (using ffmpeg).
To visualize a sequence of partio files or a single file, call (the index in the file name is used for the sequence):
PartioViewer fluid_data_1.bgeo
This tool is also able to read a complete output directory:
PartioViewer output/DamBreakModel
In this case the tool searches for the partio files of multiple phases in the subdirectory “partio” and for rigid body data in “rigid_bodies”.
Note: To generate videos you must tell PartioViewer where it can find the ffmpeg executable.
Command line options:¶
-h, –help: Print help
–renderSequence: Render a sequence from startFrame to endFrame as jpeg.
–renderVideo: Render a sequence from startFrame to endFrame as video.This function requires ffmpeg which must be in the PATH or the ffmpegPath parameter must be set.
–noOverwrite: Do not overwrite existing frames when using –renderSequence option. Existing frames are not loaded at all which accelerates the image sequence generation.
-o, –outdir arg: Output directory for images
–rbData arg: Rigid body data to visualize (bin file)
–ffmpegPath arg: Path of the ffmpeg excutable.
–width arg: Width of the image in pixels. (default: 1024)
–height arg: Height of the image in pixels. (default: 768)
–fps arg: Frame rate of video. (default: 25)
-r, –radius arg: Particle radius (default: 0.025)
-s, –startFrame arg: Start frame (only used if value is >= 0) (default: -1)
-e, –endFrame arg: End frame (only used if value is >= 0) (default: -1)
–colorField arg: Name of field that is used for the color. (default: velocity)
–colorMapType arg: Color map (0=None, 1=Jet, 2=Plasma) (default: 1)
–renderMinValue arg: Min value of field. (default: 0.0)
–renderMaxValue arg: Max value of field. (default: 10.0)
–camPos arg: Camera position (e.g. –camPos “0 1 5”) (default: 0 3 10)
–camLookat arg: Camera lookat (e.g. –camLookat “0 0 0”) (default: 0 0 0)
Hotkeys¶
Space: pause/contiunue simulation
r: reset simulation
w: wireframe rendering of meshes
i: print all field information of the selected particles to the console
s: save current frame as jpg image
v: generate video
j: generate image sequence
+: step to next frame
-: step to previous frame
ESC: exit
SurfaceSampling¶
A popular boundary handling method which is also implemented in SPlisHSPlasH uses a particle sampling of the surfaces of all boundary objects. This command line tool can generate such a surface sampling. Note that the same surface sampling is also integrated in the simulators and the samplings are generated automatically if they are required. However, if you want to generate a surface sampling manually, then you can use this tool.
VolumeSampling¶
The simulators can load particle data from partio files. This particle data then defines the initial configuration of the particles in the simulation. The VolumeSampling tool allows you to sample a volumetric object with particle data. This means you can load an OBJ file with a closed surface geometry and sample the interior with particles.
SPlisHSPlasH Scene Files¶
A SPlisHSPlasH scene file is a json file which can contain the following blocks:
Configuration
FluidBlocks
FluidModels
Emitters
RigidBodies
Fluid parameter block
Animation fields
Configuration¶
This part contains the general settings of the simulation and the pressure solver.
Example code:
"Configuration":
{
"pause": true,
"sim2D": false,
"timeStepSize": 0.001,
"numberOfStepsPerRenderUpdate": 2,
"particleRadius": 0.025,
"simulationMethod": 4,
"gravitation": [0.0,-9.81,0],
"cflMethod": 1,
"cflFactor": 1,
"cflMaxTimeStepSize": 0.005,
"maxIterations": 100,
"maxError": 0.01,
"maxIterationsV": 100,
"maxErrorV": 0.1,
"stiffness": 50000,
"exponent": 7,
"velocityUpdateMethod": 0,
"enableDivergenceSolver": true
}
General:¶
pause (bool): Pause simulation at beginning.
pauseAt (float): Pause simulation at the given time. When the value is negative, the simulation is not paused.
stopAt (float): Stop simulation at the given time and exit. When the value is negative, the simulation is not stopped.
cameraPosition (vec3): Initial position of the camera.
cameraLookat (vec3): Lookat point of the camera.
Visualization:¶
numberOfStepsPerRenderUpdate (int): Number of simulation steps per rendered frame
renderWalls (int):
0: None
1: Particles (all)
2: Particles (no walls)
3: Geometry (all)
4: Geometry (no walls)
Export¶
enablePartioExport (bool): Enable/disable partio export (default: false).
enableVTKExport (bool): Enable/disable VTK export (default: false).
enableRigidBodyExport (bool): Enable/disable rigid body export (default: false).
dataExportFPS (float): Frame rate of particle and rigid body export (default: 25).
particleAttributes (string): A list of attribute names separated by “;” that should be exported in the particle files (e.g. “velocity;density”) (default: “velocity”).
enableStateExport (bool): Enable/disable export of complete simulation state (default: false).
stateExportFPS (float): Frame rate of simulation state export (default: 1).
Simulation:¶
timeStepSize (float): The initial time step size used for the time integration. If you use an adaptive time stepping, this size will change during the simulation (default: 0.001).
particleRadius (float): The radius of the particls in the simulation (all have the same radius) (default: 0.025).
sim2D (bool): If this parameter is set to true, a 2D simulation is performend instead of a 3D simulation (default: false).
enableZSort (bool): Enable z-sort to improve cache hits and therefore to improve the performance (default: true).
gravitation (vec3): Vector to define the gravitational acceleration (default: [0,-9.81,0]).
maxIterations (int): Maximal number of iterations of the pressure solver (default: 100).
maxError (float): Maximal density error in percent which the pressure solver tolerates (default: 0.01).
boundaryHandlingMethod (int): The boundary handling method that is used in the simulation (default: 2, Volume Maps):
0: particle-based boundaries (Akinci et al. 2012)
1: density maps (Koschier et al. 2017)
2: volume maps (Bender et al. 2019)
simulationMethod (int): The pressure solver method used in the simulation (default: 4, DFSPH):
0: Weakly compressible SPH for free surface flows (WCSPH)
1: Predictive-corrective incompressible SPH (PCISPH)
2: Position based fluids (PBF)
3: Implicit incompressible SPH (IISPH)
4: Divergence-free smoothed particle hydrodynamics (DFSPH)
5: Projective Fluids (dynamic boundaries not supported yet)
WCSPH parameters:¶
stiffness (float): Stiffness coefficient of the equation of state.
exponent (float): Exponent in the equation of state.
PBF parameters:¶
velocityUpdateMethod (int):
0: First Order Update
1: Second Order Update
DFSPH parameters:¶
enableDivergenceSolver (bool): Turn divergence solver on/off.
maxIterationsV (int): Maximal number of iterations of the divergence solver.
maxErrorV (float): Maximal divergence error in percent which the pressure solver tolerates.
Projective Fluids parameters:¶
stiffness (float): Stiffness coefficient used by the pressure solver.
Kernel:¶
kernel (int): Kernel function used in the SPH model.
For a 3D simulation:
0: Cubic spline
1: Wendland quintic C2
2: Poly6
3: Spiky
4: Precomputed cubic spline (faster than cubic spline)
For a 2D simulation:
0: Cubic spline
1: Wendland quintic C2
gradKernel (int): Gradient of the kernel function used in the SPH model.
For a 3D simulation:
0: Cubic spline
1: Wendland quintic C2
2: Poly6
3: Spiky
4: Precomputed cubic spline (faster than cubic spline)
For a 2D simulation:
0: Cubic spline
1: Wendland quintic C2
CFL:¶
cflMethod (int): CFL method used for adaptive time stepping.
0: No adaptive time stepping
1: Use CFL condition
2: Use CFL condition and consider number of pressure solver iterations
cflFactor (float): Factor to scale the CFL time step size.
cflMinTimeStepSize (float): Min. allowed time step size.
cflMaxTimeStepSize (float): Max. allowed time step size.
FluidBlocks¶
In this part the user can define multiple axis-aligned blocks of fluid particles.
Example code:
"FluidBlocks": [
{
"denseMode": 0,
"start": [-2.0, 0.0, -1],
"end": [-0.5, 1.5, 1],
"translation": [1.0, 0.0, 0.0],
"scale": [1, 1, 1]
}
]
start (vec3): Minimum corrdinate of the box which defines the fluid block.
end (vec3): Maximum corrdinate of the box which defines the fluid block.
translation (vec3): Translation vector of the block.
scale (vec3): Scaling vector of the block.
denseMode (int):
0: regular sampling
1: more dense sampling
2: dense sampling
initialVelocity (vec3): The initial velocity is set for all particles in the block.
id (string): This id is used in the “Fluid parameter block” (see below) to define the properties of the fluid block. If no id is defined, then the standard id “Fluid” is used.
FluidModels¶
This part can be used to import one or more partio particle files in the scene.
Example code:
"FluidModels": [
{
"particleFile": "../models/bunny.bgeo",
"translation": [-2.0, 0.1, 0.0],
"rotationAxis": [0, 1, 0],
"rotationAngle": 3.14159265359,
"scale": 1
}
]
particleFile (string): Path of the partio file which contains the particle data.
translation (vec3): Translation vector of the fluid model.
scale (vec3): Scaling vector of the fluid model.
rotationAxis (vec3): Axis used to rotate the particle data after loading.
rotationAngle (float): Rotation angle for the initial rotation of the particle data.
id: This id is used in the “Fluid parameter block” (see below) to define the properties of the fluid block. If no id is defined, then the standard id “Fluid” is used.
Emitters¶
In this part the user can define one or more emitters which generate fluid particles.
Example code:
"Emitters": [
{
"width": 5,
"height": 5,
"translation": [-1,0.75,0.0],
"rotationAxis": [0, 1, 0],
"rotationAngle": 3.1415926535897932384626433832795,
"velocity": 2,
"emitStartTime": 2,
"emitEndTime": 6,
"type": 0
}
]
type (int): Defines the shape of the emitter (default: 0).
0: box
1: circle
width (int): Width of the box or radius of the circle emitter (default: 5).
height (int): Height of the box (is only used for type 0) (default: 5).
translation (vec3): Translation vector of the emitter (default: [0,0,0]).
rotationAxis (vec3): Axis used to rotate the emitter. Note that in 2D simulations the axis is always set to [0,0,1] (default: [0,0,1]).
rotationAngle (float): Rotation angle for the initial rotation of the emitter (default: 0).
velocity (float): Initial velocity of the emitted particles in direction of the emitter (default: 1).
id: This id is used in the “Fluid parameter block” (see below) to define the properties of the fluid block. If no id is defined, then the standard id “Fluid” is used (default: “Fluid”).
emitStartTime (float): Start time of the emitter (default: 0).
emitEndTime (float): End time of the emitter (default: REAL_MAX).
RigidBodies¶
Here, the static and dynamic rigid bodies are defined which define the boundary in the scene. In case of dynamic rigid bodies, the PositionBasedDynamics library is used for their simulation. Note that in this case the PositionBasedDynamics library also reads this json scene files and picks out the relevant parts. That means if you want to define for example a hinge joint or a motor, then just use the json format of PositionBasedDynamics in this scene file.
Example code:
"RigidBodies": [
{
"geometryFile": "../models/UnitBox.obj",
"translation": [0,2,0],
"rotationAxis": [1, 0, 0],
"rotationAngle": 0,
"scale": [2.5, 4, 1.0],
"color": [0.1, 0.4, 0.6, 1.0],
"isDynamic": false,
"isWall": true,
"mapInvert": true,
"mapThickness": 0.0,
"mapResolution": [20,20,20],
"samplingMode": 1
}
]
geometryFile (string): Path to a OBJ file which contains the geometry of the body.
particleFile (string): Path to a partio file which contains a surface sampling of the body. Note that the surface sampling is done automatically if this parameter is missing.
translation (vec3): Translation vector of the rigid body.
scale (vec3): Scaling vector of the rigid body.
rotationAxis (vec3): Axis used to rotate the rigid body after loading.
rotationAngle (float): Rotation angle for the initial rotation of the rigid body.
isDynamic (bool): Defines if the body is static or dynamic.
isWall (bool): Defines if this is a wall. Walls are typically not rendered. This is the only difference.
color (vec4): RGBA color of the body.
mapInvert (bool): Invert the map when using density or volume maps, flips inside/outside (default: false)
mapThickness (float): Additional thickness of a volume or density map (default: 0.0)
mapResolution (vec3): Resolution of a volume or density map (defaut: [20,20,20])
samplingMode (int): Surface sampling mode. 0 Poisson disk sampling, 1 Regular triangle sampling (default: 0).
Materials¶
"Materials": [
{
"id": "Fluid",
"density0": 1000,
"colorField": "velocity",
"colorMapType": 1,
"renderMinValue": 0.0,
"renderMaxValue": 5.0,
"surfaceTension": 0.2,
"surfaceTensionMethod": 0,
"viscosity": 0.01,
"viscosityMethod": 1,
"vorticityMethod": 1,
"vorticity": 0.15,
"viscosityOmega": 0.05,
"inertiaInverse": 0.5,
"maxEmitterParticles": 1000,
"emitterReuseParticles": false,
"emitterBoxMin": [-4.0,-1.0,-4.0],
"emitterBoxMax": [0.0,4,4.0]
}
]
General¶
id (string): Defines the id of the material. You have to give the same id to a FluidBlock, a FluidModel or an Emitter if they should have the defined material behavior.
density0 (float): Rest density of the corresponding fluid.
Particle Coloring¶
colorField (string): Choose vector or scalar field for particle coloring.
colorMapType (int): Selection of a color map for coloring the scalar/vector field.
0: None
1: Jet
2: Plasma
renderMinValue (float): Minimal value used for color-coding the color field in the rendering process.
renderMaxValue (float): Maximal value used for color-coding the color field in the rendering process.
Viscosity¶
viscosityMethod (int): Viscosity method
0: None
1: Standard
2: XSPH
3: Bender and Koschier 2017
4: Peer et al. 2015
5: Peer et al. 2016
6: Takahashi et al. 2015 (improved)
7: Weiler et al. 2018
viscosity (float): Coefficient for the viscosity force computation
viscoMaxIter (int): (Implicit solvers) Max. iterations of the viscosity solver.
viscoMaxError (float): (Implicit solvers) Max. error of the viscosity solver.
viscoMaxIterOmega (int): (Peer et al. 2016) Max. iterations of the vorticity diffusion solver.
viscoMaxErrorOmega (float): (Peer et al. 2016) Max. error of the vorticity diffusion solver.
viscosityBoundary (float): (Weiler et al. 2018) Coefficient for the viscosity force computation at the boundary.
Vorticity¶
vorticityMethod (int): Vorticity method
0: None
1: Micropolar model
2: Vorticity confinement
vorticity (float): Coefficient for the vorticity force computation
viscosityOmega (float): (Micropolar model) Viscosity coefficient for the angular velocity field.
inertiaInverse (float): (Micropolar model) Inverse microinertia used in the micropolar model.
Drag force¶
dragMethod (int): Drag force method
0: None
1: Macklin et al. 2014
2: Gissler et al. 2017
drag (float): Coefficient for the drag force computation
Surface tension¶
surfaceTensionMethod (int): Surface tension method
0: None
1: Becker & Teschner 2007
2: Akinci et al. 2013
3: He et al. 2014
surfaceTension (float): Coefficient for the surface tension computation
Elasticity¶
elasticityMethod (int): Elasticity method
0: None
1: Becker et al. 2009
2: Peer et al. 2018
youngsModulus (float): Young’s modulus - coefficient for the stiffness of the material (default: 100000.0)
poissonsRatio (float): Poisson’s ratio - measure of the Poisson effect (default: 0.3)
alpha (float): Coefficent for zero-energy modes suppression method (default: 0.0)
elasticityMaxIter (float): (Peer et al. 2018) Maximum solver iterations (default: 100)
elasticityMaxError (float): (Peer et al. 2019) Maximum elasticity error allowed by the solver (default: 1.0e-4)
Emitters¶
maxEmitterParticles (int): Maximum number of particles the emitter generates. Note that reused particles (see below) are not counted here.
emitterReuseParticles (bool): Reuse particles if they are outside of the bounding box defined by emitterBoxMin, emitterBoxMax
emitterBoxMin (vec3): Minimum coordinates of an axis-aligned box (used in combination with emitterReuseParticles)
emitterBoxMax (vec3): Maximum coordinates of an axis-aligned box (used in combination with emitterReuseParticles)
Animation fields¶
In this part the user can define one or more animation fields which animate fluid particles. The user can define math expressions for the components of the field quantity. The typical math terms like cos,sin,… can be used.
Available expression variables:
t: Current time.
dt: Current time step size.
x, y, z: Position of the particle which is in the animation field.
vx, vy, vz: Velocity of the particle which is in the animation field.
valuex, valuey, valuez: Value of the field quantity of the particle which is in the animation field.
Example:
"particleField": "angular velocity",
"expression_x": "valuex + cos(2*t)"
This means that in each step we add cos(2*t) to the x-component of the angular velocity.
Example code:
"AnimationFields": [
{
"particleField": "velocity",
"translation": [-0.5, -0.5, 0],
"rotationAxis": [0, 0, 1],
"rotationAngle": 0.0,
"scale": [0.5, 0.25, 0.8],
"shapeType": 0,
"expression_x": "cos(2*t)*0.1",
"expression_y": "",
"expression_z": ""
}
]
shapeType (int): Defines the shape of the animation field (default: 0).
0: box
1: sphere
2: cylinder
particleField (string): Defines the field quantity that should be modified by the field (e.g. velocity, angular velocity, position) (default: velocity)
translation (vec3): Translation vector of the animation field (default: [0,0,0]).
rotationAxis (vec3): Axis used to rotate the animation field (default: [0,0,1]).
rotationAngle (float): Rotation angle for the initial rotation of the animation field (default: 0).
scale (vec3): Scaling vector of the animation field.
shapeType=0 (box): This vector defines the width, height, depth of the box.
shapeType=1 (sphere): The x-component of the vector defines the radius of the sphere. The other components are ignored.
shapeType=2 (cylinder): The x- and y-component of the vector defines the height and radius of the cylinder, repectively. The z-component is ignored.
expression_x (string): Math expression for the x-component of the field quantity (default=””).
expression_y (string): Math expression for the y-component of the field quantity (default=””).
expression_z (string): Math expression for the z-component of the field quantity (default=””).
pySPlisHSPlasH¶
Python bindings for the SPlisHSPlasH library¶
Requirements¶
Currently the generation of python bindings is only tested on
Linux Debian, gcc 8.3, Python 3.7/3.8 (Anaconda), CMake 3.13
Windows 10, Visual Studio 15/17/19, Python 3.7/3.8 (Anaconda), CMake 3.13
Note that the compiler, the python installation as well as cmake have to be available from the command line for the installation process to work. MacOS builds should work but have not been tested.
Installation¶
In order to install it is advised that you create a new virtual environment so that any faults during installation can not mess up your python installation. This is done as follows for
conda
conda create --name venv python=3.7
conda activate venv
virtualenv
python3 -m virtualenv venv --python=python3.7
source venv/bin/activate
Now you can clone the repository by
git clone https://github.com/InteractiveComputerGraphics/SPlisHSPlasH.git
And finally you should be able to install SPlisHSPlasH using pip.
The trailing slash is important otherwise pip will try to download the package, which is not supported yet at least.
Also note, that pip install SPlisHSPlasH
should be called from one directory above the cloned source directory and not within the directory itself.
pip install SPlisHSPlasH/
While pip install
is useful if SPlisHSPlasH should only be installed once, for development purposes it might be more sensible to build differently.
Change into the SPlisHSPlasH directory and build a python wheel file as follows
cd SPlisHSPlasH
python setup.py bdist_wheel
pip install -I build/dist/*.whl
When building a new version of SPlisHSPlasH simply run these commands again and the installation will be updated. The compile times will be lower, because the build files from previous installations remain. If you are getting compile errors please try to compile the pysplishsplash target of the CMake project separately.
Now check your installation by running
python -c "import pysplishsplash"
Note: You may have to install numpy. Future releases may already contain numpy as a dependency.
pip install numpy
I want to see something very very quickly¶
If you’re very impatient, just run the following command after installing
splash
You will be prompted to select a preconfigured scene file which will then be run in a User Interface. For more options and functionality run. The keybindings in the GUI are the same as for the regular SPlisHSPlasH version.
splash --help
Minimal working example¶
The following examples should work, if SPlisHSPlasH was installed correctly. If you want to load other scene files, be sure to place them into the SPlisHSPlasH data directory structure.
With GUI
import pysplishsplash as sph
def main():
base = sph.Exec.SimulatorBase()
base.init()
gui = sph.GUI.Simulator_GUI_TweakBar(base)
base.setGui(gui)
base.run()
if __name__ == "__main__":
main()
Without GUI
import pysplishsplash as sph
def main():
base = sph.Exec.SimulatorBase()
base.init(useGui=False)
base.setValueFloat(base.STOP_AT, 10.0) # Important to have the dot to denote a float
base.run()
if __name__ == "__main__":
main()
Outputting the results to a specific directory without GUI
import pysplishsplash as sph
from pysplishsplash.Extras import Scenes
import os
def main():
base = sph.Exec.SimulatorBase()
output_dir = os.path.abspath("where/you/want/the/data")
base.init(useGui=False, outputDir=output_dir, sceneFile=Scenes.DoubleDamBreak)
base.setValueFloat(base.STOP_AT, 20.0) # Important to have the dot to denote a float
base.setValueBool(base.VTK_EXPORT, True)
# Uncomment the next line to set the output FPS value (must be float)
# base.setValueFloat(base.DATA_EXPORT_FPS, 10000.)
base.run()
if __name__ == "__main__":
main()
SPHSimulator.py¶
If you want to start the simulator in the same way as the C++ version, just use the SPHSimulator.py in the examples directory.
Modifying other properties¶
The bindings cover most of the public interface of the SPlisHSPlasH library. As such, it is possible to change components of the simulation dynamically. In the following example, the second cube in the well known double dam break scenario is replaced with a slightly larger cube.
import pysplishsplash
import pysplishsplash.Utilities.SceneLoaderStructs as Scene
def main():
base = pysplishsplash.Exec.SimulatorBase()
args = base.init()
gui = pysplishsplash.GUI.Simulator_GUI_TweakBar(base)
base.setGui(gui)
scene = base.getScene()
add_block = Scene.FluidBlock('Fluid', Scene.Box([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]), 0, [0.0, 0.0, 0.0])
scene.fluidBlocks[1] = add_block # In Place construction not supported yet
base.run()
if __name__ == "__main__":
main()
Creating Scenes¶
Loading the empty scene¶
Right now the easiest way to create a custom scene without specifying a Scene.json
file, is to load the predefined empty scene.
import pysplishsplash as sph
import pysplishsplash.Utilities.SceneLoaderStructs as Scenes
base = sph.Exec.SimulatorBase()
base.init(sceneFile=Scenes.Empty)
This scene will set the default simulation method to be DFSPH
and some other default values, which can all be changed later on.
Recreating the double dam break scenario¶
In order to recreate the double dam break scenario, we need to add a bounding box as well as two fluid cubes. The bounding box can be added as follows
scene = base.getScene()
scene.boundaryModels.append(Scenes.BoundaryData(meshFile="../models/UnitBox.obj", translation=[0., 3.0, 0.], scale=[4., 6., 4.], color=[0.1, 0.4, 0.5, 1.0], isWall=True, mapInvert=True, mapResolution=[25, 25, 25]))
The two fluid blocks can at the end be added using
scene.fluidBlocks.append(Scenes.FluidBlock(id='Fluid', box=Scenes.Box([-1.5, 0.0, -1.5], [-0.5, 2.0, -0.5]), mode=0, initialVelocity=[0.0, 0.0, 0.0]))
scene.fluidBlocks.append(Scenes.FluidBlock(id='Fluid', box=Scenes.Box([0.5, 0.0, 0.5], [1.5, 2.0, 1.5]), mode=0, initialVelocity=[0.0, 0.0, 0.0]))
This will recreate a somewhat larger scene than the default double dam break
Putting it all together¶
The following shows a script detailing how to build and run a custom double dam break. Follow the instruction from before to activate/ deactivate the GUI.
import pysplishsplash as sph
import pysplishsplash.Utilities.SceneLoaderStructs as Scenes
def main():
# Set up the simulator
base = sph.Exec.SimulatorBase()
base.init(useGui=True, sceneFile=sph.Extras.Scenes.Empty)
# Create a tweak bar simulator
gui = sph.GUI.Simulator_GUI_TweakBar(base)
base.setGui(gui)
# Get the scene and add objects
scene = base.getScene()
scene.boundaryModels.append(Scenes.BoundaryData(meshFile="../models/UnitBox.obj", translation=[0., 3.0, 0.], scale=[4., 6., 4.], color=[0.1, 0.4, 0.5, 1.0], isWall=True, mapInvert=True, mapResolution=[25, 25, 25]))
scene.fluidBlocks.append(Scenes.FluidBlock(id='Fluid', box=Scenes.Box([-1.5, 0.0, -1.5], [-0.5, 2.0, -0.5]), mode=0, initialVelocity=[0.0, 0.0, 0.0]))
scene.fluidBlocks.append(Scenes.FluidBlock(id='Fluid', box=Scenes.Box([0.5, 0.0, 0.5], [1.5, 2.0, 1.5]), mode=0, initialVelocity=[0.0, 0.0, 0.0]))
# Run the GUI
base.run()
if __name__ == "__main__":
main()
Loading a scene from file¶
Loading a scene from a file is as simple as simply specifying a custom scene file in the init function. This must be an absolute path!
custom_scene = os.path.abspath("scene.json")
base.init(sceneFile=custom_scene)
If you want to use a gui to locate the scene file you may want to use tkinter
import tkinter as tk
from tkinter import filedialog
tk.Tk().withdraw() # Dont show main window
custom_scene = filedialog.askopenfilename()
base.init(sceneFile=custom_scene)
Restrictions¶
When modifying simulation parameters this is the recommended structure, as modification will only work after
base.initSimulation()
has been called.
base.initSimulation()
sim = sph.Simulation.getCurrent()
sim.setValue...()
base.runSimulation()
base.cleanup()
setValue...()
andgetValue...()
functions cannot accept vectors as arguments yet
Library API¶
Class Hierarchy¶
-
- Namespace Eigen
- Namespace Eigen::internal
- Namespace SPH
- Struct FieldDescription
- Class AdhesionKernel
- Class AnimationField
- Class AnimationFieldSystem
- Class BlockJacobiPreconditioner3D
- Class BoundaryModel
- Class BoundaryModel_Akinci2012
- Class BoundaryModel_Bender2019
- Class BoundaryModel_Koschier2017
- Class CohesionKernel
- Class CubicKernel
- Class CubicKernel2D
- Class DragBase
- Class DragForce_Gissler2017
- Class DragForce_Macklin2014
- Class Elasticity_Becker2009
- Class Elasticity_Peer2018
- Class ElasticityBase
- Class Emitter
- Class EmitterSystem
- Class FluidModel
- Class GaussQuadrature
- Class JacobiPreconditioner1D
- Class JacobiPreconditioner3D
- Class MathFunctions
- Class MatrixReplacement
- Class MicropolarModel_Bender2017
- Class NonPressureForceBase
- Class PoissonDiskSampling
- Class Poly6Kernel
- Template Class PrecomputedKernel
- Class RegularSampling2D
- Class RegularTriangleSampling
- Class RigidBodyObject
- Class SimpleQuadrature
- Class Simulation
- Class SimulationDataDFSPH
- Class SimulationDataIISPH
- Class SimulationDataPBF
- Class SimulationDataPCISPH
- Class SimulationDataPF
- Class SimulationDataWCSPH
- Class SpikyKernel
- Class StaticRigidBody
- Class SurfaceTension_Akinci2013
- Class SurfaceTension_Becker2007
- Class SurfaceTension_He2014
- Class SurfaceTensionBase
- Class TimeIntegration
- Class TimeManager
- Class TimeStep
- Class TimeStepDFSPH
- Class TimeStepIISPH
- Class TimeStepPBF
- Class TimeStepPCISPH
- Class TimeStepPF
- Class TimeStepWCSPH
- Class TriangleMesh
- Class Viscosity_Bender2017
- Class Viscosity_Peer2015
- Class Viscosity_Peer2016
- Class Viscosity_Standard
- Class Viscosity_Takahashi2015
- Class Viscosity_Weiler2018
- Class Viscosity_XSPH
- Class ViscosityBase
- Class VorticityBase
- Class VorticityConfinement
- Class WendlandQuinticC2Kernel
- Class WendlandQuinticC2Kernel2D
- Enum BoundaryHandlingMethods
- Enum DragMethods
- Enum ElasticityMethods
- Enum FieldType
- Enum ParticleState
- Enum SimulationMethods
- Enum SurfaceSamplingMode
- Enum SurfaceTensionMethods
- Enum ViscosityMethods
- Enum VorticityMethods
- Namespace Utilities
- Class SceneLoader
- Struct SceneLoader::AnimationFieldData
- Struct SceneLoader::BoundaryData
- Struct SceneLoader::Box
- Struct SceneLoader::EmitterData
- Struct SceneLoader::FluidBlock
- Struct SceneLoader::FluidData
- Struct SceneLoader::MaterialData
- Struct SceneLoader::Scene
- Class SDFFunctions
- Class VolumeSampling
- Class WindingNumbers
- Class SceneLoader
- Class Matrix3f8
- Class Quaternion8f
- Class Scalarf8
- Class Vector3f8
- Namespace Eigen
File Hierarchy¶
-
- Directory SPlisHSPlasH
- File AnimationField.cpp
- File AnimationField.h
- File AnimationFieldSystem.cpp
- File AnimationFieldSystem.h
- File BoundaryModel.cpp
- File BoundaryModel.h
- File BoundaryModel_Akinci2012.cpp
- File BoundaryModel_Akinci2012.h
- File BoundaryModel_Bender2019.cpp
- File BoundaryModel_Bender2019.h
- File BoundaryModel_Koschier2017.cpp
- File BoundaryModel_Koschier2017.h
- File Common.h
- File Emitter.cpp
- File Emitter.h
- File EmitterSystem.cpp
- File EmitterSystem.h
- File FluidModel.cpp
- File FluidModel.h
- File NeighborhoodSearch.h
- File NonPressureForceBase.cpp
- File NonPressureForceBase.h
- File RigidBodyObject.h
- File Simulation.cpp
- File Simulation.h
- File SPHKernels.cpp
- File SPHKernels.h
- File StaticRigidBody.h
- File TimeManager.cpp
- File TimeManager.h
- File TimeStep.cpp
- File TimeStep.h
- File TriangleMesh.cpp
- File TriangleMesh.h
- File AVX_math.h
- File DragBase.cpp
- File DragBase.h
- File DragForce_Gissler2017.cpp
- File DragForce_Gissler2017.h
- File DragForce_Macklin2014.cpp
- File DragForce_Macklin2014.h
- File Elasticity_Becker2009.cpp
- File Elasticity_Becker2009.h
- File Elasticity_Peer2018.cpp
- File Elasticity_Peer2018.h
- File ElasticityBase.cpp
- File ElasticityBase.h
- File GaussQuadrature.cpp
- File GaussQuadrature.h
- File MathFunctions.cpp
- File MathFunctions.h
- File MatrixFreeSolver.h
- File MicropolarModel_Bender2017.cpp
- File MicropolarModel_Bender2017.h
- File PoissonDiskSampling.cpp
- File PoissonDiskSampling.h
- File RegularSampling2D.cpp
- File RegularSampling2D.h
- File RegularTriangleSampling.cpp
- File RegularTriangleSampling.h
- File SceneLoader.cpp
- File SceneLoader.h
- File SDFFunctions.cpp
- File SDFFunctions.h
- File SimpleQuadrature.cpp
- File SimpleQuadrature.h
- File SimulationDataDFSPH.cpp
- File SimulationDataDFSPH.h
- File SimulationDataIISPH.cpp
- File SimulationDataIISPH.h
- File SimulationDataPBF.cpp
- File SimulationDataPBF.h
- File SimulationDataPCISPH.cpp
- File SimulationDataPCISPH.h
- File SimulationDataPF.cpp
- File SimulationDataPF.h
- File SimulationDataWCSPH.cpp
- File SimulationDataWCSPH.h
- File SurfaceSampling.h
- File SurfaceTension_Akinci2013.cpp
- File SurfaceTension_Akinci2013.h
- File SurfaceTension_Becker2007.cpp
- File SurfaceTension_Becker2007.h
- File SurfaceTension_He2014.cpp
- File SurfaceTension_He2014.h
- File SurfaceTensionBase.cpp
- File SurfaceTensionBase.h
- File TimeIntegration.cpp
- File TimeIntegration.h
- File TimeStepDFSPH.cpp
- File TimeStepDFSPH.h
- File TimeStepIISPH.cpp
- File TimeStepIISPH.h
- File TimeStepPBF.cpp
- File TimeStepPBF.h
- File TimeStepPCISPH.cpp
- File TimeStepPCISPH.h
- File TimeStepPF.cpp
- File TimeStepPF.h
- File TimeStepWCSPH.cpp
- File TimeStepWCSPH.h
- File Viscosity_Bender2017.cpp
- File Viscosity_Bender2017.h
- File Viscosity_Peer2015.cpp
- File Viscosity_Peer2015.h
- File Viscosity_Peer2016.cpp
- File Viscosity_Peer2016.h
- File Viscosity_Standard.cpp
- File Viscosity_Standard.h
- File Viscosity_Takahashi2015.cpp
- File Viscosity_Takahashi2015.h
- File Viscosity_Weiler2018.cpp
- File Viscosity_Weiler2018.h
- File Viscosity_XSPH.cpp
- File Viscosity_XSPH.h
- File ViscosityBase.cpp
- File ViscosityBase.h
- File VolumeSampling.cpp
- File VolumeSampling.h
- File VorticityBase.cpp
- File VorticityBase.h
- File VorticityConfinement.cpp
- File VorticityConfinement.h
- File WindingNumbers.cpp
- File WindingNumbers.h
- Directory SPlisHSPlasH
Full API¶
Namespaces¶
Namespace @54¶
Namespace Eigen::internal¶
Contents
Namespace GenParam¶
Namespace std¶
Classes and Structs¶
Template Struct generic_product_impl< MatrixReplacement, Rhs, SparseShape, DenseShape, GemvProduct >¶
Defined in File MatrixFreeSolver.h
Inheritance Relationships¶
public generic_product_impl_base< MatrixReplacement, Rhs, generic_product_impl< MatrixReplacement, Rhs > >
Struct Documentation¶
Template Struct traits< SPH::MatrixReplacement >¶
Defined in File MatrixFreeSolver.h
Struct Documentation¶
-
template<>
structtraits
<SPH::MatrixReplacement> : public Eigen::internal::traits<SystemMatrixType>¶
Struct PoissonDiskSampling::CellPosHasher¶
Defined in File PoissonDiskSampling.h
Nested Relationships¶
This struct is a nested type of Class PoissonDiskSampling.
Struct Documentation¶
-
struct
SPH::PoissonDiskSampling
::
CellPosHasher
¶ Public Functions
-
std::size_t
operator()
(const CellPos &k) const¶
-
std::size_t
Struct PoissonDiskSampling::HashEntry¶
Defined in File PoissonDiskSampling.h
Nested Relationships¶
This struct is a nested type of Class PoissonDiskSampling.
Struct Documentation¶
-
struct
SPH::PoissonDiskSampling
::
HashEntry
Struct to store the hash entry (spatial hashing)
Public Functions
-
HashEntry
()
Public Members
-
std::vector<unsigned int>
samples
-
unsigned int
startIndex
-
Struct PoissonDiskSampling::InitialPointInfo¶
Defined in File PoissonDiskSampling.h
Nested Relationships¶
This struct is a nested type of Class PoissonDiskSampling.
Struct Documentation¶
-
struct
SPH::PoissonDiskSampling
::
InitialPointInfo
Struct to store the information of the initial points.
Struct SceneLoader::AnimationFieldData¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct SceneLoader::BoundaryData¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct Documentation¶
-
struct
Utilities::SceneLoader
::
BoundaryData
Struct to store a boundary object.
Public Members
-
std::string
samplesFile
-
std::string
meshFile
-
Vector3r
translation
-
Matrix3r
rotation
-
Vector3r
scale
-
Real
density
-
bool
dynamic
-
bool
isWall
-
Eigen::Matrix<float, 4, 1, Eigen::DontAlign>
color
-
void *
rigidBody
-
std::string
mapFile
-
bool
mapInvert
-
Real
mapThickness
-
Eigen::Matrix<unsigned int, 3, 1, Eigen::DontAlign>
mapResolution
-
unsigned int
samplingMode
-
std::string
Struct SceneLoader::Box¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct Documentation¶
-
struct
Utilities::SceneLoader
::
Box
Struct for an AABB.
Struct SceneLoader::EmitterData¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct SceneLoader::FluidBlock¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct Documentation¶
-
struct
Utilities::SceneLoader
::
FluidBlock
Struct to store a fluid block.
Struct SceneLoader::FluidData¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct Documentation¶
-
struct
Utilities::SceneLoader
::
FluidData
Struct to store a fluid object.
Struct SceneLoader::MaterialData¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct Documentation¶
-
struct
Utilities::SceneLoader
::
MaterialData
Struct to store particle coloring information.
Struct SceneLoader::Scene¶
Defined in File SceneLoader.h
Nested Relationships¶
This struct is a nested type of Class SceneLoader.
Struct Documentation¶
-
struct
Utilities::SceneLoader
::
Scene
Struct to store scene information.
Public Members
-
std::vector<BoundaryData*>
boundaryModels
-
std::vector<FluidData*>
fluidModels
-
std::vector<FluidBlock*>
fluidBlocks
-
std::vector<EmitterData*>
emitters
-
std::vector<AnimationFieldData*>
animatedFields
-
std::vector<MaterialData*>
materials
-
Real
particleRadius
-
bool
sim2D
-
Real
timeStepSize
-
Vector3r
camPosition
-
Vector3r
camLookat
-
std::vector<BoundaryData*>
Class Quaternion8f¶
Defined in File AVX_math.h
Class Documentation¶
-
class
Quaternion8f
¶ Public Functions
-
Quaternion8f
()¶
-
const Quaternion8f
operator*
(const Quaternion8f &a) const¶
-
void
store
(std::vector<Quaternionr> &qf) const¶
-
void
set
(const std::vector<Quaternionr> &qf)¶
-
Class AnimationField¶
Defined in File AnimationField.h
Class Documentation¶
-
class
SPH
::
AnimationField
¶ Public Functions
-
AnimationField
(const std::string &particleFieldName, const Vector3r &pos, const Matrix3r &rotation, const Vector3r &scale, const std::string expression[3], const unsigned int type = 0)¶
-
~AnimationField
()¶
-
void
step
()¶
-
void
reset
()¶
Protected Functions
-
FORCE_INLINE bool inBox (const Vector3r &x, const Vector3r &xBox, const Matrix3r &rotBox, const Vector3r &scaleBox)
-
FORCE_INLINE bool inCylinder (const Vector3r &x, const Vector3r &xCyl, const Matrix3r &rotCyl, const Real h, const Real r2)
-
FORCE_INLINE bool inSphere (const Vector3r &x, const Vector3r &pos, const Matrix3r &rot, const Real radius)
-
FORCE_INLINE bool inShape (const int type, const Vector3r &x, const Vector3r &pos, const Matrix3r &rot, const Vector3r &scale)
-
Class AnimationFieldSystem¶
Defined in File AnimationFieldSystem.h
Class Documentation¶
-
class
SPH
::
AnimationFieldSystem
¶ Public Functions
-
AnimationFieldSystem
()¶
-
~AnimationFieldSystem
()¶
-
void
addAnimationField
(const std::string &particleFieldName, const Vector3r &pos, const Matrix3r &rotation, const Vector3r &scale, const std::string expression[3], const unsigned int type)¶
-
unsigned int
numAnimationFields
() const¶
-
std::vector<AnimationField*> &
getAnimationFields
()¶
-
void
step
()¶
-
void
reset
()¶
Protected Attributes
-
std::vector<AnimationField*>
m_fields
¶
-
Class BlockJacobiPreconditioner3D¶
Defined in File MatrixFreeSolver.h
Class Documentation¶
-
class
SPH
::
BlockJacobiPreconditioner3D
¶ Matrix-free 3x3 block Jacobi preconditioner
Public Types
-
enum [anonymous]¶
Values:
-
enumerator
ColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
MaxColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
-
typedef SystemMatrixType::StorageIndex
StorageIndex
¶
Public Functions
-
BlockJacobiPreconditioner3D
()¶
-
void
init
(const unsigned int dim, DiagonalMatrixElementFct fct, void *userData)¶
-
Eigen::Index
rows
() const¶
-
Eigen::Index
cols
() const¶
-
Eigen::ComputationInfo
info
()¶
-
template<typename
MatType
>
BlockJacobiPreconditioner3D &analyzePattern
(const MatType&)¶
-
template<typename
MatType
>
BlockJacobiPreconditioner3D &factorize
(const MatType &mat)¶
-
template<typename
MatType
>
BlockJacobiPreconditioner3D &compute
(const MatType &mat)¶
-
template<typename
Rhs
>
const Eigen::Solve<BlockJacobiPreconditioner3D, Rhs>solve
(const Eigen::MatrixBase<Rhs> &b) const¶
-
enum [anonymous]¶
Class BoundaryModel¶
Defined in File BoundaryModel.h
Inheritance Relationships¶
public SPH::BoundaryModel_Akinci2012
(Class BoundaryModel_Akinci2012)public SPH::BoundaryModel_Bender2019
(Class BoundaryModel_Bender2019)public SPH::BoundaryModel_Koschier2017
(Class BoundaryModel_Koschier2017)
Class Documentation¶
-
class
SPH
::
BoundaryModel
¶ The boundary model stores the information required for boundary handling.
Subclassed by SPH::BoundaryModel_Akinci2012, SPH::BoundaryModel_Bender2019, SPH::BoundaryModel_Koschier2017
Public Functions
-
BoundaryModel
()¶
-
~BoundaryModel
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
-
RigidBodyObject *
getRigidBodyObject
()¶
-
FORCE_INLINE void addForce (const Vector3r &pos, const Vector3r &f)
-
FORCE_INLINE void getPointVelocity (const Vector3r &x, Vector3r &res)
-
void
clearForceAndTorque
()¶
-
Class BoundaryModel_Akinci2012¶
Defined in File BoundaryModel_Akinci2012.h
Inheritance Relationships¶
public SPH::BoundaryModel
(Class BoundaryModel)
Class Documentation¶
-
class
SPH
::
BoundaryModel_Akinci2012
: public SPH::BoundaryModel¶ The boundary model stores the information required for boundary handling using the approach of Akinci et al. 2012 [1].
Public Functions
-
BoundaryModel_Akinci2012
()¶
-
~BoundaryModel_Akinci2012
()¶
-
unsigned int
numberOfParticles
() const¶
-
unsigned int
getPointSetIndex
() const¶
-
void
computeBoundaryVolume
()¶
-
void
resize
(const unsigned int numBoundaryParticles)¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
-
void
initModel
(RigidBodyObject *rbo, const unsigned int numBoundaryParticles, Vector3r *boundaryParticles)¶
-
FORCE_INLINE Vector3r & getPosition0 (const unsigned int i)
-
FORCE_INLINE const Vector3r & getPosition0 (const unsigned int i) const
-
FORCE_INLINE void setPosition0 (const unsigned int i, const Vector3r &pos)
-
FORCE_INLINE Vector3r & getPosition (const unsigned int i)
-
FORCE_INLINE const Vector3r & getPosition (const unsigned int i) const
-
FORCE_INLINE void setPosition (const unsigned int i, const Vector3r &pos)
-
FORCE_INLINE Vector3r & getVelocity (const unsigned int i)
-
FORCE_INLINE const Vector3r & getVelocity (const unsigned int i) const
-
FORCE_INLINE void setVelocity (const unsigned int i, const Vector3r &vel)
-
FORCE_INLINE const Real & getVolume (const unsigned int i) const
-
FORCE_INLINE Real & getVolume (const unsigned int i)
-
FORCE_INLINE void setVolume (const unsigned int i, const Real &val)
-
Class BoundaryModel_Bender2019¶
Defined in File BoundaryModel_Bender2019.h
Inheritance Relationships¶
public SPH::BoundaryModel
(Class BoundaryModel)
Class Documentation¶
-
class
SPH
::
BoundaryModel_Bender2019
: public SPH::BoundaryModel¶ The boundary model stores the information required for boundary handling using the approach of Bender et al. 2019 [10].
Public Functions
-
BoundaryModel_Bender2019
()¶
-
~BoundaryModel_Bender2019
()¶
-
void
initModel
(RigidBodyObject *rbo)¶
-
void
reset
()¶
-
Discregrid::DiscreteGrid *
getMap
()¶
-
void
setMap
(Discregrid::DiscreteGrid *map)¶
-
FORCE_INLINE const Real & getBoundaryVolume (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getBoundaryVolume (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setBoundaryVolume (const unsigned int fluidIndex, const unsigned int i, const Real &val)
-
FORCE_INLINE Vector3r & getBoundaryXj (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getBoundaryXj (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setBoundaryXj (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
Class BoundaryModel_Koschier2017¶
Defined in File BoundaryModel_Koschier2017.h
Inheritance Relationships¶
public SPH::BoundaryModel
(Class BoundaryModel)
Class Documentation¶
-
class
SPH
::
BoundaryModel_Koschier2017
: public SPH::BoundaryModel¶ The boundary model stores the information required for boundary handling using the approach of Koschier and Bender 2017 [15].
Public Functions
-
BoundaryModel_Koschier2017
()¶
-
~BoundaryModel_Koschier2017
()¶
-
void
initModel
(RigidBodyObject *rbo)¶
-
void
reset
()¶
-
Discregrid::DiscreteGrid *
getMap
()¶
-
void
setMap
(Discregrid::DiscreteGrid *map)¶
-
FORCE_INLINE const Real & getBoundaryDensity (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getBoundaryDensity (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setBoundaryDensity (const unsigned int fluidIndex, const unsigned int i, const Real &val)
-
FORCE_INLINE Vector3r & getBoundaryDensityGradient (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getBoundaryDensityGradient (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setBoundaryDensityGradient (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
FORCE_INLINE Vector3r & getBoundaryXj (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getBoundaryXj (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setBoundaryXj (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
Class CohesionKernel¶
Defined in File SPHKernels.h
Class DragBase¶
Defined in File DragBase.h
Inheritance Relationships¶
public SPH::NonPressureForceBase
(Class NonPressureForceBase)
public SPH::DragForce_Gissler2017
(Class DragForce_Gissler2017)public SPH::DragForce_Macklin2014
(Class DragForce_Macklin2014)
Class Documentation¶
-
class
SPH
::
DragBase
: public SPH::NonPressureForceBase¶ Base class for all drag force methods.
Subclassed by SPH::DragForce_Gissler2017, SPH::DragForce_Macklin2014
Public Static Attributes
-
int
DRAG_COEFFICIENT
= -1¶
Protected Functions
-
void
initParameters
()¶
-
int
Class DragForce_Gissler2017¶
Defined in File DragForce_Gissler2017.h
Inheritance Relationships¶
public SPH::DragBase
(Class DragBase)
Class DragForce_Macklin2014¶
Defined in File DragForce_Macklin2014.h
Inheritance Relationships¶
public SPH::DragBase
(Class DragBase)
Class Elasticity_Becker2009¶
Defined in File Elasticity_Becker2009.h
Inheritance Relationships¶
public SPH::ElasticityBase
(Class ElasticityBase)
Class Documentation¶
-
class
SPH
::
Elasticity_Becker2009
: public SPH::ElasticityBase¶ This class implements the corotated SPH method for deformable solids introduced by Becker et al. [4].
Public Functions
-
Elasticity_Becker2009
(FluidModel *model)¶
-
~Elasticity_Becker2009
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
Public Static Attributes
-
int
ALPHA
= -1¶
Protected Functions
-
void
initValues
()¶
-
void
computeRotations
()¶
-
void
computeStress
()¶
-
void
computeForces
()¶
-
void
initParameters
()¶
-
FORCE_INLINE void symMatTimesVec (const Vector6r &M, const Vector3r &v, Vector3r &res)
-
Class Elasticity_Peer2018¶
Defined in File Elasticity_Peer2018.h
Inheritance Relationships¶
public SPH::ElasticityBase
(Class ElasticityBase)
Class Documentation¶
-
class
SPH
::
Elasticity_Peer2018
: public SPH::ElasticityBase¶ This class implements the implicit SPH formulation for incompressible linearly elastic solids introduced by Peer et al. [21].
Public Functions
-
Elasticity_Peer2018
(FluidModel *model)¶
-
~Elasticity_Peer2018
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
Public Static Attributes
-
int
ITERATIONS
= -1¶
-
int
MAX_ITERATIONS
= -1¶
-
int
MAX_ERROR
= -1¶
-
int
ALPHA
= -1¶
Protected Types
-
typedef Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, Eigen::IdentityPreconditioner>
Solver
¶
Protected Functions
-
void
initValues
()¶
-
void
computeMatrixL
()¶
-
void
computeRotations
()¶
-
void
computeRHS
(VectorXr &rhs)¶
-
void
initParameters
()¶
-
FORCE_INLINE void symMatTimesVec (const Vector6r &M, const Vector3r &v, Vector3r &res)
-
Class ElasticityBase¶
Defined in File ElasticityBase.h
Inheritance Relationships¶
public SPH::NonPressureForceBase
(Class NonPressureForceBase)
public SPH::Elasticity_Becker2009
(Class Elasticity_Becker2009)public SPH::Elasticity_Peer2018
(Class Elasticity_Peer2018)
Class Documentation¶
-
class
SPH
::
ElasticityBase
: public SPH::NonPressureForceBase¶ Base class for all elasticity methods.
Subclassed by SPH::Elasticity_Becker2009, SPH::Elasticity_Peer2018
Protected Functions
-
void
initParameters
()¶
-
void
Class Emitter¶
Defined in File Emitter.h
Class Documentation¶
-
class
SPH
::
Emitter
¶ Public Functions
-
Emitter
(FluidModel *model, const unsigned int width, const unsigned int height, const Vector3r &pos, const Matrix3r &rotation, const Real velocity, const unsigned int type = 0)¶
-
~Emitter
()¶
-
void
emitParticles
(std::vector<unsigned int> &reusedParticles, unsigned int &indexReuse, unsigned int &numEmittedParticles)¶
-
void
emitParticlesCircle
(std::vector<unsigned int> &reusedParticles, unsigned int &indexReuse, unsigned int &numEmittedParticles)¶
-
void
step
(std::vector<unsigned int> &reusedParticles, unsigned int &indexReuse, unsigned int &numEmittedParticles)¶
-
void
reset
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
Protected Functions
-
FORCE_INLINE bool inBox (const Vector3r &x, const Vector3r &xBox, const Matrix3r &rotBox, const Vector3r &scaleBox)
-
FORCE_INLINE bool inCylinder (const Vector3r &x, const Vector3r &xCyl, const Matrix3r &rotCyl, const Real h, const Real r2)
-
Class EmitterSystem¶
Defined in File EmitterSystem.h
Class Documentation¶
-
class
SPH
::
EmitterSystem
¶ Public Functions
-
EmitterSystem
(FluidModel *model)¶
-
~EmitterSystem
()¶
-
void
enableReuseParticles
(const Vector3r &boxMin = Vector3r(-1, -1, -1), const Vector3r &boxMax = Vector3r(1, 1, 1))¶
-
void
disableReuseParticles
()¶
-
void
addEmitter
(const unsigned int width, const unsigned int height, const Vector3r &pos, const Matrix3r &rotation, const Real velocity, const unsigned int type)¶
-
unsigned int
numEmitters
() const¶
-
unsigned int
numReusedParticles
() const¶
-
unsigned int
numEmittedParticles
() const¶
-
void
step
()¶
-
void
reset
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
Protected Functions
-
void
reuseParticles
()¶
Protected Attributes
-
FluidModel *
m_model
¶
-
bool
m_reuseParticles
¶
-
unsigned int
m_numberOfEmittedParticles
¶
-
unsigned int
m_numReusedParticles
¶
-
std::vector<unsigned int>
m_reusedParticles
¶
Protected Static Attributes
-
const unsigned int
m_maxParticlesToReusePerStep
= 50000¶
-
Class FluidModel¶
Defined in File FluidModel.h
Class Documentation¶
-
class
SPH
::
FluidModel
: public ParameterObject¶ The fluid model stores the particle and simulation information.
Public Functions
-
FluidModel
()¶
-
FluidModel
(const FluidModel&) = delete¶
-
FluidModel &
operator=
(const FluidModel&) = delete¶
-
~FluidModel
()¶
-
void
init
()¶
-
std::string
getId
() const¶
-
FORCE_INLINE Real getDensity0 () const
-
unsigned int
getPointSetIndex
() const¶
-
void
addField
(const FieldDescription &field)¶
-
const std::vector<FieldDescription> &
getFields
()¶
-
const FieldDescription &
getField
(const unsigned int i)¶
-
const FieldDescription &
getField
(const std::string &name)¶
-
const unsigned int
numberOfFields
()¶
-
void
removeFieldByName
(const std::string &fieldName)¶
-
void
setNumActiveParticles
(const unsigned int num)¶
-
unsigned int
numberOfParticles
() const¶
-
EmitterSystem *
getEmitterSystem
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
initModel
(const std::string &id, const unsigned int nFluidParticles, Vector3r *fluidParticles, Vector3r *fluidVelocities, const unsigned int nMaxEmitterParticles)¶
-
const unsigned int
numParticles
() const¶
-
unsigned int
numActiveParticles
() const¶
-
unsigned int
getNumActiveParticles0
() const¶
-
void
setNumActiveParticles0
(unsigned int val)¶
-
void
emittedParticles
(const unsigned int startIndex)¶
-
int
getSurfaceTensionMethod
() const¶
-
void
setSurfaceTensionMethod
(const int val)¶
-
int
getViscosityMethod
() const¶
-
void
setViscosityMethod
(const int val)¶
-
int
getVorticityMethod
() const¶
-
void
setVorticityMethod
(const int val)¶
-
int
getDragMethod
() const¶
-
void
setDragMethod
(const int val)¶
-
int
getElasticityMethod
() const¶
-
void
setElasticityMethod
(const int val)¶
-
SurfaceTensionBase *
getSurfaceTensionBase
()¶
-
ViscosityBase *
getViscosityBase
()¶
-
VorticityBase *
getVorticityBase
()¶
-
ElasticityBase *
getElasticityBase
()¶
-
void
setDragMethodChangedCallback
(std::function<void()> const &callBackFct)¶
-
void
setSurfaceMethodChangedCallback
(std::function<void()> const &callBackFct)¶
-
void
setViscosityMethodChangedCallback
(std::function<void()> const &callBackFct)¶
-
void
setVorticityMethodChangedCallback
(std::function<void()> const &callBackFct)¶
-
void
setElasticityMethodChangedCallback
(std::function<void()> const &callBackFct)¶
-
void
computeSurfaceTension
()¶
-
void
computeViscosity
()¶
-
void
computeVorticity
()¶
-
void
computeDragForce
()¶
-
void
computeElasticity
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
-
FORCE_INLINE Vector3r & getPosition0 (const unsigned int i)
-
FORCE_INLINE const Vector3r & getPosition0 (const unsigned int i) const
-
FORCE_INLINE void setPosition0 (const unsigned int i, const Vector3r &pos)
-
FORCE_INLINE Vector3r & getPosition (const unsigned int i)
-
FORCE_INLINE const Vector3r & getPosition (const unsigned int i) const
-
FORCE_INLINE void setPosition (const unsigned int i, const Vector3r &pos)
-
FORCE_INLINE Vector3r & getVelocity (const unsigned int i)
-
FORCE_INLINE const Vector3r & getVelocity (const unsigned int i) const
-
FORCE_INLINE void setVelocity (const unsigned int i, const Vector3r &vel)
-
FORCE_INLINE Vector3r & getVelocity0 (const unsigned int i)
-
FORCE_INLINE const Vector3r & getVelocity0 (const unsigned int i) const
-
FORCE_INLINE void setVelocity0 (const unsigned int i, const Vector3r &vel)
-
FORCE_INLINE Vector3r & getAcceleration (const unsigned int i)
-
FORCE_INLINE const Vector3r & getAcceleration (const unsigned int i) const
-
FORCE_INLINE void setAcceleration (const unsigned int i, const Vector3r &accel)
-
FORCE_INLINE const Real getMass (const unsigned int i) const
-
FORCE_INLINE Real & getMass (const unsigned int i)
-
FORCE_INLINE void setMass (const unsigned int i, const Real mass)
-
FORCE_INLINE const Real & getDensity (const unsigned int i) const
-
FORCE_INLINE Real & getDensity (const unsigned int i)
-
FORCE_INLINE void setDensity (const unsigned int i, const Real &val)
-
FORCE_INLINE unsigned int & getParticleId (const unsigned int i)
-
FORCE_INLINE const unsigned int & getParticleId (const unsigned int i) const
-
FORCE_INLINE const ParticleState & getParticleState (const unsigned int i) const
-
FORCE_INLINE ParticleState & getParticleState (const unsigned int i)
-
FORCE_INLINE void setParticleState (const unsigned int i, const ParticleState &val)
-
FORCE_INLINE const Real getVolume (const unsigned int i) const
-
FORCE_INLINE Real & getVolume (const unsigned int i)
Public Static Attributes
-
int
NUM_PARTICLES
= -1¶
-
int
NUM_REUSED_PARTICLES
= -1¶
-
int
DENSITY0
= -1¶
-
int
DRAG_METHOD
= -1¶
-
int
SURFACE_TENSION_METHOD
= -1¶
-
int
VISCOSITY_METHOD
= -1¶
-
int
VORTICITY_METHOD
= -1¶
-
int
ELASTICITY_METHOD
= -1¶
-
int
ENUM_DRAG_NONE
= -1¶
-
int
ENUM_DRAG_MACKLIN2014
= -1¶
-
int
ENUM_DRAG_GISSLER2017
= -1¶
-
int
ENUM_SURFACETENSION_NONE
= -1¶
-
int
ENUM_SURFACETENSION_BECKER2007
= -1¶
-
int
ENUM_SURFACETENSION_AKINCI2013
= -1¶
-
int
ENUM_SURFACETENSION_HE2014
= -1¶
-
int
ENUM_VISCOSITY_NONE
= -1¶
-
int
ENUM_VISCOSITY_STANDARD
= -1¶
-
int
ENUM_VISCOSITY_XSPH
= -1¶
-
int
ENUM_VISCOSITY_BENDER2017
= -1¶
-
int
ENUM_VISCOSITY_PEER2015
= -1¶
-
int
ENUM_VISCOSITY_PEER2016
= -1¶
-
int
ENUM_VISCOSITY_TAKAHASHI2015
= -1¶
-
int
ENUM_VISCOSITY_WEILER2018
= -1¶
-
int
ENUM_VORTICITY_NONE
= -1¶
-
int
ENUM_VORTICITY_MICROPOLAR
= -1¶
-
int
ENUM_VORTICITY_VC
= -1¶
-
int
ENUM_ELASTICITY_NONE
= -1¶
-
int
ENUM_ELASTICITY_BECKER2009
= -1¶
-
int
ENUM_ELASTICITY_PEER2018
= -1¶
Protected Functions
-
void
initParameters
()¶
-
void
initMasses
()¶
-
void
resizeFluidParticles
(const unsigned int newSize)¶ Resize the arrays containing the particle data.
-
void
releaseFluidParticles
()¶ Release the arrays containing the particle data.
Protected Attributes
-
std::string
m_id
¶
-
EmitterSystem *
m_emitterSystem
¶
-
std::vector<unsigned int>
m_particleId
¶
-
std::vector<ParticleState>
m_particleState
¶
-
SurfaceTensionMethods
m_surfaceTensionMethod
¶
-
SurfaceTensionBase *
m_surfaceTension
¶
-
ViscosityMethods
m_viscosityMethod
¶
-
ViscosityBase *
m_viscosity
¶
-
VorticityMethods
m_vorticityMethod
¶
-
VorticityBase *
m_vorticity
¶
-
DragMethods
m_dragMethod
¶
-
ElasticityMethods
m_elasticityMethod
¶
-
ElasticityBase *
m_elasticity
¶
-
std::vector<FieldDescription>
m_fields
¶
-
std::function<void()>
m_dragMethodChanged
¶
-
std::function<void()>
m_surfaceTensionMethodChanged
¶
-
std::function<void()>
m_viscosityMethodChanged
¶
-
std::function<void()>
m_vorticityMethodChanged
¶
-
std::function<void()>
m_elasticityMethodChanged
¶
-
unsigned int
m_pointSetIndex
¶
-
unsigned int
m_numActiveParticles
¶
-
unsigned int
m_numActiveParticles0
¶
-
Class GaussQuadrature¶
Defined in File GaussQuadrature.h
Class JacobiPreconditioner1D¶
Defined in File MatrixFreeSolver.h
Class Documentation¶
-
class
SPH
::
JacobiPreconditioner1D
¶ Matrix-free Jacobi preconditioner
Public Types
-
enum [anonymous]¶
Values:
-
enumerator
ColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
MaxColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
-
typedef SystemMatrixType::StorageIndex
StorageIndex
¶
Public Functions
-
JacobiPreconditioner1D
()¶
-
void
init
(const unsigned int dim, DiagonalMatrixElementFct fct, void *userData)¶
-
Eigen::Index
rows
() const¶
-
Eigen::Index
cols
() const¶
-
Eigen::ComputationInfo
info
()¶
-
template<typename
MatType
>
JacobiPreconditioner1D &analyzePattern
(const MatType&)¶
-
template<typename
MatType
>
JacobiPreconditioner1D &factorize
(const MatType &mat)¶
-
template<typename
MatType
>
JacobiPreconditioner1D &compute
(const MatType &mat)¶
-
template<typename
Rhs
>
const Eigen::Solve<JacobiPreconditioner1D, Rhs>solve
(const Eigen::MatrixBase<Rhs> &b) const¶
Protected Attributes
-
unsigned int
m_dim
¶
-
DiagonalMatrixElementFct
m_diagonalElementFct
¶ diagonal matrix element callback
-
void *
m_userData
¶
-
VectorXr
m_invDiag
¶
-
enum [anonymous]¶
Class JacobiPreconditioner3D¶
Defined in File MatrixFreeSolver.h
Class Documentation¶
-
class
SPH
::
JacobiPreconditioner3D
¶ Matrix-free Jacobi preconditioner
Public Types
-
enum [anonymous]¶
Values:
-
enumerator
ColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
MaxColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
-
typedef SystemMatrixType::StorageIndex
StorageIndex
¶
Public Functions
-
JacobiPreconditioner3D
()¶
-
void
init
(const unsigned int dim, DiagonalMatrixElementFct fct, void *userData)¶
-
Eigen::Index
rows
() const¶
-
Eigen::Index
cols
() const¶
-
Eigen::ComputationInfo
info
()¶
-
template<typename
MatType
>
JacobiPreconditioner3D &analyzePattern
(const MatType&)¶
-
template<typename
MatType
>
JacobiPreconditioner3D &factorize
(const MatType &mat)¶
-
template<typename
MatType
>
JacobiPreconditioner3D &compute
(const MatType &mat)¶
-
template<typename
Rhs
>
const Eigen::Solve<JacobiPreconditioner3D, Rhs>solve
(const Eigen::MatrixBase<Rhs> &b) const¶
Protected Attributes
-
unsigned int
m_dim
¶
-
DiagonalMatrixElementFct
m_diagonalElementFct
¶ diagonal matrix element callback
-
void *
m_userData
¶
-
VectorXr
m_invDiag
¶
-
enum [anonymous]¶
Class MathFunctions¶
Defined in File MathFunctions.h
Class Documentation¶
-
class
SPH
::
MathFunctions
¶ Public Static Functions
-
void
extractRotation
(const Matrix3r &A, Quaternionr &q, const unsigned int maxIter)¶ Implementation of the paper:
Matthias Müller, Jan Bender, Nuttapong Chentanez and Miles Macklin, “A Robust Method to Extract the Rotational Part of Deformations”, ACM SIGGRAPH Motion in Games, 2016
-
void
svdWithInversionHandling
(const Matrix3r &A, Vector3r &sigma, Matrix3r &U, Matrix3r &VT)¶ Perform a singular value decomposition of matrix A: A = U * sigma * V^T. This function returns two proper rotation matrices U and V^T which do not contain a reflection. Reflections are corrected by the inversion handling proposed by Irving et al. 2004.
-
void
Class MatrixReplacement¶
Defined in File MatrixFreeSolver.h
Class Documentation¶
-
class
SPH
::
MatrixReplacement
: public Eigen::EigenBase<MatrixReplacement>¶ Replacement of the matrix in the linear system which is required for a matrix-free solver.
Public Types
-
enum [anonymous]¶
Values:
-
enumerator
ColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
MaxColsAtCompileTime
= Eigen::Dynamic¶
-
enumerator
IsRowMajor
= false¶
-
enumerator
-
typedef int
StorageIndex
¶
Public Functions
-
Index
rows
() const¶
-
Index
cols
() const¶
-
template<typename
Rhs
>
Eigen::Product<MatrixReplacement, Rhs, Eigen::AliasFreeProduct>operator*
(const Eigen::MatrixBase<Rhs> &x) const¶
-
MatrixReplacement
(const unsigned int dim, MatrixVecProdFct fct, void *userData)¶
-
void *
getUserData
()¶
-
MatrixVecProdFct
getMatrixVecProdFct
()¶
Protected Attributes
-
unsigned int
m_dim
¶
-
void *
m_userData
¶
-
MatrixVecProdFct
m_matrixVecProdFct
¶ matrix vector product callback
-
enum [anonymous]¶
Class MicropolarModel_Bender2017¶
Defined in File MicropolarModel_Bender2017.h
Inheritance Relationships¶
public SPH::VorticityBase
(Class VorticityBase)
Class Documentation¶
-
class
SPH
::
MicropolarModel_Bender2017
: public SPH::VorticityBase¶ This class implements the micropolar material model introduced by Bender et al. [9].
Public Functions
-
MicropolarModel_Bender2017
(FluidModel *model)¶
-
~MicropolarModel_Bender2017
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE const Vector3r & getAngularAcceleration (const unsigned int i) const
-
FORCE_INLINE Vector3r & getAngularAcceleration (const unsigned int i)
-
FORCE_INLINE void setAngularAcceleration (const unsigned int i, const Vector3r &val)
-
FORCE_INLINE const Vector3r & getAngularVelocity (const unsigned int i) const
-
FORCE_INLINE Vector3r & getAngularVelocity (const unsigned int i)
-
FORCE_INLINE void setAngularVelocity (const unsigned int i, const Vector3r &val)
Protected Functions
-
void
initParameters
()¶
-
Class NonPressureForceBase¶
Defined in File NonPressureForceBase.h
Inheritance Relationships¶
public ParameterObject
public SPH::DragBase
(Class DragBase)public SPH::ElasticityBase
(Class ElasticityBase)public SPH::SurfaceTensionBase
(Class SurfaceTensionBase)public SPH::ViscosityBase
(Class ViscosityBase)public SPH::VorticityBase
(Class VorticityBase)
Class Documentation¶
-
class
SPH
::
NonPressureForceBase
: public ParameterObject¶ Base class for all non-pressure force methods.
Subclassed by SPH::DragBase, SPH::ElasticityBase, SPH::SurfaceTensionBase, SPH::ViscosityBase, SPH::VorticityBase
Public Functions
-
NonPressureForceBase
(FluidModel *model)¶
-
NonPressureForceBase
(const NonPressureForceBase&) = delete¶
-
NonPressureForceBase &
operator=
(const NonPressureForceBase&) = delete¶
-
~NonPressureForceBase
(void)¶
-
void
step
() = 0¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
emittedParticles
(const unsigned int startIndex)¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
-
FluidModel *
getModel
()¶
-
void
init
()¶
Protected Attributes
-
FluidModel *
m_model
¶
-
Class PoissonDiskSampling¶
Defined in File PoissonDiskSampling.h
Nested Relationships¶
Class Documentation¶
-
class
SPH
::
PoissonDiskSampling
¶ This class implements a Poisson disk sampling for the surface of 3D models.
Public Functions
-
PoissonDiskSampling
()¶
-
void
sampleMesh
(const unsigned int numVertices, const Vector3r *vertices, const unsigned int numFaces, const unsigned int *faces, const Real minRadius, const unsigned int numTrials, unsigned int distanceNorm, std::vector<Vector3r> &samples)¶ Performs the poisson sampling with the respective parameters. Compare http://graphics.cs.umass.edu/pubs/sa_2010.pdf
- Parameters
mesh
: mesh data of sampled bodyvertices
: vertex data of sampled datasampledVertices
: sampled vertices that will be returnedminRadius
: minimal distance of sampled verticesnumTestpointsPerFace
: # of generated test points per face of bodydistanceNorm
: 0: euclidean norm, 1: approx geodesic distancenumTrials
: # of iterations used to find samples
Public Static Functions
-
FORCE_INLINE int floor (const Real v)
-
struct
InitialPointInfo
¶ Struct to store the information of the initial points.
-
Class Poly6Kernel¶
Defined in File SPHKernels.h
Class Documentation¶
-
class
SPH
::
Poly6Kernel
¶ Poly6 kernel.
Template Class PrecomputedKernel¶
Defined in File SPHKernels.h
Class RegularSampling2D¶
Defined in File RegularSampling2D.h
Class Documentation¶
-
class
SPH
::
RegularSampling2D
¶ This class implements a per-triangle regular sampling for the surface of 3D models.
Public Functions
-
RegularSampling2D
()¶
Public Static Functions
-
void
sampleMesh
(const Matrix3r &rotation, const Vector3r &translation, const unsigned numVertices, const Vector3r *vertices, const unsigned int numFaces, const unsigned int *faces, const Real maxDistance, std::vector<Vector3r> &samples)¶ Performs the poisson sampling with the respective parameters. Compare http://graphics.cs.umass.edu/pubs/sa_2010.pdf
- Parameters
rotation
: rotation of the meshtranslation
: translation of the meshnumVertices
: number of mesh verticesvertices
: vertex data of sampled datanumFaces
: number of faces in the meshfaces
: face data of sampled meshmaxDistance
: maximal distance of sampled verticessamples
: vector to store the samples
-
Class RegularTriangleSampling¶
Defined in File RegularTriangleSampling.h
Class Documentation¶
-
class
SPH
::
RegularTriangleSampling
¶ This class implements a per-triangle regular sampling for the surface of 3D models.
Public Functions
-
RegularTriangleSampling
()¶
Public Static Functions
-
void
sampleMesh
(const unsigned int numVertices, const Vector3r *vertices, const unsigned int numFaces, const unsigned int *faces, const Real maxDistance, std::vector<Vector3r> &samples)¶ Performs the poisson sampling with the respective parameters. Compare http://graphics.cs.umass.edu/pubs/sa_2010.pdf
- Parameters
numVertices
: number of mesh verticesvertices
: vertex data of sampled datanumFaces
: number of faces in the meshfaces
: face data of sampled meshmaxDistance
: maximal distance of sampled verticessamples
: vector to store the samples
-
Class RigidBodyObject¶
Defined in File RigidBodyObject.h
Inheritance Relationships¶
public SPH::StaticRigidBody
(Class StaticRigidBody)
Class SimpleQuadrature¶
Defined in File SimpleQuadrature.h
Class Documentation¶
Class Simulation¶
Defined in File Simulation.h
Class Documentation¶
-
class
SPH
::
Simulation
: public ParameterObject¶ Class to manage the current simulation time and the time step size. This class is a singleton.
Public Types
-
typedef PrecomputedKernel<CubicKernel, 10000>
PrecomputedCubicKernel
¶
Public Functions
-
Simulation
()¶
-
Simulation
(const Simulation&) = delete¶
-
Simulation &
operator=
(const Simulation&) = delete¶
-
~Simulation
()¶
-
void
reset
()¶
-
void
addFluidModel
(const std::string &id, const unsigned int nFluidParticles, Vector3r *fluidParticles, Vector3r *fluidVelocities, const unsigned int nMaxEmitterParticles)¶
-
FluidModel *
getFluidModel
(const unsigned int index)¶
-
FluidModel *
getFluidModelFromPointSet
(const unsigned int pointSetIndex)¶
-
const unsigned int
numberOfFluidModels
() const¶
-
void
addBoundaryModel
(BoundaryModel *bm)¶
-
BoundaryModel *
getBoundaryModel
(const unsigned int index)¶
-
BoundaryModel *
getBoundaryModelFromPointSet
(const unsigned int pointSetIndex)¶
-
const unsigned int
numberOfBoundaryModels
() const¶
-
void
updateBoundaryVolume
()¶
-
AnimationFieldSystem *
getAnimationFieldSystem
()¶
-
BoundaryHandlingMethods
getBoundaryHandlingMethod
() const¶
-
void
setBoundaryHandlingMethod
(BoundaryHandlingMethods val)¶
-
int
getKernel
() const¶
-
void
setKernel
(int val)¶
-
int
getGradKernel
() const¶
-
void
setGradKernel
(int val)¶
-
FORCE_INLINE Real W_zero () const
-
FORCE_INLINE Real W (const Vector3r &r) const
-
FORCE_INLINE Vector3r gradW (const Vector3r &r)
-
int
getSimulationMethod
() const¶
-
void
setSimulationMethod
(const int val)¶
-
void
setSimulationMethodChangedCallback
(std::function<void()> const &callBackFct)¶
-
bool
is2DSimulation
()¶
-
bool
zSortEnabled
()¶
-
void
updateTimeStepSize
()¶ Update time step size depending on the chosen method.
-
void
updateTimeStepSizeCFL
()¶ Update time step size by CFL condition.
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
performNeighborhoodSearchSort
()¶
-
void
computeNonPressureForces
()¶
-
void
animateParticles
()¶
-
void
emitParticles
()¶
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
NeighborhoodSearch *
getNeighborhoodSearch
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
-
FORCE_INLINE unsigned int numberOfPointSets () const
-
FORCE_INLINE unsigned int numberOfNeighbors (const unsigned int pointSetIndex, const unsigned int neighborPointSetIndex, const unsigned int index) const
-
FORCE_INLINE unsigned int getNeighbor (const unsigned int pointSetIndex, const unsigned int neighborPointSetIndex, const unsigned int index, const unsigned int k) const
-
FORCE_INLINE const unsigned int * getNeighborList (const unsigned int pointSetIndex, const unsigned int neighborPointSetIndex, const unsigned int index) const
Public Static Functions
-
Simulation *
getCurrent
()¶
-
void
setCurrent
(Simulation *tm)¶
-
bool
hasCurrent
()¶
Public Static Attributes
-
int
SIM_2D
= -1¶
-
int
PARTICLE_RADIUS
= -1¶
-
int
GRAVITATION
= -1¶
-
int
CFL_METHOD
= -1¶
-
int
CFL_FACTOR
= -1¶
-
int
CFL_MIN_TIMESTEPSIZE
= -1¶
-
int
CFL_MAX_TIMESTEPSIZE
= -1¶
-
int
ENABLE_Z_SORT
= -1¶
-
int
KERNEL_METHOD
= -1¶
-
int
GRAD_KERNEL_METHOD
= -1¶
-
int
ENUM_KERNEL_CUBIC
= -1¶
-
int
ENUM_KERNEL_WENDLANDQUINTICC2
= -1¶
-
int
ENUM_KERNEL_POLY6
= -1¶
-
int
ENUM_KERNEL_SPIKY
= -1¶
-
int
ENUM_KERNEL_PRECOMPUTED_CUBIC
= -1¶
-
int
ENUM_KERNEL_CUBIC_2D
= -1¶
-
int
ENUM_KERNEL_WENDLANDQUINTICC2_2D
= -1¶
-
int
ENUM_GRADKERNEL_CUBIC
= -1¶
-
int
ENUM_GRADKERNEL_WENDLANDQUINTICC2
= -1¶
-
int
ENUM_GRADKERNEL_POLY6
= -1¶
-
int
ENUM_GRADKERNEL_SPIKY
= -1¶
-
int
ENUM_GRADKERNEL_PRECOMPUTED_CUBIC
= -1¶
-
int
ENUM_GRADKERNEL_CUBIC_2D
= -1¶
-
int
ENUM_GRADKERNEL_WENDLANDQUINTICC2_2D
= -1¶
-
int
SIMULATION_METHOD
= -1¶
-
int
ENUM_CFL_NONE
= -1¶
-
int
ENUM_CFL_STANDARD
= -1¶
-
int
ENUM_CFL_ITER
= -1¶
-
int
ENUM_SIMULATION_WCSPH
= -1¶
-
int
ENUM_SIMULATION_PCISPH
= -1¶
-
int
ENUM_SIMULATION_PBF
= -1¶
-
int
ENUM_SIMULATION_IISPH
= -1¶
-
int
ENUM_SIMULATION_DFSPH
= -1¶
-
int
ENUM_SIMULATION_PF
= -1¶
-
int
BOUNDARY_HANDLING_METHOD
= -1¶
-
int
ENUM_AKINCI2012
= -1¶
-
int
ENUM_KOSCHIER2017
= -1¶
-
int
ENUM_BENDER2019
= -1¶
Protected Functions
-
void
initParameters
()¶
Protected Attributes
-
std::vector<FluidModel*>
m_fluidModels
¶
-
std::vector<BoundaryModel*>
m_boundaryModels
¶
-
NeighborhoodSearch *
m_neighborhoodSearch
¶
-
AnimationFieldSystem *
m_animationFieldSystem
¶
-
int
m_cflMethod
¶
-
int
m_kernelMethod
¶
-
int
m_gradKernelMethod
¶
-
SimulationMethods
m_simulationMethod
¶
-
bool
m_sim2D
¶
-
bool
m_enableZSort
¶
-
std::function<void()>
m_simulationMethodChanged
¶
-
int
m_boundaryHandlingMethod
¶
-
typedef PrecomputedKernel<CubicKernel, 10000>
Class SimulationDataDFSPH¶
Defined in File SimulationDataDFSPH.h
Class Documentation¶
-
class
SPH
::
SimulationDataDFSPH
¶ Simulation data which is required by the method Divergence-free Smoothed Particle Hydrodynamics introduced by Bender and Koschier [5], [6].
Public Functions
-
SimulationDataDFSPH
()¶
-
~SimulationDataDFSPH
()¶
-
void
init
()¶ Initialize the arrays containing the particle data.
-
void
cleanup
()¶ Release the arrays containing the particle data.
-
void
reset
()¶ Reset the particle data.
-
void
performNeighborhoodSearchSort
()¶ Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
FORCE_INLINE const Real getFactor (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getFactor (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setFactor (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE const Real getKappa (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getKappa (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setKappa (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE const Real getKappaV (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getKappaV (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setKappaV (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE const Real getDensityAdv (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getDensityAdv (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setDensityAdv (const unsigned int fluidIndex, const unsigned int i, const Real d)
-
Class SimulationDataIISPH¶
Defined in File SimulationDataIISPH.h
Class Documentation¶
-
class
SPH
::
SimulationDataIISPH
¶ Simulation data which is required by the method Implicit Incompressible SPH introduced by Ihmsen et al. [13].
Public Functions
-
SimulationDataIISPH
()¶
-
~SimulationDataIISPH
()¶
-
void
init
()¶ Initialize the arrays containing the particle data.
-
void
cleanup
()¶ Release the arrays containing the particle data.
-
void
reset
()¶ Reset the particle data.
-
void
performNeighborhoodSearchSort
()¶ Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
FORCE_INLINE const Real getAii (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getAii (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setAii (const unsigned int fluidIndex, const unsigned int i, const Real aii)
-
FORCE_INLINE Vector3r & getDii (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getDii (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setDii (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
FORCE_INLINE Vector3r & getDij_pj (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getDij_pj (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setDij_pj (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
FORCE_INLINE const Real getDensityAdv (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getDensityAdv (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setDensityAdv (const unsigned int fluidIndex, const unsigned int i, const Real d)
-
FORCE_INLINE const Real getPressure (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getPressure (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setPressure (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE const Real getLastPressure (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getLastPressure (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setLastPressure (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE Vector3r & getPressureAccel (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getPressureAccel (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setPressureAccel (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
Protected Attributes
-
Class SimulationDataPBF¶
Defined in File SimulationDataPBF.h
Class Documentation¶
-
class
SPH
::
SimulationDataPBF
¶ Simulation data which is required by the method Position-Based Fluids introduced by Macklin and Mueller [17], [7], [8].
Public Functions
-
SimulationDataPBF
()¶
-
~SimulationDataPBF
()¶
-
void
init
()¶ Initialize the arrays containing the particle data.
-
void
cleanup
()¶ Release the arrays containing the particle data.
-
void
reset
()¶ Reset the particle data.
-
void
performNeighborhoodSearchSort
()¶ Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
FORCE_INLINE const Real & getLambda (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getLambda (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setLambda (const unsigned int fluidIndex, const unsigned int i, const Real &val)
-
FORCE_INLINE Vector3r & getDeltaX (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getDeltaX (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setDeltaX (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
FORCE_INLINE Vector3r & getLastPosition (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getLastPosition (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setLastPosition (const unsigned int fluidIndex, const unsigned int i, const Vector3r &pos)
-
FORCE_INLINE Vector3r & getOldPosition (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getOldPosition (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setOldPosition (const unsigned int fluidIndex, const unsigned int i, const Vector3r &pos)
-
Class SimulationDataPCISPH¶
Defined in File SimulationDataPCISPH.h
Class Documentation¶
-
class
SPH
::
SimulationDataPCISPH
¶ Simulation data which is required by the method Predictive-corrective Incompressible SPH introduced by Solenthaler and Pajarola [23].
Public Functions
-
SimulationDataPCISPH
()¶
-
~SimulationDataPCISPH
()¶
-
void
init
()¶ Initialize the arrays containing the particle data.
-
void
cleanup
()¶ Release the arrays containing the particle data.
-
void
reset
()¶ Reset the particle data.
-
void
performNeighborhoodSearchSort
()¶ Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
FORCE_INLINE Vector3r & getLastPosition (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getLastPosition (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setLastPosition (const unsigned int fluidIndex, const unsigned int i, const Vector3r &pos)
-
FORCE_INLINE Vector3r & getLastVelocity (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getLastVelocity (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setLastVelocity (const unsigned int fluidIndex, const unsigned int i, const Vector3r &vel)
-
FORCE_INLINE const Real getDensityAdv (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getDensityAdv (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setDensityAdv (const unsigned int fluidIndex, const unsigned int i, const Real d)
-
FORCE_INLINE const Real getPressure (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getPressure (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setPressure (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE Vector3r & getPressureAccel (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getPressureAccel (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setPressureAccel (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
Class SimulationDataPF¶
Defined in File SimulationDataPF.h
Class Documentation¶
-
class
SPH
::
SimulationDataPF
¶ Simulation data which is required by the method Projective Fluids introduced by Weiler, Koschier and Bender [25].
Public Functions
-
SimulationDataPF
()¶
-
~SimulationDataPF
()¶
-
void
init
()¶ Initialize the arrays containing the particle data.
-
void
cleanup
()¶ Release the arrays containing the particle data.
-
void
reset
()¶ Reset the particle data.
-
void
performNeighborhoodSearchSort
()¶ Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
FORCE_INLINE const Vector3r getOldPosition (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Vector3r & getOldPosition (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setOldPosition (const unsigned int fluidIndex, const unsigned int i, const Vector3r p)
-
FORCE_INLINE const unsigned int getNumFluidNeighbors (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE unsigned int & getNumFluidNeighbors (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setNumFluidNeighbors (const unsigned int fluidIndex, const unsigned int i, const unsigned int n)
-
FORCE_INLINE const Vector3r & getS (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Vector3r & getS (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setS (const unsigned int fluidIndex, const unsigned int i, const Vector3r &s)
-
FORCE_INLINE const Vector3r & getDiag (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Vector3r & getDiag (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setDiag (const unsigned int fluidIndex, const unsigned int i, const Vector3r &s)
-
FORCE_INLINE const unsigned int & getParticleOffset (const unsigned int fluidIndex) const
-
Class SimulationDataWCSPH¶
Defined in File SimulationDataWCSPH.h
Class Documentation¶
-
class
SPH
::
SimulationDataWCSPH
¶ Simulation data which is required by the method Weakly Compressible SPH for Free Surface Flows introduced by Becker and Teschner [3].
Public Functions
-
SimulationDataWCSPH
()¶
-
~SimulationDataWCSPH
()¶
-
void
init
()¶ Initialize the arrays containing the particle data.
-
void
cleanup
()¶ Release the arrays containing the particle data.
-
void
reset
()¶ Reset the particle data.
-
void
performNeighborhoodSearchSort
()¶ Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
FORCE_INLINE const Real getPressure (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE Real & getPressure (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE void setPressure (const unsigned int fluidIndex, const unsigned int i, const Real p)
-
FORCE_INLINE Vector3r & getPressureAccel (const unsigned int fluidIndex, const unsigned int i)
-
FORCE_INLINE const Vector3r & getPressureAccel (const unsigned int fluidIndex, const unsigned int i) const
-
FORCE_INLINE void setPressureAccel (const unsigned int fluidIndex, const unsigned int i, const Vector3r &val)
-
Class StaticRigidBody¶
Defined in File StaticRigidBody.h
Inheritance Relationships¶
public SPH::RigidBodyObject
(Class RigidBodyObject)
Class Documentation¶
-
class
SPH
::
StaticRigidBody
: public SPH::RigidBodyObject¶ This class stores the information of a static rigid body which is not part of a rigid body simulation.
Public Functions
-
StaticRigidBody
()¶
-
bool
isDynamic
() const¶
-
const std::vector<unsigned int> &
getFaces
() const¶
-
TriangleMesh &
getGeometry
()¶
-
Class SurfaceTension_Akinci2013¶
Defined in File SurfaceTension_Akinci2013.h
Inheritance Relationships¶
public SPH::SurfaceTensionBase
(Class SurfaceTensionBase)
Class Documentation¶
-
class
SPH
::
SurfaceTension_Akinci2013
: public SPH::SurfaceTensionBase¶ This class implements the surface tension method introduced by Akinci et al. [2].
Public Functions
-
SurfaceTension_Akinci2013
(FluidModel *model)¶
-
~SurfaceTension_Akinci2013
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
computeNormals
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE Vector3r & getNormal (const unsigned int i)
-
FORCE_INLINE const Vector3r & getNormal (const unsigned int i) const
-
FORCE_INLINE void setNormal (const unsigned int i, const Vector3r &val)
-
Class SurfaceTension_Becker2007¶
Defined in File SurfaceTension_Becker2007.h
Inheritance Relationships¶
public SPH::SurfaceTensionBase
(Class SurfaceTensionBase)
Class Documentation¶
-
class
SPH
::
SurfaceTension_Becker2007
: public SPH::SurfaceTensionBase¶ This class implements the surface tension method introduced by Becker and Teschner [3].
Public Functions
-
SurfaceTension_Becker2007
(FluidModel *model)¶
-
~SurfaceTension_Becker2007
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
Class SurfaceTension_He2014¶
Defined in File SurfaceTension_He2014.h
Inheritance Relationships¶
public SPH::SurfaceTensionBase
(Class SurfaceTensionBase)
Class Documentation¶
-
class
SPH
::
SurfaceTension_He2014
: public SPH::SurfaceTensionBase¶ This class implements the surface tension method introduced by He et al. [12].
Public Functions
-
SurfaceTension_He2014
(FluidModel *model)¶
-
~SurfaceTension_He2014
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE const Real getColor (const unsigned int i) const
-
FORCE_INLINE Real & getColor (const unsigned int i)
-
FORCE_INLINE void setColor (const unsigned int i, const Real p)
-
FORCE_INLINE const Real getGradC2 (const unsigned int i) const
-
FORCE_INLINE Real & getGradC2 (const unsigned int i)
-
FORCE_INLINE void setGradC2 (const unsigned int i, const Real p)
-
Class SurfaceTensionBase¶
Defined in File SurfaceTensionBase.h
Inheritance Relationships¶
public SPH::NonPressureForceBase
(Class NonPressureForceBase)
public SPH::SurfaceTension_Akinci2013
(Class SurfaceTension_Akinci2013)public SPH::SurfaceTension_Becker2007
(Class SurfaceTension_Becker2007)public SPH::SurfaceTension_He2014
(Class SurfaceTension_He2014)
Class Documentation¶
-
class
SPH
::
SurfaceTensionBase
: public SPH::NonPressureForceBase¶ Base class for all surface tension methods.
Subclassed by SPH::SurfaceTension_Akinci2013, SPH::SurfaceTension_Becker2007, SPH::SurfaceTension_He2014
Protected Functions
-
void
initParameters
()¶
-
void
Class TimeIntegration¶
Defined in File TimeIntegration.h
Class Documentation¶
-
class
SPH
::
TimeIntegration
¶ Class for the position-based fluids time integration.
Public Static Functions
-
void
semiImplicitEuler
(const Real h, const Real mass, Vector3r &position, Vector3r &velocity, const Vector3r &acceleration)¶ Perform an integration step for a particle using the semi-implicit Euler (symplectic Euler) method:
\[\begin{split}\begin{align*} \mathbf{v}(t+h) &= \mathbf{v}(t) + \mathbf{a}(t) h\\ \mathbf{x}(t+h) &= \mathbf{x}(t) + \mathbf{v}(t+h) h \end{align*}\end{split}\]- Parameters
h
: time step sizemass
: mass of the particleposition
: position of the particlevelocity
: velocity of the particleacceleration
: acceleration of the particle
-
void
velocityUpdateFirstOrder
(const Real h, const Real mass, const Vector3r &position, const Vector3r &oldPosition, Vector3r &velocity)¶ Perform a velocity update (first order) for the linear velocity:
\[\begin{equation*} \mathbf{v}(t+h) = \frac{1}{h} (\mathbf{p}(t+h) - \mathbf{p}(t) \end{equation*}\]- Parameters
h
: time step sizemass
: mass of the particleposition
: new position \(\mathbf{p}(t+h)\) of the particleoldPosition
: position \(\mathbf{p}(t)\) of the particle before the time stepvelocity
: resulting velocity of the particle
-
void
Class TimeManager¶
Defined in File TimeManager.h
Class Documentation¶
-
class
SPH
::
TimeManager
¶ Class to manage the current simulation time and the time step size. This class is a singleton.
Public Functions
-
TimeManager
()¶
-
~TimeManager
()¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
Public Static Functions
-
TimeManager *
getCurrent
()¶
-
void
setCurrent
(TimeManager *tm)¶
-
bool
hasCurrent
()¶
-
Class TimeStep¶
Defined in File TimeStep.h
Inheritance Relationships¶
public ParameterObject
public SPH::TimeStepDFSPH
(Class TimeStepDFSPH)public SPH::TimeStepIISPH
(Class TimeStepIISPH)public SPH::TimeStepPBF
(Class TimeStepPBF)public SPH::TimeStepPCISPH
(Class TimeStepPCISPH)public SPH::TimeStepPF
(Class TimeStepPF)public SPH::TimeStepWCSPH
(Class TimeStepWCSPH)
Class Documentation¶
-
class
SPH
::
TimeStep
: public ParameterObject¶ Base class for the simulation methods.
Subclassed by SPH::TimeStepDFSPH, SPH::TimeStepIISPH, SPH::TimeStepPBF, SPH::TimeStepPCISPH, SPH::TimeStepPF, SPH::TimeStepWCSPH
Public Functions
-
TimeStep
()¶
-
~TimeStep
(void)¶
-
void
step
() = 0¶
-
void
reset
()¶
-
void
init
()¶
-
void
resize
() = 0¶
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
void
saveState
(BinaryFileWriter &binWriter)¶
-
void
loadState
(BinaryFileReader &binReader)¶
Public Static Attributes
-
int
SOLVER_ITERATIONS
= -1¶
-
int
MIN_ITERATIONS
= -1¶
-
int
MAX_ITERATIONS
= -1¶
-
int
MAX_ERROR
= -1¶
Protected Functions
-
void
clearAccelerations
(const unsigned int fluidModelIndex)¶ Clear accelerations and add gravitation.
-
void
computeDensities
(const unsigned int fluidModelIndex)¶ Determine densities of all fluid particles.
-
void
initParameters
()¶
-
void
approximateNormal
(Discregrid::DiscreteGrid *map, const Eigen::Vector3d &x, Vector3r &n, const unsigned int dim)¶
-
void
computeVolumeAndBoundaryX
(const unsigned int fluidModelIndex, const unsigned int i, const Vector3r &xi)¶
-
void
computeVolumeAndBoundaryX
()¶
-
void
computeDensityAndGradient
(const unsigned int fluidModelIndex, const unsigned int i, const Vector3r &xi)¶
-
void
computeDensityAndGradient
()¶
-
Class TimeStepDFSPH¶
Defined in File TimeStepDFSPH.h
Inheritance Relationships¶
public SPH::TimeStep
(Class TimeStep)
Class Documentation¶
-
class
SPH
::
TimeStepDFSPH
: public SPH::TimeStep¶ This class implements the Divergence-free Smoothed Particle Hydrodynamics approach introduced by Bender and Koschier [5], [6], [16].
Public Static Attributes
-
int
SOLVER_ITERATIONS_V
= -1¶
-
int
MAX_ITERATIONS_V
= -1¶
-
int
MAX_ERROR_V
= -1¶
-
int
USE_DIVERGENCE_SOLVER
= -1¶
Protected Functions
-
void
computeDFSPHFactor
(const unsigned int fluidModelIndex)¶
-
void
pressureSolve
()¶
-
void
divergenceSolve
()¶
-
void
computeDensityAdv
(const unsigned int fluidModelIndex, const unsigned int index, const int numParticles, const Real h, const Real density0)¶
-
void
computeDensityChange
(const unsigned int fluidModelIndex, const unsigned int index, const Real h)¶
-
void
warmstartDivergenceSolve
(const unsigned int fluidModelIndex)¶
-
void
warmstartPressureSolve
(const unsigned int fluidModelIndex)¶
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
void
initParameters
()¶
-
int
Class TimeStepIISPH¶
Defined in File TimeStepIISPH.h
Inheritance Relationships¶
public SPH::TimeStep
(Class TimeStep)
Class Documentation¶
-
class
SPH
::
TimeStepIISPH
: public SPH::TimeStep¶ This class implements the Implicit Incompressible SPH approach introduced by Ihmsen et al. [13].
Public Functions
-
TimeStepIISPH
()¶
-
~TimeStepIISPH
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
resize
()¶
-
const SimulationDataIISPH &
getSimulationData
()¶
Protected Functions
-
void
predictAdvection
(const unsigned int fluidModelIndex)¶
-
void
pressureSolve
()¶
-
void
integration
(const unsigned int fluidModelIndex)¶
-
void
computePressureAccels
(const unsigned int fluidModelIndex)¶ Determine the pressure accelerations when the pressure is already known.
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
Class TimeStepPBF¶
Defined in File TimeStepPBF.h
Inheritance Relationships¶
public SPH::TimeStep
(Class TimeStep)
Class Documentation¶
-
class
SPH
::
TimeStepPBF
: public SPH::TimeStep¶ This class implements the position-based fluids approach introduced by Macklin and Mueller [17], [7], [8].
Public Functions
-
TimeStepPBF
()¶ Initialize the simulation data required for this method.
-
~TimeStepPBF
(void)¶
-
void
step
()¶ Perform a simulation step.
-
void
reset
()¶ Reset the simulation method.
-
void
resize
()¶
Public Static Attributes
-
int
VELOCITY_UPDATE_METHOD
= -1¶
-
int
ENUM_PBF_FIRST_ORDER
= -1¶
-
int
ENUM_PBF_SECOND_ORDER
= -1¶
Protected Functions
-
void
pressureSolve
()¶ Perform a position-based correction step for the following density constraint:\(C(\mathbf{x}) = \left (\frac{\rho_i}{\rho_0} - 1 \right )= 0\)
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
void
initParameters
()¶
Protected Attributes
-
SimulationDataPBF
m_simulationData
¶
-
unsigned int
m_counter
¶
-
int
m_velocityUpdateMethod
¶
-
Class TimeStepPCISPH¶
Defined in File TimeStepPCISPH.h
Inheritance Relationships¶
public SPH::TimeStep
(Class TimeStep)
Class Documentation¶
-
class
SPH
::
TimeStepPCISPH
: public SPH::TimeStep¶ This class implements the Predictive-corrective Incompressible SPH approach introduced by Solenthaler and Pajarola [23].
Protected Functions
-
void
pressureSolve
()¶
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
void
Class TimeStepPF¶
Defined in File TimeStepPF.h
Inheritance Relationships¶
public SPH::TimeStep
(Class TimeStep)
Class Documentation¶
-
class
SPH
::
TimeStepPF
: public SPH::TimeStep¶ This class implements the Projective Fluids approach introduced by Weiler, Koschier and Bender [25].
Public Functions
-
TimeStepPF
()¶
-
~TimeStepPF
(void)¶
-
void
step
() override¶
-
void
reset
() override¶
-
void
resize
() override¶
Public Static Attributes
-
int
STIFFNESS
= -1¶
Protected Types
-
using
Solver
= Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, JacobiPreconditioner3D>¶
Protected Functions
-
void
preparePreconditioner
()¶
-
void
initialGuessForPositions
(const unsigned int fluidModelIndex)¶
-
void
solvePDConstraints
()¶
-
void
addAccellerationToVelocity
()¶
-
void
matrixFreeRHS
(const VectorXr &x, VectorXr &result)¶ compute the right hand side of the system in a matrix-free fashion and store the result in result
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex) override¶
-
void
initParameters
() override¶
Protected Attributes
-
SimulationDataPF
m_simulationData
¶
-
unsigned int
m_counter
¶
-
unsigned int
m_numActiveParticlesTotal
¶
Protected Static Functions
-
FORCE_INLINE void diagonalMatrixElement (const unsigned int row, Vector3r &result, void *userData)
-
Class TimeStepWCSPH¶
Defined in File TimeStepWCSPH.h
Inheritance Relationships¶
public SPH::TimeStep
(Class TimeStep)
Class Documentation¶
-
class
SPH
::
TimeStepWCSPH
: public SPH::TimeStep¶ This class implements the Weakly Compressible SPH for Free Surface Flows approach introduced by Becker and Teschner [3].
Protected Functions
-
void
computePressureAccels
(const unsigned int fluidModelIndex)¶ Determine the pressure accelerations when the pressure is already known.
-
void
performNeighborhoodSearch
()¶ Perform the neighborhood search for all fluid particles.
-
void
emittedParticles
(FluidModel *model, const unsigned int startIndex)¶
-
void
initParameters
()¶
-
void
Class TriangleMesh¶
Defined in File TriangleMesh.h
Class Documentation¶
-
class
SPH
::
TriangleMesh
¶ Data structure for a triangle mesh with normals and vertex normals.
Public Types
-
typedef std::vector<unsigned int>
Faces
¶
Public Functions
-
TriangleMesh
()¶
-
~TriangleMesh
()¶
-
void
release
()¶
-
void
initMesh
(const unsigned int nPoints, const unsigned int nFaces)¶
-
void
addFace
(const unsigned int *const indices)¶ Add a new face.
-
void
addFace
(const int *const indices)¶ Add a new face.
-
unsigned int
numVertices
() const¶
-
unsigned int
numFaces
() const¶
-
void
updateNormals
()¶
-
void
updateVertexNormals
()¶
-
typedef std::vector<unsigned int>
Class Viscosity_Bender2017¶
Defined in File Viscosity_Bender2017.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_Bender2017
: public SPH::ViscosityBase¶ This class implements the implicit simulation method for viscous fluids introduced by Bender and Koschier [6].
Public Functions
-
Viscosity_Bender2017
(FluidModel *model)¶
-
~Viscosity_Bender2017
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
void
computeTargetStrainRate
()¶
-
void
computeViscosityFactor
()¶
-
FORCE_INLINE void viscoGradientMultTransposeRightOpt (const Eigen::Matrix< Real, 6, 3 > &a, const Eigen::Matrix< Real, 6, 3 > &b, Matrix6r &c)
Matrix product
-
FORCE_INLINE const Vector6r & getTargetStrainRate (const unsigned int i) const
-
FORCE_INLINE Vector6r & getTargetStrainRate (const unsigned int i)
-
FORCE_INLINE void setTargetStrainRate (const unsigned int i, const Vector6r &val)
-
FORCE_INLINE const Matrix6r & getViscosityFactor (const unsigned int i) const
-
FORCE_INLINE Matrix6r & getViscosityFactor (const unsigned int i)
-
FORCE_INLINE void setViscosityFactor (const unsigned int i, const Matrix6r &val)
-
FORCE_INLINE const Vector6r & getViscosityLambda (const unsigned int i) const
-
FORCE_INLINE Vector6r & getViscosityLambda (const unsigned int i)
-
FORCE_INLINE void setViscosityLambda (const unsigned int i, const Vector6r &val)
Protected Functions
-
void
initParameters
()¶
-
Class Viscosity_Peer2015¶
Defined in File Viscosity_Peer2015.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_Peer2015
: public SPH::ViscosityBase¶ This class implements the implicit simulation method for viscous fluids introduced by Peer et al. [20].
Public Functions
-
Viscosity_Peer2015
(FluidModel *model)¶
-
~Viscosity_Peer2015
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE const Matrix3r & getTargetNablaV (const unsigned int i) const
-
FORCE_INLINE Matrix3r & getTargetNablaV (const unsigned int i)
-
FORCE_INLINE void setTargetNablaV (const unsigned int i, const Matrix3r &val)
Public Static Functions
-
FORCE_INLINE void diagonalMatrixElement (const unsigned int row, Real &result, void *userData)
Protected Types
-
typedef Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, JacobiPreconditioner1D>
Solver
¶
-
Class Viscosity_Peer2016¶
Defined in File Viscosity_Peer2016.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_Peer2016
: public SPH::ViscosityBase¶ This class implements the implicit simulation method for viscous fluids introduced by Peer and Teschner [19].
Public Functions
-
Viscosity_Peer2016
(FluidModel *model)¶
-
~Viscosity_Peer2016
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE const Matrix3r & getTargetNablaV (const unsigned int i) const
-
FORCE_INLINE Matrix3r & getTargetNablaV (const unsigned int i)
-
FORCE_INLINE void setTargetNablaV (const unsigned int i, const Matrix3r &val)
-
FORCE_INLINE const Vector3r & getOmega (const unsigned int i) const
-
FORCE_INLINE Vector3r & getOmega (const unsigned int i)
-
FORCE_INLINE void setOmega (const unsigned int i, const Vector3r &val)
Public Static Functions
-
FORCE_INLINE void diagonalMatrixElementV (const unsigned int row, Real &result, void *userData)
-
FORCE_INLINE void diagonalMatrixElementOmega (const unsigned int row, Real &result, void *userData)
Public Static Attributes
-
int
ITERATIONS_V
= -1¶
-
int
ITERATIONS_OMEGA
= -1¶
-
int
MAX_ITERATIONS_V
= -1¶
-
int
MAX_ERROR_V
= -1¶
-
int
MAX_ITERATIONS_OMEGA
= -1¶
-
int
MAX_ERROR_OMEGA
= -1¶
Protected Types
-
typedef Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, JacobiPreconditioner1D>
Solver
¶
-
Class Viscosity_Standard¶
Defined in File Viscosity_Standard.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_Standard
: public SPH::ViscosityBase¶ This class implements the standard method for viscosity descibed e.g. by Ihmsen et al. [14].
The method evaluates the term
\(\nu \nabla^2 \mathbf{v}\) and uses an approximation of the kernel Laplacian to improve the stability. This approximation is given in [14].Public Functions
-
Viscosity_Standard
(FluidModel *model)¶
-
~Viscosity_Standard
(void)¶
-
void
step
()¶
-
void
reset
()¶
Public Static Attributes
-
int
VISCOSITY_COEFFICIENT_BOUNDARY
= -1¶
Protected Functions
-
void
initParameters
()¶
-
Class Viscosity_Takahashi2015¶
Defined in File Viscosity_Takahashi2015.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_Takahashi2015
: public SPH::ViscosityBase¶ This class implements a variant of the implicit simulation method for viscous fluids introduced by Takahashi et al. [24]. In the original work of Takahashi et al. the second-ring neighbors are required to create the matrix of the linear system. In contrast we use a meshless conjugate gradient solver which performs the required matrix-vector multiplication in two sequential loops. In this way only the one-ring neighbors are required in each loop which increases the performance significantly.
Thanks to Anreas Peer who helped us with the implementation.
Public Functions
-
Viscosity_Takahashi2015
(FluidModel *model)¶
-
~Viscosity_Takahashi2015
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE const Matrix3r & getViscousStress (const unsigned int i) const
-
FORCE_INLINE Matrix3r & getViscousStress (const unsigned int i)
-
FORCE_INLINE void setViscousStress (const unsigned int i, const Matrix3r &val)
-
FORCE_INLINE const Vector3r & getAccel (const unsigned int i) const
-
FORCE_INLINE Vector3r & getAccel (const unsigned int i)
-
FORCE_INLINE void setAccel (const unsigned int i, const Vector3r &val)
Public Static Functions
-
FORCE_INLINE void diagonalMatrixElement (const unsigned int row, Real &result, void *userData)
Protected Types
-
typedef Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, Eigen::IdentityPreconditioner>
Solver
¶
Protected Functions
-
void
initParameters
()¶
Protected Static Functions
-
void
computeViscosityAcceleration
(Viscosity_Takahashi2015 *visco, const Real *v)¶
-
Class Viscosity_Weiler2018¶
Defined in File Viscosity_Weiler2018.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_Weiler2018
: public SPH::ViscosityBase¶ This class implements the implicit Laplace viscosity method introduced by Weiler et al. 2018 [26].
Public Functions
-
Viscosity_Weiler2018
(FluidModel *model)¶
-
~Viscosity_Weiler2018
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
Public Static Attributes
-
int
ITERATIONS
= -1¶
-
int
MAX_ITERATIONS
= -1¶
-
int
MAX_ERROR
= -1¶
-
int
VISCOSITY_COEFFICIENT_BOUNDARY
= -1¶
Protected Types
-
typedef Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, BlockJacobiPreconditioner3D>
Solver
¶
Protected Functions
-
void
initParameters
()¶
Protected Static Functions
-
FORCE_INLINE void diagonalMatrixElement (const unsigned int row, Matrix3r &result, void *userData)
-
Class Viscosity_XSPH¶
Defined in File Viscosity_XSPH.h
Inheritance Relationships¶
public SPH::ViscosityBase
(Class ViscosityBase)
Class Documentation¶
-
class
SPH
::
Viscosity_XSPH
: public SPH::ViscosityBase¶ This class implements the XSPH method descibed by Schechter and Bridson [22].
Public Functions
-
Viscosity_XSPH
(FluidModel *model)¶
-
~Viscosity_XSPH
(void)¶
-
void
step
()¶
-
void
reset
()¶
Public Static Attributes
-
int
VISCOSITY_COEFFICIENT_BOUNDARY
= -1¶
Protected Functions
-
void
initParameters
()¶
-
Class ViscosityBase¶
Defined in File ViscosityBase.h
Inheritance Relationships¶
public SPH::NonPressureForceBase
(Class NonPressureForceBase)
public SPH::Viscosity_Bender2017
(Class Viscosity_Bender2017)public SPH::Viscosity_Peer2015
(Class Viscosity_Peer2015)public SPH::Viscosity_Peer2016
(Class Viscosity_Peer2016)public SPH::Viscosity_Standard
(Class Viscosity_Standard)public SPH::Viscosity_Takahashi2015
(Class Viscosity_Takahashi2015)public SPH::Viscosity_Weiler2018
(Class Viscosity_Weiler2018)public SPH::Viscosity_XSPH
(Class Viscosity_XSPH)
Class Documentation¶
-
class
SPH
::
ViscosityBase
: public SPH::NonPressureForceBase¶ Base class for all viscosity methods.
Subclassed by SPH::Viscosity_Bender2017, SPH::Viscosity_Peer2015, SPH::Viscosity_Peer2016, SPH::Viscosity_Standard, SPH::Viscosity_Takahashi2015, SPH::Viscosity_Weiler2018, SPH::Viscosity_XSPH
Public Static Attributes
-
int
VISCOSITY_COEFFICIENT
= -1¶
Protected Functions
-
void
initParameters
()¶
-
int
Class VorticityBase¶
Defined in File VorticityBase.h
Inheritance Relationships¶
public SPH::NonPressureForceBase
(Class NonPressureForceBase)
public SPH::MicropolarModel_Bender2017
(Class MicropolarModel_Bender2017)public SPH::VorticityConfinement
(Class VorticityConfinement)
Class Documentation¶
-
class
SPH
::
VorticityBase
: public SPH::NonPressureForceBase¶ Base class for all vorticity methods.
Subclassed by SPH::MicropolarModel_Bender2017, SPH::VorticityConfinement
Public Static Attributes
-
int
VORTICITY_COEFFICIENT
= -1¶
Protected Functions
-
void
initParameters
()¶
-
int
Class VorticityConfinement¶
Defined in File VorticityConfinement.h
Inheritance Relationships¶
public SPH::VorticityBase
(Class VorticityBase)
Class Documentation¶
-
class
SPH
::
VorticityConfinement
: public SPH::VorticityBase¶ This class implements the vorticity confinement method introduced by Macklin and Mueller [17].
Public Functions
-
VorticityConfinement
(FluidModel *model)¶
-
~VorticityConfinement
(void)¶
-
void
step
()¶
-
void
reset
()¶
-
void
performNeighborhoodSearchSort
()¶
-
FORCE_INLINE const Vector3r & getAngularVelocity (const unsigned int i) const
-
FORCE_INLINE Vector3r & getAngularVelocity (const unsigned int i)
-
FORCE_INLINE void setAngularVelocity (const unsigned int i, const Vector3r &val)
-
Class SceneLoader¶
Defined in File SceneLoader.h
Nested Relationships¶
Class Documentation¶
-
class
Utilities
::
SceneLoader
¶ Importer of SPlisHSPlasH scene files.
Public Functions
-
template<typename
T
, intsize
>
boolreadVector
(const nlohmann::json &j, Eigen::Matrix<T, size, 1, Eigen::DontAlign> &vec)¶
-
template<typename
T
, intsize
>
boolreadVector
(const std::string §ion, const std::string &key, Eigen::Matrix<T, size, 1, Eigen::DontAlign> &vec)¶
-
void
readMaterialParameterObject
(const std::string &key, GenParam::ParameterObject *paramObj)¶
-
void
readParameterObject
(const std::string &key, GenParam::ParameterObject *paramObj)¶
-
template<>
boolreadValue
(const nlohmann::json &j, bool &v)¶
-
template<>
boolreadValue
(const nlohmann::json &j, bool &v)
Protected Functions
-
void
readParameterObject
(nlohmann::json &config, GenParam::ParameterObject *paramObj)¶
Protected Attributes
-
nlohmann::json
m_jsonData
¶
-
struct
AnimationFieldData
¶ Struct to store an animation field object.
-
struct
BoundaryData
¶ Struct to store a boundary object.
-
struct
Box
¶ Struct for an AABB.
-
struct
EmitterData
¶ Struct to store an emitter object.
-
struct
FluidBlock
¶ Struct to store a fluid block.
-
struct
FluidData
¶ Struct to store a fluid object.
-
struct
MaterialData
¶ Struct to store particle coloring information.
-
struct
Scene
¶ Struct to store scene information.
Public Members
-
std::vector<BoundaryData*>
boundaryModels
¶
-
std::vector<FluidBlock*>
fluidBlocks
¶
-
std::vector<EmitterData*>
emitters
¶
-
std::vector<AnimationFieldData*>
animatedFields
¶
-
std::vector<MaterialData*>
materials
¶
-
bool
sim2D
¶
-
std::vector<BoundaryData*>
-
template<typename
Class SDFFunctions¶
Defined in File SDFFunctions.h
Class Documentation¶
-
class
Utilities
::
SDFFunctions
¶ Functions for generating and querying an SDF.
Public Static Functions
-
Discregrid::CubicLagrangeDiscreteGrid *
generateSDF
(const unsigned int numVertices, const Vector3r *vertices, const unsigned int numFaces, const unsigned int *faces, const AlignedBox3r &bbox, const std::array<unsigned int, 3> &resolution, const bool invert = false)¶ Generate SDF from mesh.
-
AlignedBox3r
computeBoundingBox
(const unsigned int numVertices, const Vector3r *vertices)¶ Compute the bounding box of a mesh.
-
Discregrid::CubicLagrangeDiscreteGrid *
Class VolumeSampling¶
Defined in File VolumeSampling.h
Class Documentation¶
-
class
Utilities
::
VolumeSampling
¶ This class implements a volume sampling of 3D models.
Public Static Functions
-
void
sampleMesh
(const unsigned int numVertices, const Vector3r *vertices, const unsigned int numFaces, const unsigned int *faces, const Real radius, const AlignedBox3r *region, const std::array<unsigned int, 3> &resolution, const bool invert, const unsigned int sampleMode, std::vector<Vector3r> &samples)¶ Performs the volume sampling with the respective parameters.
- Parameters
numVertices
: number of verticesvertices
: vertex datanumFaces
: number of facesfaces
: index list of facesradius
: radius of sampled particlesregion
: defines a subregion of the mesh to be sampled (nullptr if not used)resolution
: resolution of the used SDFinvert
: defines if the mesh should be inverted and the outside is sampledsampleMode
: 0=regular, 1=almost dense, 2=densesamples
: sampled vertices that will be returned
-
void
Class WindingNumbers¶
Defined in File WindingNumbers.h
Class Documentation¶
-
class
Utilities
::
WindingNumbers
¶ Public Static Functions
-
Real
computeGeneralizedWindingNumber
(const Vector3r &p, const Vector3r &a, const Vector3r &b, const Vector3r &c)¶ Determine the winding number for a point p and a triangle abc.
-
Real
computeGeneralizedWindingNumber
(const Vector3r &p, const SPH::TriangleMesh &mesh)¶ Determine the winding number of a point p in a triangle mesh.
-
Real
Class Vector3f8¶
Defined in File AVX_math.h
Functions¶
Function blend¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “blend” with arguments (Scalarf8 const&, Scalarf8 const&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 blend(Scalarf8 const &c, Scalarf8 const &a, Scalarf8 const &b)
- Vector3f8 blend(Scalarf8 const &c, Vector3f8 const &a, Vector3f8 const &b)
Template Function constant8f¶
Defined in File AVX_math.h
Function convert_zero(const unsigned int *, const Real *, const unsigned char)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “convert_zero” with arguments (const unsigned int *, const Real *, const unsigned char) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 convert_zero(const Real x, const unsigned char count = 8u)
- Scalarf8 convert_zero(const unsigned int *idx, const Real *x, const unsigned char count = 8u)
Function convert_zero(const Real, const unsigned char)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “convert_zero” with arguments (const Real, const unsigned char) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 convert_zero(const Real x, const unsigned char count = 8u)
- Scalarf8 convert_zero(const unsigned int *idx, const Real *x, const unsigned char count = 8u)
Function convertVec_zero(const unsigned int *, const Real *, const unsigned char)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “convertVec_zero” with arguments (const unsigned int *, const Real *, const unsigned char) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Vector3f8 convertVec_zero(const unsigned int *idx, const Real *v, const unsigned char count = 8u)
- Vector3f8 convertVec_zero(const unsigned int *idx, const Vector3r *v, const unsigned char count = 8u)
Function convertVec_zero(const unsigned int *, const Vector3r *, const unsigned char)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “convertVec_zero” with arguments (const unsigned int *, const Vector3r *, const unsigned char) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Vector3f8 convertVec_zero(const unsigned int *idx, const Real *v, const unsigned char count = 8u)
- Vector3f8 convertVec_zero(const unsigned int *idx, const Vector3r *v, const unsigned char count = 8u)
Function getTime¶
Defined in File AnimationField.cpp
Function Documentation¶
-
Real
SPH::TimeManager
::
getTime
()
Function operator*(Scalarf8 const&, Scalarf8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator*” with arguments (Scalarf8 const&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Matrix3f8 operator*(const Matrix3f8 &b) const
- Matrix3f8 operator*(const Scalarf8 &b) const
- Scalarf8 operator*(Scalarf8 const &a, Scalarf8 const &b)
- Scalarf8 operator*(const Vector3f8 &a) const
- Vector3f8 operator*(Vector3f8 const &a, const Scalarf8 &s)
- Vector3f8 operator*(const Vector3f8 &b) const
- const Quaternion8f operator*(const Quaternion8f &a) const
- template<typename Rhs> Eigen::Product<MatrixReplacement, Rhs, Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs> &x) const
Function operator*(Vector3f8 const&, const Scalarf8&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator*” with arguments (Vector3f8 const&, const Scalarf8&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Matrix3f8 operator*(const Matrix3f8 &b) const
- Matrix3f8 operator*(const Scalarf8 &b) const
- Scalarf8 operator*(Scalarf8 const &a, Scalarf8 const &b)
- Scalarf8 operator*(const Vector3f8 &a) const
- Vector3f8 operator*(Vector3f8 const &a, const Scalarf8 &s)
- Vector3f8 operator*(const Vector3f8 &b) const
- const Quaternion8f operator*(const Quaternion8f &a) const
- template<typename Rhs> Eigen::Product<MatrixReplacement, Rhs, Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs> &x) const
Function operator*=¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator*=” with arguments (Scalarf8&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 &operator*=(Scalarf8 &a, Scalarf8 const &b)
- Vector3f8 &operator*=(const Scalarf8 &s)
Function operator+(Scalarf8 const&, Scalarf8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator+” with arguments (Scalarf8 const&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 operator+(Scalarf8 const &a, Scalarf8 const &b)
- Vector3f8 operator+(Vector3f8 const &a, Vector3f8 const &b)
Function operator+(Vector3f8 const&, Vector3f8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator+” with arguments (Vector3f8 const&, Vector3f8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 operator+(Scalarf8 const &a, Scalarf8 const &b)
- Vector3f8 operator+(Vector3f8 const &a, Vector3f8 const &b)
Function operator+=(Scalarf8&, Scalarf8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator+=” with arguments (Scalarf8&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Matrix3f8 &operator+=(const Matrix3f8 &a)
- Scalarf8 &operator+=(Scalarf8 &a, Scalarf8 const &b)
- Vector3f8 &operator+=(Vector3f8 &a, Vector3f8 const &b)
Function operator+=(Vector3f8&, Vector3f8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator+=” with arguments (Vector3f8&, Vector3f8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Matrix3f8 &operator+=(const Matrix3f8 &a)
- Scalarf8 &operator+=(Scalarf8 &a, Scalarf8 const &b)
- Vector3f8 &operator+=(Vector3f8 &a, Vector3f8 const &b)
Function operator-(Scalarf8&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator-” with arguments (Scalarf8&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 operator-(Scalarf8 &a)
- Scalarf8 operator-(Scalarf8 const &a, Scalarf8 const &b)
- Vector3f8 operator-(Vector3f8 const &a, Vector3f8 const &b)
- const Vector3f8 operator-() const
Function operator-(Scalarf8 const&, Scalarf8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator-” with arguments (Scalarf8 const&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 operator-(Scalarf8 &a)
- Scalarf8 operator-(Scalarf8 const &a, Scalarf8 const &b)
- Vector3f8 operator-(Vector3f8 const &a, Vector3f8 const &b)
- const Vector3f8 operator-() const
Function operator-(Vector3f8 const&, Vector3f8 const&)¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator-” with arguments (Vector3f8 const&, Vector3f8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 operator-(Scalarf8 &a)
- Scalarf8 operator-(Scalarf8 const &a, Scalarf8 const &b)
- Vector3f8 operator-(Vector3f8 const &a, Vector3f8 const &b)
- const Vector3f8 operator-() const
Function operator-=¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator-=” with arguments (Scalarf8&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 &operator-=(Scalarf8 &a, Scalarf8 const &b)
- Vector3f8 &operator-=(const Vector3f8 &a)
Function operator/¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator/” with arguments (Scalarf8 const&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 operator/(Scalarf8 const &a, Scalarf8 const &b)
- const Vector3f8 operator/(const Scalarf8 &s) const
Function operator/=¶
Defined in File AVX_math.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator/=” with arguments (Scalarf8&, Scalarf8 const&) in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml. Potential matches:
- Scalarf8 &operator/=(Scalarf8 &a, Scalarf8 const &b)
- Vector3f8 &operator/=(const Scalarf8 &s)
Variables¶
Variable SPH::gaussian_abscissae_1¶
Defined in File GaussQuadrature.cpp
Variable SPH::gaussian_n_1¶
Defined in File GaussQuadrature.cpp
Variable SPH::gaussian_weights_1¶
Defined in File GaussQuadrature.cpp
Defines¶
Define _USE_MATH_DEFINES¶
Defined in File DragForce_Gissler2017.cpp
Define _USE_MATH_DEFINES¶
Defined in File PoissonDiskSampling.cpp
Define Documentation¶
-
_USE_MATH_DEFINES
Define _USE_MATH_DEFINES¶
Defined in File WindingNumbers.cpp
Define Documentation¶
-
_USE_MATH_DEFINES
Define compute_Vj_gradW_samephase¶
Defined in File FluidModel.h
Define forall_boundary_neighbors¶
Defined in File Simulation.h
Define forall_density_maps¶
Defined in File Simulation.h
Define forall_fluid_neighbors¶
Defined in File Simulation.h
Define forall_fluid_neighbors_in_same_phase¶
Defined in File Simulation.h
Define forall_volume_maps¶
Defined in File Simulation.h
Define PD_USE_DIAGONAL_PRECONDITIONER¶
Defined in File TimeStepPF.h
Define RealVectorParameterType¶
Defined in File Common.h
Define USE_BLOCKDIAGONAL_PRECONDITIONER¶
Defined in File Viscosity_Weiler2018.h
Define Vec3Block¶
Defined in File TimeStepPF.cpp
Define Documentation¶
Warning
doxygendefine: Cannot find define “Vec3Block” in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml
Typedefs¶
Typedef AlignedBox2r¶
Defined in File Common.h
Typedef AlignedBox3r¶
Defined in File Common.h
Typedef AngleAxisr¶
Defined in File Common.h
Typedef AtomicRealVec¶
Defined in File TimeStepPF.cpp
Typedef Documentation¶
Warning
doxygentypedef: Cannot find typedef “AtomicRealVec” in doxygen xml output for project “SPlisHSPlasH” from directory: ./doxyoutput/xml
Typedef Matrix2r¶
Defined in File Common.h
Typedef Matrix3f¶
Defined in File Common.h
Typedef Matrix3r¶
Defined in File Common.h
Typedef Matrix4r¶
Defined in File Common.h
Typedef Matrix5r¶
Defined in File Common.h
Typedef Matrix6r¶
Defined in File Common.h
Typedef NeighborhoodSearch¶
Defined in File NeighborhoodSearch.h
Typedef Quaternionr¶
Defined in File Common.h
Typedef SystemMatrixType¶
Defined in File MatrixFreeSolver.h
Typedef Vector2i¶
Defined in File Common.h
Typedef Vector2r¶
Defined in File Common.h
Typedef Vector3f¶
Defined in File Common.h
Typedef Vector3r¶
Defined in File Common.h
Typedef Vector4f¶
Defined in File Common.h
Typedef Vector4r¶
Defined in File Common.h
Typedef Vector5r¶
Defined in File Common.h
Typedef Vector6r¶
Defined in File Common.h
Typedef VectorXr¶
Defined in File Common.h
Typedef Documentation¶
-
using
SPH::TimeStepPF
::
VectorXr
= Eigen::Matrix<Real, -1, 1>