Skip to content

Commit 4c063be

Browse files
committed
- fixed z-sort
- added parameter stepsPerZSort - bugfix in the PBDWrapper - the wrapper ignored some settings of the scene file
1 parent e9e67e4 commit 4c063be

23 files changed

+82
-239
lines changed

Changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.13.1
2+
- fixed z-sort
3+
- added parameter stepsPerZSort
4+
- bugfix in the PBDWrapper - the wrapper ignored some settings of the scene file
5+
16
2.13.0
27
- added implementation of surface tension method: Jeske et al. "Implicit Surface Tension for SPH Fluid Simulation", ACM Transactions on Graphics, 2023 (thanks to Stefan Rhys Jeske)
38

README.md

Lines changed: 4 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -96,105 +96,15 @@ SPlisHSPlasH implements:
9696
* a Maya plugin to model and generate scene files
9797
* a ParaView plugin to import particle data
9898

99-
## Pressure Solvers
99+
A list of all implemented simulation methods can be found here:
100+
[https://splishsplash.physics-simulation.org/features](https://splishsplash.physics-simulation.org/features/)
100101

101-
The SPlisHSPlasH library implements the following pressure solvers:
102102

103-
* Weakly compressible SPH for free surface flows (WCSPH)
104-
* Predictive-corrective incompressible SPH (PCISPH)
105-
* Position based fluids (PBF)
106-
* Implicit incompressible SPH (IISPH)
107-
* Divergence-free smoothed particle hydrodynamics (DFSPH)
108-
* Projective Fluids (PF)
109-
* Implicit compressible SPH (ICSPH)
103+
## Screenshots & Videos
110104

111-
## Boundary Handling
105+
[https://splishsplash.physics-simulation.org/gallery](https://splishsplash.physics-simulation.org/gallery/)
112106

113-
The SPlisHSPlasH library implements the following boundary handling methods:
114107

115-
* Nadir Akinci, Markus Ihmsen, Gizem Akinci, Barbara Solenthaler, and Matthias Teschner, "Versatile rigid-fluid coupling for incompressible SPH", ACM Transactions on Graphics 31(4), 2012
116-
* Dan Koschier and Jan Bender, "Density Maps for Improved SPH Boundary Handling", In Proceedings of ACM SIGGRAPH / EUROGRAPHICS Symposium on Computer Animation (SCA), 2017
117-
* Jan Bender, Tassilo Kugelstadt, Marcel Weiler, Dan Koschier, "Volume Maps: An Implicit Boundary Representation for SPH", ACM SIGGRAPH Conference on Motion, Interaction and Games, 2019
118-
119-
## Viscosity
120-
121-
The SPlisHSPlasH library implements explicit viscosity methods:
122-
123-
* Standard SPH formulation of viscosity
124-
125-
and the implicit methods of the following publications:
126-
127-
* Jan Bender and Dan Koschier, "Divergence-free SPH for incompressible and viscous fluids", IEEE Transactions on Visualization and Computer Graphics, 2017
128-
* Andreas Peer, Markus Ihmsen, Jens Cornelis, and Matthias Teschner, "An Implicit Viscosity Formulation for SPH Fluids", ACM Transactions on Graphics, 34(4), 2015
129-
* Andreas Peer and Matthias Teschner. Prescribed Velocity Gradients for Highly Viscous SPH Fluids with Vorticity Diffusion. IEEE Transactions on Visualization and Computer Graphics, 2016
130-
* An improved version of: Tetsuya Takahashi, Yoshinori Dobashi, Issei Fujishiro, Tomoyuki Nishita, and Ming C. Lin. Implicit Formulation for SPH-based Viscous Fluids. Computer Graphics Forum, 34, 2015.
131-
* Marcel Weiler, Dan Koschier, Magnus Brand and Jan Bender. A Physically Consistent Implicit Viscosity Solver for SPH Fluids. Computer Graphics Forum (Eurographics), 37(2), 2018
132-
133-
## Surface Tension
134-
135-
The SPlisHSPlasH library implements the surface tension methods of the following publications:
136-
137-
* Markus Becker and Matthias Teschner. Weakly compressible SPH for free surface flows. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2007. Eurographics Association.
138-
* Nadir Akinci, Gizem Akinci, and Matthias Teschner. Versatile surface tension and adhesion for SPH fluids. ACM Trans. Graph., 32(6):182:1–182:8, 2013.
139-
* Xiaowei He, Huamin Wang, Fengjun Zhang, Hongan Wang, Guoping Wang, and Kun Zhou, "Robust simulation of sparsely sampled thin features in SPH-based free surface flows", ACM Transactions on Graphics, 34(1), 2014.
140-
* F. Zorilla, M. Ritter, J. Sappl, W. Rauch, M. Harders, "Accelerating Surface Tension Calculation in SPH via Particle Classification and Monte Carlo Integration", Computers 9, 23, 2020.
141-
142-
## Vorticity
143-
144-
The SPlisHSPlasH library implements the vorticity methods of the following publications:
145-
146-
* Jan Bender, Dan Koschier, Tassilo Kugelstadt and Marcel Weiler. A Micropolar Material Model for Turbulent SPH Fluids. In Proceedings of ACM SIGGRAPH / EUROGRAPHICS Symposium on Computer Animation, 2017
147-
* Miles Macklin and Matthias Müller. Position based fluids. ACM Trans. Graph., 32(4):104:1–104:12, July 2013.
148-
149-
## Drag Forces
150-
151-
The SPlisHSPlasH library implements the drag force computation of the following publications:
152-
153-
* Christoph Gissler, Stefan Band, Andreas Peer, Markus Ihmsen and Matthias Teschner. Approximate Air-Fluid Interactions for SPH. In Proceedings of Virtual Reality Interactions and Physical Simulations, 2017
154-
* Miles Macklin, Matthias Müller, Nuttapong Chentanez and Tae-Yong Kim. Unified Particle Physics for Real-Time Applications. ACM Trans. Graph., 33(4), 2014
155-
156-
## Elastic Forces
157-
158-
* M. Becker, M. Ihmsen, and M. Teschner. Corotated SPH for deformable solids. Proceedings of Eurographics Conference on Natural Phenomena, 2009
159-
* A. Peer, C. Gissler, S. Band, and M. Teschner. An Implicit SPH Formulation for Incompressible Linearly Elastic Solids. Computer Graphics Forum, 2017
160-
* Tassilo Kugelstadt, Jan Bender, José Antonio Fernández-Fernández, Stefan Rhys Jeske, Fabian Löschner, and Andreas Longva. Fast Corotated Elastic SPH Solids with Implicit Zero-Energy Mode Control. Proceedings of the ACM on Computer Graphics and Interactive Techniques, 2021
161-
162-
163-
## Multi-Phase Fluid Simulation
164-
165-
The SPlisHSPlasH library implements the following publication to realize multi-phase simulations:
166-
167-
* B. Solenthaler and R. Pajarola. Density Contrast SPH Interfaces. In Proceedings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2008.
168-
169-
## Volume Sampling
170-
171-
The SPlisHSPlasH library implements the volume sampling techniques of following publications:
172-
173-
* M. Jiang, Y. Zhou, R. Wang, R. Southern, J. J. Zhang. Blue noise sampling using an SPH-based method. ACM Transactions on Graphics, 2015
174-
* Tassilo Kugelstadt, Jan Bender, José Antonio Fernández-Fernández, Stefan Rhys Jeske, Fabian Löschner, and Andreas Longva. Fast Corotated Elastic SPH Solids with Implicit Zero-Energy Mode Control. Proceedings of the ACM on Computer Graphics and Interactive Techniques, 2021
175-
176-
177-
## Screenshots
178-
179-
|![](https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/master/doc/images/SPlisHSPlasH2.jpg)|![](https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/master/doc/images/SPlisHSPlasH1.jpg)|
180-
|--|--|
181-
|![](https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/master/doc/images/SPlisHSPlasH3.jpg)|![](https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/master/doc/images/SPlisHSPlasH4.jpg)|
182-
183-
## Videos
184-
185-
The following videos were generated using the SPlisHSPlasH library:
186-
187-
*A Micropolar Material Model for Turbulent SPH Fluids* | *Density Maps for Improved SPH Boundary Handling*
188-
:---:|:---:
189-
[![Video](https://img.youtube.com/vi/fsvDbzEui3w/0.jpg)](https://www.youtube.com/watch?v=fsvDbzEui3w) | [![Video](https://img.youtube.com/vi/P82qmTAahg0/0.jpg)](https://www.youtube.com/watch?v=P82qmTAahg0)
190-
*Divergence-Free Smoothed Particle Hydrodynamics* | *Divergence-Free SPH for Incompressible and Viscous Fluids*
191-
[![Video](https://img.youtube.com/vi/POnmzzhc5E0/0.jpg)](https://www.youtube.com/watch?v=POnmzzhc5E0) | [![Video](https://img.youtube.com/vi/tl4mx0TtaAc/0.jpg)](https://www.youtube.com/watch?v=tl4mx0TtaAc)
192-
*A Physically Consistent Implicit Viscosity Solver for SPH Fluids* | *Turbulent Micropolar SPH Fluids with Foam*
193-
[![Video](https://img.youtube.com/vi/D_nEhix1G-w/0.jpg)](https://www.youtube.com/watch?v=D_nEhix1G-w) | [![Video](https://img.youtube.com/vi/elZieJNBYqk/0.jpg)](https://www.youtube.com/watch?v=elZieJNBYqk)
194-
*Volume Maps: An Implicit Boundary Representation for SPH* | *Implicit Frictional Boundary Handling for SPH*
195-
[![Video](https://img.youtube.com/vi/AV_pl1bMIb8/0.jpg)](https://www.youtube.com/watch?v=AV_pl1bMIb8) | [![Video](https://img.youtube.com/vi/1u5N0eedzic/0.jpg)](https://www.youtube.com/watch?v=1u5N0eedzic)
196-
*Fast Corotated Elastic SPH Solids with Implicit Zero-Energy Mode Control* | *A comparison of linear consistent correction methods for first-order SPH derivatives*
197-
[![Video](https://img.youtube.com/vi/8NkyiftmDN0/0.jpg)](https://www.youtube.com/watch?v=8NkyiftmDN0) | [![Video](https://img.youtube.com/vi/k0kKR8mXmK4/0.jpg)](https://www.youtube.com/watch?v=k0kKR8mXmK4)
198108

199109
## Citation
200110

SPlisHSPlasH/DFSPH/TimeStepDFSPH.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ TimeStepDFSPH::TimeStepDFSPH() :
2727
m_simulationData()
2828
{
2929
m_simulationData.init();
30-
m_counter = 0;
3130
m_iterationsV = 0;
3231
m_enableDivergenceSolver = true;
3332
m_maxIterationsV = 100;
@@ -97,7 +96,7 @@ void TimeStepDFSPH::step()
9796
//////////////////////////////////////////////////////////////////////////
9897
// search the neighbors for all particles
9998
//////////////////////////////////////////////////////////////////////////
100-
performNeighborhoodSearch();
99+
sim->performNeighborhoodSearch();
101100

102101
#ifdef USE_PERFORMANCE_OPTIMIZATION
103102
//////////////////////////////////////////////////////////////////////////
@@ -684,24 +683,13 @@ void TimeStepDFSPH::reset()
684683
{
685684
TimeStep::reset();
686685
m_simulationData.reset();
687-
m_counter = 0;
688686
m_iterations = 0;
689687
m_iterationsV = 0;
690688
}
691689

692-
void TimeStepDFSPH::performNeighborhoodSearch()
690+
void TimeStepDFSPH::performNeighborhoodSearchSort()
693691
{
694-
if (Simulation::getCurrent()->zSortEnabled())
695-
{
696-
if (m_counter % 500 == 0)
697-
{
698-
Simulation::getCurrent()->performNeighborhoodSearchSort();
699-
m_simulationData.performNeighborhoodSearchSort();
700-
}
701-
m_counter++;
702-
}
703-
704-
Simulation::getCurrent()->performNeighborhoodSearch();
692+
m_simulationData.performNeighborhoodSearchSort();
705693
}
706694

707695
void TimeStepDFSPH::emittedParticles(FluidModel *model, const unsigned int startIndex)

SPlisHSPlasH/DFSPH/TimeStepDFSPH.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace SPH
2525
{
2626
protected:
2727
SimulationDataDFSPH m_simulationData;
28-
unsigned int m_counter;
2928
const Real m_eps = static_cast<Real>(1.0e-5);
3029
bool m_enableDivergenceSolver;
3130
unsigned int m_iterationsV;
@@ -43,9 +42,7 @@ namespace SPH
4342
void computePressureAccel(const unsigned int fluidModelIndex, const unsigned int i, const Real density0, std::vector<std::vector<Real>>& pressure_rho2, const bool applyBoundaryForces = false);
4443
Real compute_aij_pj(const unsigned int fluidModelIndex, const unsigned int i);
4544

46-
/** Perform the neighborhood search for all fluid particles.
47-
*/
48-
void performNeighborhoodSearch();
45+
virtual void performNeighborhoodSearchSort();
4946
virtual void emittedParticles(FluidModel *model, const unsigned int startIndex);
5047

5148
/** Init all generic parameters */

SPlisHSPlasH/ICSPH/TimeStepICSPH.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ TimeStepICSPH::TimeStepICSPH() :
2222
TimeStep()
2323
{
2424
m_simulationData.init();
25-
m_counter = 0;
2625
m_lambda = 200000;
2726
m_clamping = true;
2827

@@ -78,7 +77,7 @@ void TimeStepICSPH::step()
7877
//////////////////////////////////////////////////////////////////////////
7978
// search the neighbors for all particles
8079
//////////////////////////////////////////////////////////////////////////
81-
performNeighborhoodSearch();
80+
sim->performNeighborhoodSearch();
8281

8382
#ifdef USE_PERFORMANCE_OPTIMIZATION
8483
//////////////////////////////////////////////////////////////////////////
@@ -159,7 +158,6 @@ void TimeStepICSPH::reset()
159158
{
160159
TimeStep::reset();
161160
m_simulationData.reset();
162-
m_counter = 0;
163161
}
164162

165163

@@ -580,19 +578,9 @@ void TimeStepICSPH::computePressureAccels(const unsigned int fluidModelIndex)
580578
}
581579
}
582580

583-
void TimeStepICSPH::performNeighborhoodSearch()
581+
void TimeStepICSPH::performNeighborhoodSearchSort()
584582
{
585-
if (Simulation::getCurrent()->zSortEnabled())
586-
{
587-
if (m_counter % 500 == 0)
588-
{
589-
Simulation::getCurrent()->performNeighborhoodSearchSort();
590-
m_simulationData.performNeighborhoodSearchSort();
591-
}
592-
m_counter++;
593-
}
594-
595-
Simulation::getCurrent()->performNeighborhoodSearch();
583+
m_simulationData.performNeighborhoodSearchSort();
596584
}
597585

598586
void TimeStepICSPH::emittedParticles(FluidModel *model, const unsigned int startIndex)

SPlisHSPlasH/ICSPH/TimeStepICSPH.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace SPH
2323
Real m_lambda;
2424
bool m_clamping;
2525
const Real m_psi = 1.5;
26-
unsigned int m_counter;
2726

2827
void computeDensityAdv(const unsigned int fluidModelIndex);
2928
void compute_aii(const unsigned int fluidModelIndex);
@@ -34,9 +33,7 @@ namespace SPH
3433
/** Determine the pressure accelerations when the pressure is already known. */
3534
void computePressureAccels(const unsigned int fluidModelIndex);
3635

37-
/** Perform the neighborhood search for all fluid particles.
38-
*/
39-
void performNeighborhoodSearch();
36+
virtual void performNeighborhoodSearchSort();
4037

4138
virtual void initParameters();
4239
virtual void emittedParticles(FluidModel *model, const unsigned int startIndex);

SPlisHSPlasH/IISPH/TimeStepIISPH.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ TimeStepIISPH::TimeStepIISPH() :
1818
TimeStep()
1919
{
2020
m_simulationData.init();
21-
m_counter = 0;
2221

2322
Simulation *sim = Simulation::getCurrent();
2423
const unsigned int nModels = sim->numberOfFluidModels();
@@ -62,7 +61,7 @@ void TimeStepIISPH::step()
6261
for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++)
6362
clearAccelerations(fluidModelIndex);
6463

65-
performNeighborhoodSearch();
64+
sim->performNeighborhoodSearch();
6665

6766
#ifdef USE_PERFORMANCE_OPTIMIZATION
6867
precomputeValues();
@@ -105,7 +104,6 @@ void TimeStepIISPH::reset()
105104
{
106105
TimeStep::reset();
107106
m_simulationData.reset();
108-
m_counter = 0;
109107
}
110108

111109
void TimeStepIISPH::predictAdvection(const unsigned int fluidModelIndex)
@@ -520,19 +518,9 @@ void TimeStepIISPH::computePressureAccels(const unsigned int fluidModelIndex)
520518
}
521519
}
522520

523-
void TimeStepIISPH::performNeighborhoodSearch()
521+
void TimeStepIISPH::performNeighborhoodSearchSort()
524522
{
525-
if (Simulation::getCurrent()->zSortEnabled())
526-
{
527-
if (m_counter % 500 == 0)
528-
{
529-
Simulation::getCurrent()->performNeighborhoodSearchSort();
530-
m_simulationData.performNeighborhoodSearchSort();
531-
}
532-
m_counter++;
533-
}
534-
535-
Simulation::getCurrent()->performNeighborhoodSearch();
523+
m_simulationData.performNeighborhoodSearchSort();
536524
}
537525

538526
void TimeStepIISPH::emittedParticles(FluidModel *model, const unsigned int startIndex)

SPlisHSPlasH/IISPH/TimeStepIISPH.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ namespace SPH
2020
{
2121
protected:
2222
SimulationDataIISPH m_simulationData;
23-
unsigned int m_counter;
2423

2524
void predictAdvection(const unsigned int fluidModelIndex);
2625
void pressureSolve();
@@ -30,9 +29,7 @@ namespace SPH
3029
/** Determine the pressure accelerations when the pressure is already known. */
3130
void computePressureAccels(const unsigned int fluidModelIndex);
3231

33-
/** Perform the neighborhood search for all fluid particles.
34-
*/
35-
void performNeighborhoodSearch();
32+
virtual void performNeighborhoodSearchSort();
3633

3734
virtual void emittedParticles(FluidModel *model, const unsigned int startIndex);
3835

SPlisHSPlasH/PBF/TimeStepPBF.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ TimeStepPBF::TimeStepPBF() :
2424
TimeStep()
2525
{
2626
m_simulationData.init();
27-
m_counter = 0;
2827
m_velocityUpdateMethod = 0;
2928

3029
Simulation *sim = Simulation::getCurrent();
@@ -88,7 +87,7 @@ void TimeStepPBF::step()
8887
}
8988

9089
// Perform neighborhood search
91-
performNeighborhoodSearch();
90+
sim->performNeighborhoodSearch();
9291

9392
#ifdef USE_PERFORMANCE_OPTIMIZATION
9493
precomputeValues();
@@ -163,7 +162,6 @@ void TimeStepPBF::reset()
163162
{
164163
TimeStep::reset();
165164
m_simulationData.reset();
166-
m_counter = 0;
167165
}
168166

169167

@@ -383,19 +381,9 @@ void TimeStepPBF::pressureSolveIteration(const unsigned int fluidModelIndex, Rea
383381
}
384382
}
385383

386-
void TimeStepPBF::performNeighborhoodSearch()
384+
void TimeStepPBF::performNeighborhoodSearchSort()
387385
{
388-
if (Simulation::getCurrent()->zSortEnabled())
389-
{
390-
if (m_counter % 500 == 0)
391-
{
392-
Simulation::getCurrent()->performNeighborhoodSearchSort();
393-
m_simulationData.performNeighborhoodSearchSort();
394-
}
395-
m_counter++;
396-
}
397-
398-
Simulation::getCurrent()->performNeighborhoodSearch();
386+
m_simulationData.performNeighborhoodSearchSort();
399387
}
400388

401389
void TimeStepPBF::emittedParticles(FluidModel *model, const unsigned int startIndex)

SPlisHSPlasH/PBF/TimeStepPBF.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace SPH
2323
{
2424
protected:
2525
SimulationDataPBF m_simulationData;
26-
unsigned int m_counter;
2726
int m_velocityUpdateMethod;
2827

2928
/** Perform a position-based correction step for the following density constraint:\n
@@ -32,9 +31,7 @@ namespace SPH
3231
void pressureSolve();
3332
void pressureSolveIteration(const unsigned int fluidModelIndex, Real &avg_density_err);
3433

35-
/** Perform the neighborhood search for all fluid particles.
36-
*/
37-
void performNeighborhoodSearch();
34+
virtual void performNeighborhoodSearchSort();
3835

3936
virtual void emittedParticles(FluidModel *model, const unsigned int startIndex);
4037

0 commit comments

Comments
 (0)