Skip to content

Commit dab404a

Browse files
committed
- added cmake option for third-party methods
1 parent e2de8fb commit dab404a

File tree

6 files changed

+36
-8
lines changed

6 files changed

+36
-8
lines changed

CMake/Common.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ if (USE_DEBUG_TOOLS)
3232
add_definitions( -DUSE_DEBUG_TOOLS)
3333
endif (USE_DEBUG_TOOLS)
3434

35+
option(USE_THIRD_PARTY_METHODS "Use third-party methods" ON)
36+
if (USE_THIRD_PARTY_METHODS)
37+
add_definitions( -DUSE_THIRD_PARTY_METHODS)
38+
endif (USE_THIRD_PARTY_METHODS)
39+
3540
cmake_dependent_option(USE_PYTHON_BINDINGS "Generate Python Bindings using PyBind11" ON "PYTHON_EXECUTABLE" OFF)
3641
if (USE_PYTHON_BINDINGS AND UNIX)
3742
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2.9.0
2+
- added new surface tension model (thanks to Fernando Zorilla and Marcel Ritter)
13
- added a test for reading and writing the state of a simulation
24
- updated to Eigen 3.3.8
35
- added a hotkey (m) to rescale the range of the current color map

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ and the implicit methods of the following publications:
123123
The SPlisHSPlasH library implements the surface tension methods of the following publications:
124124

125125
* 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.
126-
127126
* 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.
128-
129127
* 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.
128+
* 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.
130129

131130
## Vorticity
132131

@@ -208,3 +207,4 @@ The following videos were generated using the SPlisHSPlasH library:
208207
* Tetsuya Takahashi, Yoshinori Dobashi, Issei Fujishiro, Tomoyuki Nishita, and Ming C. Lin. Implicit Formulation for SPH-based Viscous Fluids. Computer Graphics Forum, 34, 2015.
209208
* Marcel Weiler, Dan Koschier and Jan Bender. Projective Fluids. Proceedings of the 9th International Conference on Motion in Games, ACM, 2016, 79-84
210209
* 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
210+
* 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.

SPlisHSPlasH/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ set(SURFACETENSION_HEADER_FILES
6565
SurfaceTension/SurfaceTension_Becker2007.h
6666
SurfaceTension/SurfaceTension_Akinci2013.h
6767
SurfaceTension/SurfaceTension_He2014.h
68-
SurfaceTension/SurfaceTension_ZorillaRitter2020_haltonVec323.h
69-
SurfaceTension/SurfaceTension_ZorillaRitter2020.h
7068
)
7169

7270
set(SURFACETENSION_SOURCE_FILES
7371
SurfaceTension/SurfaceTensionBase.cpp
7472
SurfaceTension/SurfaceTension_Becker2007.cpp
7573
SurfaceTension/SurfaceTension_Akinci2013.cpp
7674
SurfaceTension/SurfaceTension_He2014.cpp
77-
SurfaceTension/SurfaceTension_ZorillaRitter2020.cpp
7875
)
7976

8077
set(VISCOSITY_HEADER_FILES
@@ -166,6 +163,17 @@ set(UTILS_SOURCE_FILES
166163
Utilities/WindingNumbers.cpp
167164
)
168165

166+
if (USE_THIRD_PARTY_METHODS)
167+
list(APPEND SURFACETENSION_HEADER_FILES
168+
SurfaceTension/SurfaceTension_ZorillaRitter2020_haltonVec323.h
169+
SurfaceTension/SurfaceTension_ZorillaRitter2020.h
170+
)
171+
172+
list(APPEND SURFACETENSION_SOURCE_FILES
173+
SurfaceTension/SurfaceTension_ZorillaRitter2020.cpp
174+
)
175+
endif()
176+
169177
add_library(SPlisHSPlasH
170178
Common.h
171179

SPlisHSPlasH/FluidModel.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "SurfaceTension/SurfaceTension_Becker2007.h"
1515
#include "SurfaceTension/SurfaceTension_Akinci2013.h"
1616
#include "SurfaceTension/SurfaceTension_He2014.h"
17-
#include "SurfaceTension/SurfaceTension_ZorillaRitter2020.h"
1817
#include "Viscosity/Viscosity_XSPH.h"
1918
#include "Viscosity/Viscosity_Standard.h"
2019
#include "Viscosity/Viscosity_Bender2017.h"
@@ -30,6 +29,9 @@
3029
#include "Elasticity/Elasticity_Becker2009.h"
3130
#include "Elasticity/Elasticity_Peer2018.h"
3231

32+
#ifdef USE_THIRD_PARTY_METHODS
33+
#include "SurfaceTension/SurfaceTension_ZorillaRitter2020.h"
34+
#endif
3335

3436
using namespace SPH;
3537
using namespace GenParam;
@@ -49,7 +51,9 @@ int FluidModel::ENUM_SURFACETENSION_NONE = -1;
4951
int FluidModel::ENUM_SURFACETENSION_BECKER2007 = -1;
5052
int FluidModel::ENUM_SURFACETENSION_AKINCI2013 = -1;
5153
int FluidModel::ENUM_SURFACETENSION_HE2014 = -1;
54+
#ifdef USE_THIRD_PARTY_METHODS
5255
int FluidModel::ENUM_SURFACETENSION_ZORILLARITTER2020 = -1;
56+
#endif
5357
int FluidModel::ENUM_VISCOSITY_NONE = -1;
5458
int FluidModel::ENUM_VISCOSITY_STANDARD = -1;
5559
int FluidModel::ENUM_VISCOSITY_XSPH = -1;
@@ -170,8 +174,9 @@ void FluidModel::initParameters()
170174
enumParam->addEnumValue("Becker & Teschner 2007", ENUM_SURFACETENSION_BECKER2007);
171175
enumParam->addEnumValue("Akinci et al. 2013", ENUM_SURFACETENSION_AKINCI2013);
172176
enumParam->addEnumValue("He et al. 2014", ENUM_SURFACETENSION_HE2014);
177+
#ifdef USE_THIRD_PARTY_METHODS
173178
enumParam->addEnumValue("Zorilla, Ritter, et al. 2020", ENUM_SURFACETENSION_ZORILLARITTER2020);
174-
179+
#endif
175180

176181
ParameterBase::GetFunc<int> getViscosityFct = std::bind(&FluidModel::getViscosityMethod, this);
177182
ParameterBase::SetFunc<int> setViscosityFct = std::bind(&FluidModel::setViscosityMethod, this, std::placeholders::_1);
@@ -484,8 +489,10 @@ void FluidModel::setSurfaceTensionMethod(const int val)
484489
m_surfaceTension = new SurfaceTension_Akinci2013(this);
485490
else if (m_surfaceTensionMethod == SurfaceTensionMethods::He2014)
486491
m_surfaceTension = new SurfaceTension_He2014(this);
492+
#ifdef USE_THIRD_PARTY_METHODS
487493
else if (m_surfaceTensionMethod == SurfaceTensionMethods::ZorillaRitter2020)
488494
m_surfaceTension = new SurfaceTension_ZorillaRitter2020(this);
495+
#endif
489496

490497
if (m_surfaceTension != nullptr)
491498
m_surfaceTension->init();

SPlisHSPlasH/FluidModel.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ namespace SPH
7070
name(n), type(t), getFct(fct), storeData(s) { }
7171
};
7272

73-
enum class SurfaceTensionMethods { None = 0, Becker2007, Akinci2013, He2014, ZorillaRitter2020, NumSurfaceTensionMethods };
73+
enum class SurfaceTensionMethods { None = 0, Becker2007, Akinci2013, He2014,
74+
#ifdef USE_THIRD_PARTY_METHODS
75+
ZorillaRitter2020,
76+
#endif
77+
NumSurfaceTensionMethods };
7478
enum class ViscosityMethods { None = 0, Standard, XSPH, Bender2017, Peer2015, Peer2016, Takahashi2015, Weiler2018, NumViscosityMethods };
7579
enum class VorticityMethods { None = 0, Micropolar, VorticityConfinement, NumVorticityMethods };
7680
enum class DragMethods { None = 0, Macklin2014, Gissler2017, NumDragMethods };
@@ -101,7 +105,9 @@ namespace SPH
101105
static int ENUM_SURFACETENSION_BECKER2007;
102106
static int ENUM_SURFACETENSION_AKINCI2013;
103107
static int ENUM_SURFACETENSION_HE2014;
108+
#ifdef USE_THIRD_PARTY_METHODS
104109
static int ENUM_SURFACETENSION_ZORILLARITTER2020;
110+
#endif
105111

106112
static int ENUM_VISCOSITY_NONE;
107113
static int ENUM_VISCOSITY_STANDARD;

0 commit comments

Comments
 (0)