├── .github └── workflows │ ├── build-linux.yml │ └── build-windows.yml ├── .readthedocs.yaml ├── CITATION.cff ├── CMake ├── Common.cmake ├── DataCopyTargets.cmake ├── FindEigen3.cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── NeighborhoodSearch.cmake ├── SetUpExternalProjects.cmake └── avx.cmake ├── CMakeLists.txt ├── Changelog.txt ├── GUI ├── OpenGL │ ├── CMakeLists.txt │ ├── MiniGL.cpp │ ├── MiniGL.h │ ├── Selection.h │ ├── Shader.cpp │ ├── Shader.h │ └── colormaps │ │ ├── colormap_bwr.h │ │ ├── colormap_coolwarm.h │ │ ├── colormap_jet.h │ │ ├── colormap_plasma.h │ │ └── colormap_seismic.h └── imgui │ ├── CMakeLists.txt │ ├── imguiParameters.cpp │ └── imguiParameters.h ├── LICENSE ├── MANIFEST.in ├── README.md ├── SPlisHSPlasH ├── AnimationField.cpp ├── AnimationField.h ├── AnimationFieldSystem.cpp ├── AnimationFieldSystem.h ├── BoundaryModel.cpp ├── BoundaryModel.h ├── BoundaryModel_Akinci2012.cpp ├── BoundaryModel_Akinci2012.h ├── BoundaryModel_Bender2019.cpp ├── BoundaryModel_Bender2019.h ├── BoundaryModel_Koschier2017.cpp ├── BoundaryModel_Koschier2017.h ├── CMakeLists.txt ├── Common.h ├── DFSPH │ ├── SimulationDataDFSPH.cpp │ ├── SimulationDataDFSPH.h │ ├── TimeStepDFSPH.cpp │ └── TimeStepDFSPH.h ├── Drag │ ├── DragBase.cpp │ ├── DragBase.h │ ├── DragForce_Gissler2017.cpp │ ├── DragForce_Gissler2017.h │ ├── DragForce_Macklin2014.cpp │ └── DragForce_Macklin2014.h ├── Elasticity │ ├── ElasticityBase.cpp │ ├── ElasticityBase.h │ ├── Elasticity_Becker2009.cpp │ ├── Elasticity_Becker2009.h │ ├── Elasticity_Kugelstadt2021.cpp │ ├── Elasticity_Kugelstadt2021.h │ ├── Elasticity_Peer2018.cpp │ └── Elasticity_Peer2018.h ├── Emitter.cpp ├── Emitter.h ├── EmitterSystem.cpp ├── EmitterSystem.h ├── FluidModel.cpp ├── FluidModel.h ├── ICSPH │ ├── SimulationDataICSPH.cpp │ ├── SimulationDataICSPH.h │ ├── TimeStepICSPH.cpp │ └── TimeStepICSPH.h ├── IISPH │ ├── SimulationDataIISPH.cpp │ ├── SimulationDataIISPH.h │ ├── TimeStepIISPH.cpp │ └── TimeStepIISPH.h ├── NeighborhoodSearch.h ├── NonPressureForceBase.cpp ├── NonPressureForceBase.h ├── NonPressureForceRegistration.cpp ├── PBF │ ├── SimulationDataPBF.cpp │ ├── SimulationDataPBF.h │ ├── TimeIntegration.cpp │ ├── TimeIntegration.h │ ├── TimeStepPBF.cpp │ └── TimeStepPBF.h ├── PCISPH │ ├── SimulationDataPCISPH.cpp │ ├── SimulationDataPCISPH.h │ ├── TimeStepPCISPH.cpp │ └── TimeStepPCISPH.h ├── PF │ ├── SimulationDataPF.cpp │ ├── SimulationDataPF.h │ ├── TimeStepPF.cpp │ └── TimeStepPF.h ├── RigidBodyObject.h ├── SPHKernels.cpp ├── SPHKernels.h ├── Simulation.cpp ├── Simulation.h ├── StaticRigidBody.h ├── SurfaceTension │ ├── SurfaceTensionBase.cpp │ ├── SurfaceTensionBase.h │ ├── SurfaceTension_Akinci2013.cpp │ ├── SurfaceTension_Akinci2013.h │ ├── SurfaceTension_Becker2007.cpp │ ├── SurfaceTension_Becker2007.h │ ├── SurfaceTension_He2014.cpp │ ├── SurfaceTension_He2014.h │ ├── SurfaceTension_Jeske2023.cpp │ ├── SurfaceTension_Jeske2023.h │ ├── SurfaceTension_ZorillaRitter2020.cpp │ ├── SurfaceTension_ZorillaRitter2020.h │ └── SurfaceTension_ZorillaRitter2020_haltonVec323.h ├── TimeManager.cpp ├── TimeManager.h ├── TimeStep.cpp ├── TimeStep.h ├── TriangleMesh.cpp ├── TriangleMesh.h ├── Utilities │ ├── AVX_math.h │ ├── CholeskyAVXSolver.cpp │ ├── CholeskyAVXSolver.h │ ├── DebugTools.cpp │ ├── DebugTools.h │ ├── GaussQuadrature.cpp │ ├── GaussQuadrature.h │ ├── MathFunctions.cpp │ ├── MathFunctions.h │ ├── MatrixFreeSolver.h │ ├── MeshImport.cpp │ ├── MeshImport.h │ ├── PoissonDiskSampling.cpp │ ├── PoissonDiskSampling.h │ ├── RegularSampling2D.cpp │ ├── RegularSampling2D.h │ ├── RegularTriangleSampling.cpp │ ├── RegularTriangleSampling.h │ ├── SDFFunctions.cpp │ ├── SDFFunctions.h │ ├── SceneLoader.cpp │ ├── SceneLoader.h │ ├── SceneParameterObjects.cpp │ ├── SceneParameterObjects.h │ ├── SceneWriter.cpp │ ├── SceneWriter.h │ ├── SimpleQuadrature.cpp │ ├── SimpleQuadrature.h │ ├── SurfaceSampling.h │ ├── VolumeSampling.cpp │ ├── VolumeSampling.h │ ├── WindingNumbers.cpp │ └── WindingNumbers.h ├── Viscosity │ ├── ViscosityBase.cpp │ ├── ViscosityBase.h │ ├── Viscosity_Bender2017.cpp │ ├── Viscosity_Bender2017.h │ ├── Viscosity_Peer2015.cpp │ ├── Viscosity_Peer2015.h │ ├── Viscosity_Peer2016.cpp │ ├── Viscosity_Peer2016.h │ ├── Viscosity_Standard.cpp │ ├── Viscosity_Standard.h │ ├── Viscosity_Takahashi2015.cpp │ ├── Viscosity_Takahashi2015.h │ ├── Viscosity_Weiler2018.cpp │ └── Viscosity_Weiler2018.h ├── Vorticity │ ├── MicropolarModel_Bender2017.cpp │ ├── MicropolarModel_Bender2017.h │ ├── VorticityBase.cpp │ ├── VorticityBase.h │ ├── VorticityConfinement.cpp │ └── VorticityConfinement.h ├── WCSPH │ ├── SimulationDataWCSPH.cpp │ ├── SimulationDataWCSPH.h │ ├── TimeStepWCSPH.cpp │ └── TimeStepWCSPH.h ├── XSPH.cpp └── XSPH.h ├── Scripts ├── Maya │ ├── AESPHConfigurationNodeTemplate.mel │ ├── AESPHFluidConfigurationNodeTemplate.mel │ ├── AESPHFluidNodeTemplate.mel │ ├── AESPHRigidBodyNodeTemplate.mel │ ├── SPlisHSPlasH.py │ └── readme.md └── Paraview │ ├── README.md │ ├── paraview-partio-plugin.py │ └── partio_extension │ ├── partio_bindings.cpp │ ├── pyproject.toml │ ├── setup.cfg │ └── setup.py ├── Simulator ├── BoundarySimulator.cpp ├── BoundarySimulator.h ├── CMakeLists.txt ├── Exporter │ ├── ExporterBase.h │ ├── ParticleExporter_Partio.cpp │ ├── ParticleExporter_Partio.h │ ├── ParticleExporter_VTK.cpp │ ├── ParticleExporter_VTK.h │ ├── RigidBodyExporter_BIN.cpp │ ├── RigidBodyExporter_BIN.h │ ├── RigidBodyExporter_OBJ.cpp │ ├── RigidBodyExporter_OBJ.h │ ├── RigidBodyExporter_PLY.cpp │ ├── RigidBodyExporter_PLY.h │ ├── RigidBodyExporter_VTK.cpp │ └── RigidBodyExporter_VTK.h ├── ExporterRegistration.cpp ├── GUI │ ├── OpenGL │ │ ├── Simulator_OpenGL.cpp │ │ └── Simulator_OpenGL.h │ ├── Simulator_GUI_Base.h │ └── imgui │ │ ├── LogWindow.cpp │ │ ├── LogWindow.h │ │ ├── Simulator_GUI_imgui.cpp │ │ └── Simulator_GUI_imgui.h ├── PositionBasedDynamicsWrapper │ ├── PBDBoundarySimulator.cpp │ ├── PBDBoundarySimulator.h │ ├── PBDRigidBody.h │ ├── PBDWrapper.cpp │ ├── PBDWrapper.h │ ├── PBD_Simulator_GUI_TweakBar.cpp │ ├── PBD_Simulator_GUI_TweakBar.h │ ├── PBD_Simulator_GUI_imgui.cpp │ └── PBD_Simulator_GUI_imgui.h ├── SceneConfiguration.cpp ├── SceneConfiguration.h ├── ScriptObject.cpp ├── ScriptObject.h ├── SimulatorBase.cpp ├── SimulatorBase.h ├── StaticBoundarySimulator.cpp ├── StaticBoundarySimulator.h └── main.cpp ├── Tests ├── AVX │ ├── AVXTests.cpp │ └── CMakeLists.txt ├── CMakeLists.txt ├── Kernel │ ├── CMakeLists.txt │ └── KernelTests.cpp └── ReadWriteState │ ├── CMakeLists.txt │ └── ReadWriteStateTests.cpp ├── Tools ├── CMakeLists.txt ├── FoamGenerator │ ├── CMakeLists.txt │ ├── FoamKernel.cpp │ ├── FoamKernel.h │ └── main.cpp ├── MeshSkinning │ ├── CMakeLists.txt │ └── main.cpp ├── ParameterParser │ ├── CMakeLists.txt │ ├── JsonSchemaGenerator.cpp │ ├── JsonSchemaGenerator.h │ ├── ParameterObjectParser.cpp │ ├── ParameterObjectParser.h │ ├── SceneExampleGenerator.cpp │ ├── SceneExampleGenerator.h │ └── main.cpp ├── PartioViewer │ ├── CMakeLists.txt │ ├── GUI │ │ ├── OpenGL │ │ │ ├── PartioViewer_OpenGL.cpp │ │ │ └── PartioViewer_OpenGL.h │ │ ├── PartioViewer_GUI_Base.h │ │ └── imgui │ │ │ ├── PartioViewer_GUI_imgui.cpp │ │ │ └── PartioViewer_GUI_imgui.h │ ├── PartioViewer.cpp │ ├── PartioViewer.h │ └── main.cpp ├── SurfaceSampling │ ├── CMakeLists.txt │ └── main.cpp ├── VolumeSampling │ ├── CMakeLists.txt │ ├── SPHSamplingBase.cpp │ ├── SPHSamplingBase.h │ ├── SPHVolumeSampling.cpp │ ├── SPHVolumeSampling.h │ ├── SPHVolumeSampling_Jiang2015.cpp │ ├── SPHVolumeSampling_Jiang2015.h │ ├── SamplingBase.cpp │ ├── SamplingBase.h │ └── main.cpp └── partio2vtk │ ├── CMakeLists.txt │ └── main.cpp ├── Utilities ├── BinaryFileReaderWriter.h ├── CMakeLists.txt ├── Counting.h ├── FileSystem.h ├── Logger.h ├── OBJLoader.h ├── PLYLoader.h ├── PartioReaderWriter.cpp ├── PartioReaderWriter.h ├── StringTools.h ├── SystemInfo.h ├── Timing.h └── Version.h.in ├── data ├── Scenes │ ├── AnimatedBody_2D.json │ ├── AnimatedBody_2D.py │ ├── AnimationFields_2D.json │ ├── Beam.json │ ├── Beam_2D.json │ ├── BucklingModel_Bender2017.json │ ├── BucklingModel_Peer2015.json │ ├── BucklingModel_Peer2016.json │ ├── BucklingModel_Takahashi2015.json │ ├── BucklingModel_Weiler2018.json │ ├── Bunny_vs_Dragon.json │ ├── CoilingModel_Bender2017.json │ ├── CoilingModel_Peer2015.json │ ├── CoilingModel_Peer2016.json │ ├── CoilingModel_Takahashi2015.json │ ├── CoilingModel_Weiler2018.json │ ├── CompressibleSPH_ICSPH.json │ ├── CompressibleSPH_PF.json │ ├── CompressibleSPH_WCSPH.json │ ├── DamBreakModel.json │ ├── DamBreakModelDragons.json │ ├── DamBreakModel_2D.json │ ├── DamBreakWithObjects.json │ ├── DeformableBunnies.json │ ├── DeformableModel.json │ ├── DoubleDamBreak.json │ ├── DoubleDamBreakMultiPhase.json │ ├── DoubleDamBreakWithSphere.json │ ├── DragTest.json │ ├── Emitter.json │ ├── Emitter_2D.json │ ├── Empty.json │ ├── GridModel_Akinci2012.json │ ├── GridModel_Bender2019.json │ ├── GridModel_Koschier2017.json │ ├── MotorScene.json │ ├── MotorScene2.json │ ├── MultiPhaseColoring.json │ ├── Obstacle.json │ ├── ReadWriteStateTest.json │ ├── Sampling_2D.json │ ├── ScriptTest.json │ ├── ScriptTest.py │ ├── SurfaceTension_BoxHole_ZR2020.json │ ├── SurfaceTension_BreakDamZR2020.json │ ├── SurfaceTension_CoveredSphere_JWL+23.json │ ├── SurfaceTension_CoveredSphere_ZR2020.json │ ├── SurfaceTension_Crown_ZR2020.json │ ├── SurfaceTension_DoubleDroplet_ZR2020.json │ ├── SurfaceTension_FluidChain_JWL+23.json │ ├── SurfaceTension_NoGravCube_ZR2020.json │ ├── SurfaceTension_SnakeTestZR2020.json │ ├── SurfaceTension_WaterBell_JWL+23.json │ └── ViscousBunny.json ├── emitter_boundary │ ├── EmitterBox.obj │ └── EmitterCylinder.obj ├── models │ ├── BoxOpenedHole.obj │ ├── Dragon_50k.obj │ ├── UnitBox.obj │ ├── beam_r_0.025.bgeo │ ├── bunny.bgeo │ ├── bunny2.bgeo │ ├── cylinder.obj │ ├── particle_grid.bgeo │ ├── sphere.bgeo │ ├── sphere.obj │ └── torus.obj └── shaders │ ├── fs_points.glsl │ ├── fs_points_colormap.glsl │ ├── fs_smooth.glsl │ ├── vs_points_scalar.glsl │ ├── vs_points_vector.glsl │ └── vs_smooth.glsl ├── doc ├── Doxyfile ├── FoamGenerator.md ├── Makefile ├── MeshSkinning.md ├── PartioViewer.md ├── SurfaceSampling.md ├── VolumeSampling.md ├── about.md ├── architecture.md ├── bibliography.bib ├── bibliography.rst ├── build_from_source.md ├── cmake_options.md ├── conf.py ├── creating_pressure.md ├── file_format.md ├── getting_started.md ├── images │ ├── SPlisHSPlasH.jpg │ ├── SPlisHSPlasH1.jpg │ ├── SPlisHSPlasH2.jpg │ ├── SPlisHSPlasH3.jpg │ ├── SPlisHSPlasH4.jpg │ ├── SoftwareArchitechture.jpg │ ├── SoftwareArchitechture.tex │ ├── beam_meshes.jpg │ ├── logo.jpg │ ├── logo.pdf │ ├── logo_small.jpg │ ├── river_foam.jpg │ ├── teaser.gif │ ├── volume_sampling1.jpg │ ├── volume_sampling2.jpg │ └── walrus_press.jpg ├── implement_exporter.md ├── implement_nonpressure_force.md ├── index.rst ├── macros.md ├── mainpage.dox ├── make.bat ├── partio2vtk.md ├── py_creating_scenes.md ├── py_embedded_python.md ├── py_getting_started.md ├── py_restrictions.md ├── replicability.md └── requirements.txt ├── extern ├── Catch2 │ ├── LICENSE.txt │ └── catch.hpp ├── cxxopts │ └── cxxopts.hpp ├── eigen │ ├── CMakeLists.txt │ ├── COPYING.APACHE │ ├── COPYING.BSD │ ├── COPYING.GPL │ ├── COPYING.LGPL │ ├── COPYING.MINPACK │ ├── COPYING.MPL2 │ ├── COPYING.README │ ├── Eigen │ │ ├── CMakeLists.txt │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── KLUSupport │ │ ├── LU │ │ ├── MetisSupport │ │ ├── OrderingMethods │ │ ├── PaStiXSupport │ │ ├── PardisoSupport │ │ ├── QR │ │ ├── QtAlignedMalloc │ │ ├── SPQRSupport │ │ ├── SVD │ │ ├── Sparse │ │ ├── SparseCholesky │ │ ├── SparseCore │ │ ├── SparseLU │ │ ├── SparseQR │ │ ├── StdDeque │ │ ├── StdList │ │ ├── StdVector │ │ ├── SuperLUSupport │ │ ├── UmfPackSupport │ │ └── src │ │ │ ├── Cholesky │ │ │ ├── LDLT.h │ │ │ ├── LLT.h │ │ │ └── LLT_LAPACKE.h │ │ │ ├── CholmodSupport │ │ │ └── CholmodSupport.h │ │ │ ├── Core │ │ │ ├── ArithmeticSequence.h │ │ │ ├── Array.h │ │ │ ├── ArrayBase.h │ │ │ ├── ArrayWrapper.h │ │ │ ├── Assign.h │ │ │ ├── AssignEvaluator.h │ │ │ ├── Assign_MKL.h │ │ │ ├── BandMatrix.h │ │ │ ├── Block.h │ │ │ ├── BooleanRedux.h │ │ │ ├── CommaInitializer.h │ │ │ ├── ConditionEstimator.h │ │ │ ├── CoreEvaluators.h │ │ │ ├── CoreIterators.h │ │ │ ├── CwiseBinaryOp.h │ │ │ ├── CwiseNullaryOp.h │ │ │ ├── CwiseTernaryOp.h │ │ │ ├── CwiseUnaryOp.h │ │ │ ├── CwiseUnaryView.h │ │ │ ├── DenseBase.h │ │ │ ├── DenseCoeffsBase.h │ │ │ ├── DenseStorage.h │ │ │ ├── Diagonal.h │ │ │ ├── DiagonalMatrix.h │ │ │ ├── DiagonalProduct.h │ │ │ ├── Dot.h │ │ │ ├── EigenBase.h │ │ │ ├── ForceAlignedAccess.h │ │ │ ├── Fuzzy.h │ │ │ ├── GeneralProduct.h │ │ │ ├── GenericPacketMath.h │ │ │ ├── GlobalFunctions.h │ │ │ ├── IO.h │ │ │ ├── IndexedView.h │ │ │ ├── Inverse.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── MathFunctionsImpl.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PartialReduxEvaluator.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── Product.h │ │ │ ├── ProductEvaluators.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── Reshaped.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── Solve.h │ │ │ ├── SolveTriangular.h │ │ │ ├── SolverBase.h │ │ │ ├── StableNorm.h │ │ │ ├── StlIterators.h │ │ │ ├── Stride.h │ │ │ ├── Swap.h │ │ │ ├── Transpose.h │ │ │ ├── Transpositions.h │ │ │ ├── TriangularMatrix.h │ │ │ ├── VectorBlock.h │ │ │ ├── VectorwiseOp.h │ │ │ ├── Visitor.h │ │ │ ├── arch │ │ │ │ ├── AVX │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AVX512 │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AltiVec │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── MatrixProduct.h │ │ │ │ │ ├── MatrixProductCommon.h │ │ │ │ │ ├── MatrixProductMMA.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CUDA │ │ │ │ │ └── Complex.h │ │ │ │ ├── Default │ │ │ │ │ ├── BFloat16.h │ │ │ │ │ ├── ConjHelper.h │ │ │ │ │ ├── GenericPacketMathFunctions.h │ │ │ │ │ ├── GenericPacketMathFunctionsFwd.h │ │ │ │ │ ├── Half.h │ │ │ │ │ ├── Settings.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── GPU │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── HIP │ │ │ │ │ └── hcc │ │ │ │ │ │ └── math_constants.h │ │ │ │ ├── MSA │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── NEON │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SSE │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SVE │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SYCL │ │ │ │ │ ├── InteropHeaders.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ ├── SyclMemoryModel.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ └── ZVector │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ ├── functors │ │ │ │ ├── AssignmentFunctors.h │ │ │ │ ├── BinaryFunctors.h │ │ │ │ ├── NullaryFunctors.h │ │ │ │ ├── StlFunctors.h │ │ │ │ ├── TernaryFunctors.h │ │ │ │ └── UnaryFunctors.h │ │ │ ├── products │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ ├── GeneralMatrixMatrix.h │ │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ │ ├── GeneralMatrixVector.h │ │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ │ ├── Parallelizer.h │ │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ │ ├── SelfadjointMatrixVector.h │ │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ │ ├── SelfadjointProduct.h │ │ │ │ ├── SelfadjointRank2Update.h │ │ │ │ ├── TriangularMatrixMatrix.h │ │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ │ ├── TriangularMatrixVector.h │ │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ │ ├── TriangularSolverMatrix.h │ │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ │ └── TriangularSolverVector.h │ │ │ └── util │ │ │ │ ├── BlasUtil.h │ │ │ │ ├── ConfigureVectorization.h │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── IndexedViewHelper.h │ │ │ │ ├── IntegralConstant.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── ReshapedHelper.h │ │ │ │ ├── StaticAssert.h │ │ │ │ ├── SymbolicIndex.h │ │ │ │ └── XprHelper.h │ │ │ ├── Eigenvalues │ │ │ ├── ComplexEigenSolver.h │ │ │ ├── ComplexSchur.h │ │ │ ├── ComplexSchur_LAPACKE.h │ │ │ ├── EigenSolver.h │ │ │ ├── GeneralizedEigenSolver.h │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ │ ├── HessenbergDecomposition.h │ │ │ ├── MatrixBaseEigenvalues.h │ │ │ ├── RealQZ.h │ │ │ ├── RealSchur.h │ │ │ ├── RealSchur_LAPACKE.h │ │ │ ├── SelfAdjointEigenSolver.h │ │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ │ └── Tridiagonalization.h │ │ │ ├── Geometry │ │ │ ├── AlignedBox.h │ │ │ ├── AngleAxis.h │ │ │ ├── EulerAngles.h │ │ │ ├── Homogeneous.h │ │ │ ├── Hyperplane.h │ │ │ ├── OrthoMethods.h │ │ │ ├── ParametrizedLine.h │ │ │ ├── Quaternion.h │ │ │ ├── Rotation2D.h │ │ │ ├── RotationBase.h │ │ │ ├── Scaling.h │ │ │ ├── Transform.h │ │ │ ├── Translation.h │ │ │ ├── Umeyama.h │ │ │ └── arch │ │ │ │ └── Geometry_SIMD.h │ │ │ ├── Householder │ │ │ ├── BlockHouseholder.h │ │ │ ├── Householder.h │ │ │ └── HouseholderSequence.h │ │ │ ├── IterativeLinearSolvers │ │ │ ├── BasicPreconditioners.h │ │ │ ├── BiCGSTAB.h │ │ │ ├── ConjugateGradient.h │ │ │ ├── IncompleteCholesky.h │ │ │ ├── IncompleteLUT.h │ │ │ ├── IterativeSolverBase.h │ │ │ ├── LeastSquareConjugateGradient.h │ │ │ └── SolveWithGuess.h │ │ │ ├── Jacobi │ │ │ └── Jacobi.h │ │ │ ├── KLUSupport │ │ │ └── KLUSupport.h │ │ │ ├── LU │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── InverseImpl.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_LAPACKE.h │ │ │ └── arch │ │ │ │ └── InverseSize4.h │ │ │ ├── MetisSupport │ │ │ └── MetisSupport.h │ │ │ ├── OrderingMethods │ │ │ ├── Amd.h │ │ │ ├── Eigen_Colamd.h │ │ │ └── Ordering.h │ │ │ ├── PaStiXSupport │ │ │ └── PaStiXSupport.h │ │ │ ├── PardisoSupport │ │ │ └── PardisoSupport.h │ │ │ ├── QR │ │ │ ├── ColPivHouseholderQR.h │ │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ │ ├── CompleteOrthogonalDecomposition.h │ │ │ ├── FullPivHouseholderQR.h │ │ │ ├── HouseholderQR.h │ │ │ └── HouseholderQR_LAPACKE.h │ │ │ ├── SPQRSupport │ │ │ └── SuiteSparseQRSupport.h │ │ │ ├── SVD │ │ │ ├── BDCSVD.h │ │ │ ├── JacobiSVD.h │ │ │ ├── JacobiSVD_LAPACKE.h │ │ │ ├── SVDBase.h │ │ │ └── UpperBidiagonalization.h │ │ │ ├── SparseCholesky │ │ │ ├── SimplicialCholesky.h │ │ │ └── SimplicialCholesky_impl.h │ │ │ ├── SparseCore │ │ │ ├── AmbiVector.h │ │ │ ├── CompressedStorage.h │ │ │ ├── ConservativeSparseSparseProduct.h │ │ │ ├── MappedSparseMatrix.h │ │ │ ├── SparseAssign.h │ │ │ ├── SparseBlock.h │ │ │ ├── SparseColEtree.h │ │ │ ├── SparseCompressedBase.h │ │ │ ├── SparseCwiseBinaryOp.h │ │ │ ├── SparseCwiseUnaryOp.h │ │ │ ├── SparseDenseProduct.h │ │ │ ├── SparseDiagonalProduct.h │ │ │ ├── SparseDot.h │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseMap.h │ │ │ ├── SparseMatrix.h │ │ │ ├── SparseMatrixBase.h │ │ │ ├── SparsePermutation.h │ │ │ ├── SparseProduct.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseRef.h │ │ │ ├── SparseSelfAdjointView.h │ │ │ ├── SparseSolverBase.h │ │ │ ├── SparseSparseProductWithPruning.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseTriangularView.h │ │ │ ├── SparseUtil.h │ │ │ ├── SparseVector.h │ │ │ ├── SparseView.h │ │ │ └── TriangularSolver.h │ │ │ ├── SparseLU │ │ │ ├── SparseLU.h │ │ │ ├── SparseLUImpl.h │ │ │ ├── SparseLU_Memory.h │ │ │ ├── SparseLU_Structs.h │ │ │ ├── SparseLU_SupernodalMatrix.h │ │ │ ├── SparseLU_Utils.h │ │ │ ├── SparseLU_column_bmod.h │ │ │ ├── SparseLU_column_dfs.h │ │ │ ├── SparseLU_copy_to_ucol.h │ │ │ ├── SparseLU_gemm_kernel.h │ │ │ ├── SparseLU_heap_relax_snode.h │ │ │ ├── SparseLU_kernel_bmod.h │ │ │ ├── SparseLU_panel_bmod.h │ │ │ ├── SparseLU_panel_dfs.h │ │ │ ├── SparseLU_pivotL.h │ │ │ ├── SparseLU_pruneL.h │ │ │ └── SparseLU_relax_snode.h │ │ │ ├── SparseQR │ │ │ └── SparseQR.h │ │ │ ├── StlSupport │ │ │ ├── StdDeque.h │ │ │ ├── StdList.h │ │ │ ├── StdVector.h │ │ │ └── details.h │ │ │ ├── SuperLUSupport │ │ │ └── SuperLUSupport.h │ │ │ ├── UmfPackSupport │ │ │ └── UmfPackSupport.h │ │ │ ├── misc │ │ │ ├── Image.h │ │ │ ├── Kernel.h │ │ │ ├── RealSvd2x2.h │ │ │ ├── blas.h │ │ │ ├── lapack.h │ │ │ ├── lapacke.h │ │ │ └── lapacke_mangling.h │ │ │ └── plugins │ │ │ ├── ArrayCwiseBinaryOps.h │ │ │ ├── ArrayCwiseUnaryOps.h │ │ │ ├── BlockMethods.h │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ ├── CommonCwiseUnaryOps.h │ │ │ ├── IndexedViewMethods.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ ├── MatrixCwiseUnaryOps.h │ │ │ └── ReshapedMethods.h │ ├── signature_of_eigen3_matrix_library │ └── version.txt ├── glfw │ ├── CMake │ │ ├── GenerateMappings.cmake │ │ ├── MacOSXBundleInfo.plist.in │ │ ├── i686-w64-mingw32-clang.cmake │ │ ├── i686-w64-mingw32.cmake │ │ ├── modules │ │ │ ├── FindEpollShim.cmake │ │ │ ├── FindOSMesa.cmake │ │ │ ├── FindWaylandProtocols.cmake │ │ │ └── FindXKBCommon.cmake │ │ ├── x86_64-w64-mingw32-clang.cmake │ │ └── x86_64-w64-mingw32.cmake │ ├── CMakeLists.txt │ ├── CONTRIBUTORS.md │ ├── LICENSE.md │ ├── README.md │ ├── cmake_uninstall.cmake.in │ ├── deps │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── glad │ │ │ ├── gl.h │ │ │ ├── khrplatform.h │ │ │ ├── vk_platform.h │ │ │ └── vulkan.h │ │ ├── glad_gl.c │ │ ├── glad_vulkan.c │ │ ├── linmath.h │ │ ├── mingw │ │ │ ├── _mingw_dxhelper.h │ │ │ ├── dinput.h │ │ │ └── xinput.h │ │ ├── nuklear.h │ │ ├── nuklear_glfw_gl2.h │ │ ├── stb_image_write.h │ │ ├── tinycthread.c │ │ ├── tinycthread.h │ │ └── vs2008 │ │ │ └── stdint.h │ ├── include │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ ├── src │ │ ├── CMakeLists.txt │ │ ├── cocoa_init.m │ │ ├── cocoa_joystick.h │ │ ├── cocoa_joystick.m │ │ ├── cocoa_monitor.m │ │ ├── cocoa_platform.h │ │ ├── cocoa_time.c │ │ ├── cocoa_window.m │ │ ├── context.c │ │ ├── egl_context.c │ │ ├── egl_context.h │ │ ├── glfw3.pc.in │ │ ├── glfw3Config.cmake.in │ │ ├── glfw_config.h.in │ │ ├── glx_context.c │ │ ├── glx_context.h │ │ ├── init.c │ │ ├── input.c │ │ ├── internal.h │ │ ├── linux_joystick.c │ │ ├── linux_joystick.h │ │ ├── mappings.h │ │ ├── mappings.h.in │ │ ├── monitor.c │ │ ├── nsgl_context.h │ │ ├── nsgl_context.m │ │ ├── null_init.c │ │ ├── null_joystick.c │ │ ├── null_joystick.h │ │ ├── null_monitor.c │ │ ├── null_platform.h │ │ ├── null_window.c │ │ ├── osmesa_context.c │ │ ├── osmesa_context.h │ │ ├── posix_thread.c │ │ ├── posix_thread.h │ │ ├── posix_time.c │ │ ├── posix_time.h │ │ ├── vulkan.c │ │ ├── wgl_context.c │ │ ├── wgl_context.h │ │ ├── win32_init.c │ │ ├── win32_joystick.c │ │ ├── win32_joystick.h │ │ ├── win32_monitor.c │ │ ├── win32_platform.h │ │ ├── win32_thread.c │ │ ├── win32_time.c │ │ ├── win32_window.c │ │ ├── window.c │ │ ├── wl_init.c │ │ ├── wl_monitor.c │ │ ├── wl_platform.h │ │ ├── wl_window.c │ │ ├── x11_init.c │ │ ├── x11_monitor.c │ │ ├── x11_platform.h │ │ ├── x11_window.c │ │ ├── xkb_unicode.c │ │ └── xkb_unicode.h │ └── version.txt ├── happly │ ├── LICENSE │ ├── README.md │ └── happly.h ├── imgui │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── backends │ │ ├── imgui_impl_glfw.cpp │ │ ├── imgui_impl_glfw.h │ │ ├── imgui_impl_opengl3.cpp │ │ ├── imgui_impl_opengl3.h │ │ └── imgui_impl_opengl3_loader.h │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── misc │ │ └── fonts │ │ ├── Cousine-Regular.ttf │ │ ├── DroidSans.ttf │ │ ├── Karla-Regular.ttf │ │ ├── ProggyClean.ttf │ │ ├── ProggyTiny.ttf │ │ ├── Roboto-Medium.ttf │ │ └── binary_to_compressed_c.cpp ├── json │ └── json.hpp ├── md5 │ ├── CMakeLists.txt │ ├── md5.cpp │ └── md5.h ├── nfd │ ├── CMakeLists.txt │ ├── LICENSE │ ├── include │ │ ├── nfd.h │ │ └── nfd.hpp │ ├── nfd_cocoa.m │ ├── nfd_gtk.cpp │ ├── nfd_portal.cpp │ └── nfd_win.cpp ├── partio │ ├── CMakeLists.txt │ ├── README │ └── src │ │ └── lib │ │ ├── CMakeLists.txt │ │ ├── Partio.h │ │ ├── PartioAttribute.h │ │ ├── PartioConfig.h │ │ ├── PartioIterator.h │ │ ├── PartioSe.cpp │ │ ├── PartioSe.h │ │ ├── PartioVec3.h │ │ ├── core │ │ ├── KdTree.h │ │ ├── Mutex.h │ │ ├── Particle.cpp │ │ ├── ParticleCaching.cpp │ │ ├── ParticleCaching.h │ │ ├── ParticleHeaders.cpp │ │ ├── ParticleHeaders.h │ │ ├── ParticleSimple.cpp │ │ ├── ParticleSimple.h │ │ ├── ParticleSimpleInterleave.cpp │ │ └── ParticleSimpleInterleave.h │ │ └── io │ │ ├── BGEO.cpp │ │ ├── BIN.cpp │ │ ├── GEO.cpp │ │ ├── MC.cpp │ │ ├── PDA.cpp │ │ ├── PDB.cpp │ │ ├── PDC.cpp │ │ ├── PRT.cpp │ │ ├── PTC.cpp │ │ ├── PTS.cpp │ │ ├── ParticleIO.cpp │ │ ├── PartioEndian.h │ │ ├── RIB.cpp │ │ ├── ZIP.cpp │ │ ├── ZIP.h │ │ ├── half2float.h │ │ ├── pdb.h │ │ └── readers.h ├── pybind │ ├── CMakeLists.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.rst │ ├── include │ │ └── pybind11 │ │ │ ├── attr.h │ │ │ ├── buffer_info.h │ │ │ ├── cast.h │ │ │ ├── chrono.h │ │ │ ├── common.h │ │ │ ├── complex.h │ │ │ ├── detail │ │ │ ├── class.h │ │ │ ├── common.h │ │ │ ├── descr.h │ │ │ ├── init.h │ │ │ ├── internals.h │ │ │ ├── type_caster_base.h │ │ │ └── typeid.h │ │ │ ├── eigen.h │ │ │ ├── embed.h │ │ │ ├── eval.h │ │ │ ├── functional.h │ │ │ ├── gil.h │ │ │ ├── iostream.h │ │ │ ├── numpy.h │ │ │ ├── operators.h │ │ │ ├── options.h │ │ │ ├── pybind11.h │ │ │ ├── pytypes.h │ │ │ ├── stl.h │ │ │ ├── stl │ │ │ └── filesystem.h │ │ │ └── stl_bind.h │ ├── pybind11 │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── _version.py │ │ ├── commands.py │ │ ├── py.typed │ │ └── setup_helpers.py │ ├── pyproject.toml │ ├── setup.cfg │ ├── setup.py │ ├── tools │ │ ├── FindCatch.cmake │ │ ├── FindEigen3.cmake │ │ ├── FindPythonLibsNew.cmake │ │ ├── JoinPaths.cmake │ │ ├── check-style.sh │ │ ├── cmake_uninstall.cmake.in │ │ ├── codespell_ignore_lines_from_errors.py │ │ ├── libsize.py │ │ ├── make_changelog.py │ │ ├── pybind11.pc.in │ │ ├── pybind11Common.cmake │ │ ├── pybind11Config.cmake.in │ │ ├── pybind11NewTools.cmake │ │ ├── pybind11Tools.cmake │ │ ├── pyproject.toml │ │ ├── setup_global.py.in │ │ └── setup_main.py.in │ └── version.txt ├── tinyexpr │ ├── CMakeLists.txt │ ├── LICENSE │ ├── tinyexpr.c │ └── tinyexpr.h ├── toojpeg │ ├── LICENSE │ ├── toojpeg.cpp │ └── toojpeg.h └── zlib │ ├── CMakeLists.txt │ └── src │ ├── adler32.c │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── gzio.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zlib.h │ ├── zutil.c │ └── zutil.h ├── pySPlisHSPlasH ├── AnimationFieldModule.cpp ├── BoundaryModelModule.cpp ├── CMakeLists.txt ├── DFSPHModule.cpp ├── DragModule.cpp ├── ElasticityModule.cpp ├── Embedded.cpp ├── Embedded.h ├── EmitterModule.cpp ├── ExporterModule.cpp ├── ExtrasModule.cpp ├── FluidModelModule.cpp ├── GUIModule.cpp ├── ICSPHModule.cpp ├── IISPHModule.cpp ├── NonPressureForceBaseModule.cpp ├── PBDModule.cpp ├── PBFModule.cpp ├── PCISPHModule.cpp ├── PFModule.cpp ├── ParameterObjectModule.cpp ├── RigidBodyModule.cpp ├── SPHKernelsModule.cpp ├── SimulationModule.cpp ├── StaticRigidBodyModule.cpp ├── SurfaceTensionModule.cpp ├── TimeModule.cpp ├── TriangleMeshModule.cpp ├── UtilitiesModule.cpp ├── ViscosityModule.cpp ├── VorticityModule.cpp ├── WCSPHModule.cpp ├── XSPHModule.cpp ├── __init__.py ├── bind_pointer_vector.h ├── common.h ├── examples │ ├── SPHSimulator.py │ ├── add_field.py │ ├── animated_body.py │ ├── animated_body_2D.py │ ├── callbacks.py │ ├── complex_scene.py │ ├── custom_exporter.py │ ├── custom_scene.py │ ├── minimal_gui.py │ ├── minimal_no_gui.py │ └── plot.py ├── main.cpp └── scripts │ ├── __init__.py │ └── simulator.py ├── setup.cfg ├── setup.py └── version.txt /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.11" 12 | # You can also specify other tool versions: 13 | # nodejs: "20" 14 | # rust: "1.70" 15 | # golang: "1.20" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: doc/conf.py 20 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 21 | # builder: "dirhtml" 22 | # Fail on all warnings to avoid broken references 23 | # fail_on_warning: true 24 | 25 | # Optionally build your docs in additional formats such as PDF and ePub 26 | # formats: 27 | # - pdf 28 | # - epub 29 | 30 | # Optional but recommended, declare the Python requirements required 31 | # to build your documentation 32 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 33 | python: 34 | install: 35 | - requirements: doc/requirements.txt -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | title: SPlisHSPlasH Library 3 | message: >- 4 | If you use this software, please cite it using the 5 | metadata from this file. 6 | type: software 7 | authors: 8 | - given-names: Jan 9 | family-names: Bender 10 | - family-names: others 11 | identifiers: 12 | - type: url 13 | value: >- 14 | https://github.com/InteractiveComputerGraphics/SPlisHSPlasH 15 | repository-code: >- 16 | https://github.com/InteractiveComputerGraphics/SPlisHSPlasH 17 | keywords: 18 | - Smoothed Particle Hydrodynamics 19 | - SPH 20 | - fluids 21 | - simulation 22 | license: MIT 23 | 24 | -------------------------------------------------------------------------------- /CMake/DataCopyTargets.cmake: -------------------------------------------------------------------------------- 1 | add_custom_target(CopySPlisHSPlasHShaders 2 | ${CMAKE_COMMAND} -E copy_directory 3 | ${PROJECT_SOURCE_DIR}/data/shaders 4 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/shaders 5 | COMMENT "Copying SPlisHSPlasH shaders" 6 | ) 7 | set_target_properties(CopySPlisHSPlasHShaders PROPERTIES FOLDER "Data copy") 8 | 9 | add_custom_target(CopyEmitterModels 10 | ${CMAKE_COMMAND} -E copy_directory 11 | ${PROJECT_SOURCE_DIR}/data/emitter_boundary 12 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/emitter_boundary 13 | COMMENT "Copying SPlisHSPlasH emitter models" 14 | ) 15 | set_target_properties(CopyEmitterModels PROPERTIES FOLDER "Data copy") 16 | 17 | add_custom_target(CopyPBDShaders 18 | ${CMAKE_COMMAND} -E copy_directory 19 | ${PBD_INCLUDE_DIR}/data/shaders 20 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/pbd_shaders 21 | COMMENT "Copying PBD shaders" 22 | ) 23 | add_dependencies(CopyPBDShaders Ext_PBD) 24 | set_target_properties(CopyPBDShaders PROPERTIES FOLDER "Data copy") 25 | 26 | add_custom_target(CopyImguiFonts 27 | ${CMAKE_COMMAND} -E copy_directory 28 | ${PROJECT_SOURCE_DIR}/extern/imgui/misc/fonts 29 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/fonts 30 | COMMENT "Copying fonts" 31 | ) 32 | set_target_properties(CopyImguiFonts PROPERTIES FOLDER "Data copy") 33 | -------------------------------------------------------------------------------- /CMake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /GUI/OpenGL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(VIS_HEADER_FILES 2 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/MiniGL.h 3 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/Selection.h 4 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/Shader.h 5 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/colormaps/colormap_jet.h 6 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/colormaps/colormap_plasma.h 7 | ) 8 | 9 | 10 | set(VIS_SOURCE_FILES 11 | ${PROJECT_SOURCE_DIR}/extern/glfw/deps/glad_gl.c 12 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/MiniGL.cpp 13 | ${PROJECT_SOURCE_DIR}/GUI/OpenGL/Shader.cpp 14 | ) 15 | 16 | 17 | set(VIS_FILES 18 | ${VIS_HEADER_FILES} 19 | ${VIS_SOURCE_FILES} 20 | ) 21 | 22 | # A macro for the source groups 23 | macro(VIS_SOURCE_GROUPS) 24 | source_group("Header Files\\GUI\\OpenGL" FILES ${VIS_HEADER_FILES}) 25 | source_group("Source Files\\GUI\\OpenGL" FILES ${VIS_SOURCE_FILES}) 26 | endmacro(VIS_SOURCE_GROUPS) 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /GUI/OpenGL/Shader.h: -------------------------------------------------------------------------------- 1 | #ifndef __Shader_h__ 2 | #define __Shader_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace SPH 9 | { 10 | class Shader 11 | { 12 | public: 13 | Shader(); 14 | ~Shader(); 15 | 16 | void compileShaderString(GLenum whichShader, const std::string &source); 17 | void compileShaderFile(GLenum whichShader, const std::string &filename); 18 | void createAndLinkProgram(); 19 | void addAttribute(const std::string &attribute); 20 | void addUniform(const std::string &uniform); 21 | bool isInitialized(); 22 | 23 | void begin(); 24 | void end(); 25 | 26 | //An indexer that returns the location of the attribute/uniform 27 | GLuint getAttribute(const std::string &attribute); 28 | GLuint getUniform(const std::string &uniform); 29 | 30 | private: 31 | bool m_initialized; 32 | GLuint m_program; 33 | std::map m_attributes; 34 | std::map m_uniforms; 35 | GLuint m_shaders[3]; 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /GUI/imgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(IMGUI_HEADER_FILES 2 | ${PROJECT_SOURCE_DIR}/GUI/imgui/imguiParameters.h 3 | ) 4 | 5 | 6 | set(IMGUI_SOURCE_FILES 7 | ${PROJECT_SOURCE_DIR}/GUI/imgui/imguiParameters.cpp 8 | ) 9 | 10 | 11 | set(GUI_FILES 12 | ${IMGUI_HEADER_FILES} 13 | ${IMGUI_SOURCE_FILES} 14 | ) 15 | 16 | # A macro for the source groups 17 | macro(GUI_SOURCE_GROUPS) 18 | source_group("Header Files\\GUI\\imgui" FILES ${IMGUI_HEADER_FILES}) 19 | source_group("Source Files\\GUI\\imgui" FILES ${IMGUI_SOURCE_FILES}) 20 | endmacro(GUI_SOURCE_GROUPS) 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jan Bender 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include data * 2 | recursive-exclude data/Scenes/Cache * -------------------------------------------------------------------------------- /SPlisHSPlasH/AnimationFieldSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "AnimationFieldSystem.h" 2 | #include "FluidModel.h" 3 | #include "TimeStep.h" 4 | #include "Utilities/Logger.h" 5 | #include "Simulation.h" 6 | 7 | 8 | using namespace SPH; 9 | 10 | 11 | AnimationFieldSystem::AnimationFieldSystem() : 12 | m_fields() 13 | { 14 | } 15 | 16 | AnimationFieldSystem::~AnimationFieldSystem(void) 17 | { 18 | for (size_t i = 0; i < m_fields.size(); i++) 19 | delete m_fields[i]; 20 | } 21 | 22 | void AnimationFieldSystem::step() 23 | { 24 | for (size_t i = 0; i < m_fields.size(); i++) 25 | { 26 | m_fields[i]->step(); 27 | } 28 | } 29 | 30 | void AnimationFieldSystem::reset() 31 | { 32 | for (size_t i = 0; i < m_fields.size(); i++) 33 | { 34 | m_fields[i]->reset(); 35 | } 36 | } 37 | 38 | void AnimationFieldSystem::addAnimationField( 39 | const std::string &particleFieldName, 40 | const Vector3r &pos, const Matrix3r & rotation, const Vector3r &scale, 41 | const std::string expression[3], const unsigned int type) 42 | { 43 | m_fields.push_back(new AnimationField( 44 | particleFieldName, 45 | pos, rotation, scale, 46 | expression, type)); 47 | } 48 | -------------------------------------------------------------------------------- /SPlisHSPlasH/AnimationFieldSystem.h: -------------------------------------------------------------------------------- 1 | #ifndef __AnimationFieldSystem_h__ 2 | #define __AnimationFieldSystem_h__ 3 | 4 | #include "Common.h" 5 | #include 6 | #include "AnimationField.h" 7 | 8 | namespace SPH 9 | { 10 | class TimeStep; 11 | class FluidModel; 12 | 13 | class AnimationFieldSystem 14 | { 15 | public: 16 | AnimationFieldSystem(); 17 | virtual ~AnimationFieldSystem(); 18 | 19 | protected: 20 | std::vector m_fields; 21 | 22 | //void resetState(); 23 | 24 | public: 25 | void addAnimationField(const std::string &particleFieldName, const Vector3r &pos, const Matrix3r & rotation, const Vector3r &scale, 26 | const std::string expression[3], const unsigned int type); 27 | unsigned int numAnimationFields() const { return static_cast(m_fields.size()); } 28 | std::vector &getAnimationFields() { return m_fields; } 29 | 30 | void step(); 31 | void reset(); 32 | }; 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /SPlisHSPlasH/BoundaryModel.cpp: -------------------------------------------------------------------------------- 1 | #include "BoundaryModel.h" 2 | #include "SPHKernels.h" 3 | #include 4 | #include "TimeManager.h" 5 | #include "TimeStep.h" 6 | #include "Utilities/Logger.h" 7 | #include "NeighborhoodSearch.h" 8 | #include "Simulation.h" 9 | 10 | using namespace SPH; 11 | 12 | 13 | BoundaryModel::BoundaryModel() : 14 | m_forcePerThread(), 15 | m_torquePerThread() 16 | { 17 | } 18 | 19 | BoundaryModel::~BoundaryModel(void) 20 | { 21 | m_forcePerThread.clear(); 22 | m_torquePerThread.clear(); 23 | 24 | delete m_rigidBody; 25 | } 26 | 27 | void BoundaryModel::reset() 28 | { 29 | for (int j = 0; j < m_forcePerThread.size(); j++) 30 | { 31 | m_forcePerThread[j].setZero(); 32 | m_torquePerThread[j].setZero(); 33 | } 34 | } 35 | 36 | void BoundaryModel::getForceAndTorque(Vector3r &force, Vector3r &torque) 37 | { 38 | force.setZero(); 39 | torque.setZero(); 40 | for (int j = 0; j < m_forcePerThread.size(); j++) 41 | { 42 | force += m_forcePerThread[j]; 43 | torque += m_torquePerThread[j]; 44 | } 45 | } 46 | 47 | void BoundaryModel::clearForceAndTorque() 48 | { 49 | for (int j = 0; j < m_forcePerThread.size(); j++) 50 | { 51 | m_forcePerThread[j].setZero(); 52 | m_torquePerThread[j].setZero(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Drag/DragBase.cpp: -------------------------------------------------------------------------------- 1 | #include "DragBase.h" 2 | 3 | using namespace SPH; 4 | using namespace GenParam; 5 | 6 | int DragBase::DRAG_COEFFICIENT = -1; 7 | 8 | 9 | DragBase::DragBase(FluidModel *model) : 10 | NonPressureForceBase(model) 11 | { 12 | m_dragCoefficient = static_cast(0.01); 13 | } 14 | 15 | DragBase::~DragBase(void) 16 | { 17 | } 18 | 19 | void DragBase::initParameters() 20 | { 21 | NonPressureForceBase::initParameters(); 22 | 23 | DRAG_COEFFICIENT = createNumericParameter("drag", "Drag coefficient", &m_dragCoefficient); 24 | setGroup(DRAG_COEFFICIENT, "Fluid Model|Drag force"); 25 | setDescription(DRAG_COEFFICIENT, "Coefficient for the drag force computation"); 26 | RealParameter* rparam = static_cast(getParameter(DRAG_COEFFICIENT)); 27 | rparam->setMinValue(0.0); 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Drag/DragBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __DragBase_h__ 2 | #define __DragBase_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "SPlisHSPlasH/NonPressureForceBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Base class for all drag force methods. 11 | */ 12 | class DragBase : public NonPressureForceBase 13 | { 14 | protected: 15 | Real m_dragCoefficient; 16 | 17 | virtual void initParameters(); 18 | 19 | public: 20 | static int DRAG_COEFFICIENT; 21 | 22 | DragBase(FluidModel *model); 23 | virtual ~DragBase(void); 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Drag/DragForce_Gissler2017.h: -------------------------------------------------------------------------------- 1 | #ifndef __DragForce_Gissler2017_h__ 2 | #define __DragForce_Gissler2017_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "DragBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief This class implements the drag force computation introduced 11 | * by Gissler et al. [GBP+17]. 12 | * 13 | * References: 14 | * - [GPB+17] Christoph Gissler, Stefan Band, Andreas Peer, Markus Ihmsen, and Matthias Teschner. Approximate air-fluid interactions for SPH. In Virtual Reality Interactions and Physical Simulations, 1-10. April 2017. URL: http://dx.doi.org/10.2312/vriphys.20171081 15 | */ 16 | class DragForce_Gissler2017 : public DragBase 17 | { 18 | protected: 19 | const Real rho_a = static_cast(1.2041); 20 | const Real sigma = static_cast(0.0724); 21 | const Real mu_l = static_cast(0.00102); 22 | const Real C_F = static_cast(1.0/3.0); 23 | const Real C_k = static_cast(8.0); 24 | const Real C_d = static_cast(5.0); 25 | const Real C_b = static_cast(0.5); 26 | const Real mu_a = static_cast(0.00001845); 27 | 28 | public: 29 | DragForce_Gissler2017(FluidModel *model); 30 | virtual ~DragForce_Gissler2017(void); 31 | 32 | static NonPressureForceBase* creator(FluidModel* model) { return new DragForce_Gissler2017(model); } 33 | 34 | virtual void step(); 35 | virtual void reset(); 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Drag/DragForce_Macklin2014.cpp: -------------------------------------------------------------------------------- 1 | #include "DragForce_Macklin2014.h" 2 | #include "SPlisHSPlasH/TimeManager.h" 3 | 4 | using namespace SPH; 5 | 6 | DragForce_Macklin2014::DragForce_Macklin2014(FluidModel *model) : 7 | DragBase(model) 8 | { 9 | } 10 | 11 | DragForce_Macklin2014::~DragForce_Macklin2014(void) 12 | { 13 | } 14 | 15 | void DragForce_Macklin2014::step() 16 | { 17 | const Real density0 = m_model->getDensity0(); 18 | 19 | const unsigned int numParticles = m_model->numActiveParticles(); 20 | 21 | #pragma omp parallel default(shared) 22 | { 23 | #pragma omp for schedule(static) 24 | for (int i = 0; i < (int)numParticles; i++) 25 | { 26 | Vector3r &ai = m_model->getAcceleration(i); 27 | const Vector3r &vi = m_model->getVelocity(i); 28 | ai -= m_dragCoefficient * static_cast(1.0) / m_model->getMass(i) * vi * (1.0 - m_model->getDensity(i) / density0); 29 | } 30 | } 31 | } 32 | 33 | 34 | void DragForce_Macklin2014::reset() 35 | { 36 | } 37 | 38 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Drag/DragForce_Macklin2014.h: -------------------------------------------------------------------------------- 1 | #ifndef __DragForce_Macklin2014_h__ 2 | #define __DragForce_Macklin2014_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "DragBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief This class implements the drag force computation introduced 11 | * by Macklin et al. [MMCK14]. 12 | * 13 | * References: 14 | * - [MMCK14] Miles Macklin, Matthias Müller, Nuttapong Chentanez, and Tae-Yong Kim. Unified Particle Physics for Real-Time Applications. ACM Trans. Graph., 33(4):1-12, 2014. URL: http://doi.acm.org/10.1145/2601097.2601152 15 | */ 16 | class DragForce_Macklin2014 : public DragBase 17 | { 18 | public: 19 | DragForce_Macklin2014(FluidModel *model); 20 | virtual ~DragForce_Macklin2014(void); 21 | 22 | static NonPressureForceBase* creator(FluidModel* model) { return new DragForce_Macklin2014(model); } 23 | 24 | virtual void step(); 25 | virtual void reset(); 26 | }; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Elasticity/ElasticityBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __ElasticityBase_h__ 2 | #define __ElasticityBase_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "SPlisHSPlasH/NonPressureForceBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Base class for all elasticity methods. 11 | */ 12 | class ElasticityBase : public NonPressureForceBase 13 | { 14 | protected: 15 | Real m_youngsModulus; 16 | Real m_poissonRatio; 17 | Vector3r m_fixedBoxMin; 18 | Vector3r m_fixedBoxMax; 19 | 20 | virtual void initParameters(); 21 | void determineFixedParticles(); 22 | 23 | public: 24 | static int YOUNGS_MODULUS; 25 | static int POISSON_RATIO; 26 | static int FIXED_BOX_MIN; 27 | static int FIXED_BOX_MAX; 28 | 29 | ElasticityBase(FluidModel *model); 30 | virtual ~ElasticityBase(void); 31 | }; 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /SPlisHSPlasH/NeighborhoodSearch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define GPU_NEIGHBORHOOD_SEARCH 4 | #if USE_DOUBLE 5 | #define CUNSEARCH_USE_DOUBLE_PRECISION 6 | #endif 7 | 8 | #ifdef GPU_NEIGHBORHOOD_SEARCH 9 | #include "cuNSearch.h" 10 | typedef cuNSearch::NeighborhoodSearch NeighborhoodSearch; 11 | #else 12 | #include "CompactNSearch.h" 13 | typedef CompactNSearch::NeighborhoodSearch NeighborhoodSearch; 14 | #endif 15 | -------------------------------------------------------------------------------- /SPlisHSPlasH/NonPressureForceBase.cpp: -------------------------------------------------------------------------------- 1 | #include "NonPressureForceBase.h" 2 | 3 | using namespace SPH; 4 | 5 | NonPressureForceBase::NonPressureForceBase(FluidModel *model) 6 | { 7 | m_model = model; 8 | } 9 | 10 | NonPressureForceBase::~NonPressureForceBase(void) 11 | { 12 | } 13 | 14 | void NonPressureForceBase::init() 15 | { 16 | initParameters(); 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /SPlisHSPlasH/NonPressureForceBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __NonPressureForceBaseBase_h__ 2 | #define __NonPressureForceBaseBase_h__ 3 | 4 | #include "Common.h" 5 | #include "FluidModel.h" 6 | #include "ParameterObject.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Base class for all non-pressure force methods. 11 | */ 12 | class NonPressureForceBase : public GenParam::ParameterObject 13 | { 14 | protected: 15 | FluidModel *m_model; 16 | 17 | public: 18 | NonPressureForceBase(FluidModel *model); 19 | NonPressureForceBase(const NonPressureForceBase&) = delete; 20 | NonPressureForceBase& operator=(const NonPressureForceBase&) = delete; 21 | virtual ~NonPressureForceBase(void); 22 | 23 | virtual void step() = 0; 24 | virtual void reset() {}; 25 | 26 | virtual void performNeighborhoodSearchSort() {}; 27 | virtual void emittedParticles(const unsigned int startIndex) {}; 28 | 29 | virtual void saveState(BinaryFileWriter &binWriter) {}; 30 | virtual void loadState(BinaryFileReader &binReader) {}; 31 | 32 | FluidModel *getModel() { return m_model; } 33 | 34 | virtual void init(); 35 | /** This function is called after the simulation scene is loaded and all 36 | * parameters are initialized. While reading a scene file several parameters 37 | * can change. The deferred init function should initialize all values which 38 | * depend on these parameters. 39 | */ 40 | virtual void deferredInit() {}; 41 | }; 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /SPlisHSPlasH/PBF/TimeIntegration.cpp: -------------------------------------------------------------------------------- 1 | #include "TimeIntegration.h" 2 | 3 | using namespace SPH; 4 | 5 | 6 | // ---------------------------------------------------------------------------------------------- 7 | void TimeIntegration::semiImplicitEuler( 8 | const Real h, 9 | const Real mass, 10 | Vector3r &position, 11 | Vector3r &velocity, 12 | const Vector3r &acceleration) 13 | { 14 | if (mass != 0.0) 15 | { 16 | velocity += acceleration * h; 17 | position += velocity * h; 18 | } 19 | } 20 | 21 | // ---------------------------------------------------------------------------------------------- 22 | void TimeIntegration::velocityUpdateFirstOrder( 23 | const Real h, 24 | const Real mass, 25 | const Vector3r &position, 26 | const Vector3r &oldPosition, 27 | Vector3r &velocity) 28 | { 29 | if (mass != 0.0) 30 | velocity = (1.0 / h) * (position - oldPosition); 31 | } 32 | 33 | // ---------------------------------------------------------------------------------------------- 34 | void TimeIntegration::velocityUpdateSecondOrder( 35 | const Real h, 36 | const Real mass, 37 | const Vector3r &position, 38 | const Vector3r &oldPosition, 39 | const Vector3r &positionOfLastStep, 40 | Vector3r &velocity) 41 | { 42 | if (mass != 0.0) 43 | velocity = (1.0 / h) * (1.5*position - 2.0*oldPosition + 0.5*positionOfLastStep); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /SPlisHSPlasH/PCISPH/TimeStepPCISPH.h: -------------------------------------------------------------------------------- 1 | #ifndef __TimeStepPCISPH_h__ 2 | #define __TimeStepPCISPH_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/TimeStep.h" 6 | #include "SimulationDataPCISPH.h" 7 | 8 | namespace SPH 9 | { 10 | class SimulationDataPCISPH; 11 | 12 | /** \brief This class implements the Predictive-corrective Incompressible SPH approach introduced 13 | * by Solenthaler and Pajarola [SP09]. 14 | * 15 | * References: 16 | * - [SP09] B. Solenthaler and R. Pajarola. Predictive-corrective incompressible SPH. ACM Trans. Graph., 28(3):40:1-40:6, July 2009. URL: http://doi.acm.org/10.1145/1531326.1531346 17 | */ 18 | class TimeStepPCISPH : public TimeStep 19 | { 20 | protected: 21 | SimulationDataPCISPH m_simulationData; 22 | 23 | void pressureSolve(); 24 | void pressureSolveIteration(const unsigned int fluidModelIndex, Real &avg_density_err); 25 | 26 | virtual void performNeighborhoodSearchSort(); 27 | 28 | virtual void emittedParticles(FluidModel *model, const unsigned int startIndex); 29 | 30 | public: 31 | TimeStepPCISPH(); 32 | virtual ~TimeStepPCISPH(void); 33 | 34 | virtual void step(); 35 | virtual void reset(); 36 | virtual void resize(); 37 | }; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /SPlisHSPlasH/SurfaceTension/SurfaceTensionBase.cpp: -------------------------------------------------------------------------------- 1 | #include "SurfaceTensionBase.h" 2 | 3 | using namespace SPH; 4 | using namespace GenParam; 5 | 6 | int SurfaceTensionBase::SURFACE_TENSION = -1; 7 | int SurfaceTensionBase::SURFACE_TENSION_BOUNDARY = -1; 8 | 9 | SurfaceTensionBase::SurfaceTensionBase(FluidModel *model) : 10 | NonPressureForceBase(model) 11 | { 12 | m_surfaceTension = 0.05; 13 | m_surfaceTensionBoundary = 0.01; 14 | } 15 | 16 | SurfaceTensionBase::~SurfaceTensionBase(void) 17 | { 18 | } 19 | 20 | void SurfaceTensionBase::initParameters() 21 | { 22 | NonPressureForceBase::initParameters(); 23 | 24 | SURFACE_TENSION = createNumericParameter("surfaceTension", "Surface tension coefficient", &m_surfaceTension); 25 | setGroup(SURFACE_TENSION, "Fluid Model|Surface tension"); 26 | setDescription(SURFACE_TENSION, "Coefficient for the surface tension computation"); 27 | RealParameter* rparam = static_cast(getParameter(SURFACE_TENSION)); 28 | rparam->setMinValue(0.0); 29 | 30 | SURFACE_TENSION_BOUNDARY = createNumericParameter("surfaceTensionBoundary", "Boundary surface tension coefficient", &m_surfaceTensionBoundary); 31 | setGroup(SURFACE_TENSION_BOUNDARY, "Fluid Model|Surface tension"); 32 | setDescription(SURFACE_TENSION_BOUNDARY, "Coefficient for the surface tension computation at the boundary"); 33 | rparam = static_cast(getParameter(SURFACE_TENSION_BOUNDARY)); 34 | rparam->setMinValue(0.0); 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /SPlisHSPlasH/SurfaceTension/SurfaceTensionBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __SurfaceTensionBaseBase_h__ 2 | #define __SurfaceTensionBaseBase_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "SPlisHSPlasH/NonPressureForceBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Base class for all surface tension methods. 11 | */ 12 | class SurfaceTensionBase : public NonPressureForceBase 13 | { 14 | protected: 15 | Real m_surfaceTension; 16 | Real m_surfaceTensionBoundary; 17 | 18 | virtual void initParameters(); 19 | 20 | public: 21 | static int SURFACE_TENSION; 22 | static int SURFACE_TENSION_BOUNDARY; 23 | 24 | SurfaceTensionBase(FluidModel *model); 25 | virtual ~SurfaceTensionBase(void); 26 | }; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /SPlisHSPlasH/SurfaceTension/SurfaceTension_Becker2007.h: -------------------------------------------------------------------------------- 1 | #ifndef __SurfaceTension_Becker2007_h__ 2 | #define __SurfaceTension_Becker2007_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "SurfaceTensionBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief This class implements the surface tension method introduced 11 | * by Becker and Teschner [BT07]. 12 | * 13 | * References: 14 | * - [BT07] Markus Becker and Matthias Teschner. Weakly compressible SPH for free surface flows. In ACM SIGGRAPH/Eurographics Symposium on Computer Animation, SCA '07, 209-217. Aire-la-Ville, Switzerland, Switzerland, 2007. Eurographics Association. URL: http://dl.acm.org/citation.cfm?id=1272690.1272719 15 | */ 16 | class SurfaceTension_Becker2007 : public SurfaceTensionBase 17 | { 18 | public: 19 | SurfaceTension_Becker2007(FluidModel *model); 20 | virtual ~SurfaceTension_Becker2007(void); 21 | 22 | static NonPressureForceBase* creator(FluidModel* model) { return new SurfaceTension_Becker2007(model); } 23 | 24 | virtual void step(); 25 | virtual void reset(); 26 | }; 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /SPlisHSPlasH/TimeManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __TimeManager_h__ 2 | #define __TimeManager_h__ 3 | 4 | #include "Common.h" 5 | #include "Utilities/BinaryFileReaderWriter.h" 6 | #include "ParameterObject.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Class to manage the current simulation time and the time step size. 11 | * This class is a singleton. 12 | */ 13 | class TimeManager : public GenParam::ParameterObject 14 | { 15 | private: 16 | Real time; 17 | static TimeManager *current; 18 | Real h; 19 | 20 | public: 21 | static int TIME_STEP_SIZE; 22 | 23 | TimeManager (); 24 | TimeManager(const TimeManager&) = delete; 25 | TimeManager& operator=(const TimeManager&) = delete; 26 | ~TimeManager (); 27 | 28 | virtual void initParameters(); 29 | 30 | // Singleton 31 | static TimeManager* getCurrent (); 32 | static void setCurrent (TimeManager* tm); 33 | static bool hasCurrent(); 34 | 35 | Real getTime(); 36 | void setTime(Real t); 37 | Real getTimeStepSize(); 38 | void setTimeStepSize(Real tss); 39 | 40 | void saveState(BinaryFileWriter &binWriter); 41 | void loadState(BinaryFileReader &binReader); 42 | }; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/DebugTools.h: -------------------------------------------------------------------------------- 1 | #ifndef __DebugTools_h__ 2 | #define __DebugTools_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "ParameterObject.h" 7 | 8 | namespace SPH 9 | { 10 | class DebugTools : public GenParam::ParameterObject 11 | { 12 | protected: 13 | bool m_determineThreadIds; 14 | std::vector> m_threadIds; 15 | bool m_determineNumNeighbors; 16 | std::vector> m_numNeighbors; 17 | bool m_determineVelocityChanges; 18 | std::vector> m_vOld; 19 | std::vector> m_velocityChanges; 20 | 21 | virtual void initParameters(); 22 | 23 | void determineThreadIds(); 24 | void determineNumNeighbors(); 25 | void determineVelocityChanges(); 26 | 27 | public: 28 | static int DETERMINE_THREAD_IDS; 29 | static int DETERMINE_NUM_NEIGHBORS; 30 | static int DETERMINE_VELOCITY_CHANGES; 31 | 32 | DebugTools(); 33 | ~DebugTools(); 34 | 35 | void init(); 36 | void cleanup(); 37 | 38 | void step(); 39 | void reset(); 40 | 41 | void performNeighborhoodSearchSort(); 42 | void emittedParticles(FluidModel* model, const unsigned int startIndex); 43 | }; 44 | } 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/GaussQuadrature.h: -------------------------------------------------------------------------------- 1 | #ifndef __GaussQuadrature_h__ 2 | #define __GaussQuadrature_h__ 3 | 4 | #include 5 | 6 | namespace SPH 7 | { 8 | class GaussQuadrature 9 | { 10 | public: 11 | 12 | using Integrand = std::function; 13 | using Domain = Eigen::AlignedBox3d; 14 | 15 | static double integrate(Integrand integrand, Domain const& domain, unsigned int p); 16 | static void exportSamples(unsigned int p); 17 | }; 18 | } 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/MathFunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef MATH_FUNCTIONS_H 2 | #define MATH_FUNCTIONS_H 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | 6 | // ------------------------------------------------------------------------------------ 7 | namespace SPH 8 | { 9 | class MathFunctions 10 | { 11 | public: 12 | /** Implementation of the paper: \n 13 | * Matthias Müller, Jan Bender, Nuttapong Chentanez and Miles Macklin, 14 | * "A Robust Method to Extract the Rotational Part of Deformations", 15 | * ACM SIGGRAPH Motion in Games, 2016 16 | */ 17 | static void extractRotation(const Matrix3r &A, Quaternionr &q, const unsigned int maxIter); 18 | 19 | static void pseudoInverse(const Matrix3r &a, Matrix3r &res); 20 | static void svdWithInversionHandling(const Matrix3r &A, Vector3r &sigma, Matrix3r &U, Matrix3r &VT); 21 | static void eigenDecomposition(const Matrix3r &A, Matrix3r &eigenVecs, Vector3r &eigenVals); 22 | static void jacobiRotate(Matrix3r &A, Matrix3r &R, int p, int q); 23 | 24 | /** Returns two orthogonal vectors to vec which are also orthogonal to each other. 25 | */ 26 | static void getOrthogonalVectors(const Vector3r &vec, Vector3r &x, Vector3r &y); 27 | 28 | /** computes the APD of 8 deformation gradients. (Alg. 3 from the paper: Kugelstadt et al. "Fast Corotated FEM using Operator Splitting", CGF 2018) 29 | */ 30 | static void APD_Newton(const Matrix3r& F, Quaternionr& q); 31 | }; 32 | } 33 | 34 | #endif -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/MeshImport.h: -------------------------------------------------------------------------------- 1 | #ifndef __MeshImport_h__ 2 | #define __MeshImport_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/TriangleMesh.h" 6 | 7 | namespace SPH 8 | { 9 | class MeshImport 10 | { 11 | protected: 12 | /** Load a mesh from an OBJ file in the TriangleMesh. */ 13 | static bool importMesh_OBJ(const std::string& filename, TriangleMesh& mesh, 14 | const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale); 15 | 16 | /** Load a mesh from an PLY file in the TriangleMesh. */ 17 | static bool importMesh_PLY(const std::string& filename, TriangleMesh& mesh, 18 | const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale); 19 | 20 | public: 21 | /** Load a mesh from a file in the TriangleMesh. */ 22 | static bool importMesh(const std::string& filename, TriangleMesh& mesh, 23 | const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale); 24 | }; 25 | } 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/RegularSampling2D.h: -------------------------------------------------------------------------------- 1 | #ifndef __RegularSampling2D_H__ 2 | #define __RegularSampling2D_H__ 3 | 4 | #include "../Common.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace SPH 10 | { 11 | /** \brief This class implements a per-triangle regular sampling for the surface 12 | * of 3D models. 13 | */ 14 | class RegularSampling2D 15 | { 16 | public: 17 | RegularSampling2D(); 18 | 19 | /** Performs the poisson sampling with the 20 | * respective parameters. Compare 21 | * http://graphics.cs.umass.edu/pubs/sa_2010.pdf 22 | * 23 | * @param rotation rotation of the mesh 24 | * @param translation translation of the mesh 25 | * @param numVertices number of mesh vertices 26 | * @param vertices vertex data of sampled data 27 | * @param numFaces number of faces in the mesh 28 | * @param faces face data of sampled mesh 29 | * @param maxDistance maximal distance of sampled vertices 30 | * @param samples vector to store the samples 31 | */ 32 | static void sampleMesh(const Matrix3r& rotation, const Vector3r & translation, const unsigned numVertices, const Vector3r *vertices, 33 | const unsigned int numFaces, const unsigned int *faces, const Real maxDistance, std::vector &samples); 34 | 35 | 36 | }; 37 | } 38 | 39 | #endif // __RegularSampling2D_H__ 40 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/SDFFunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef SDFFunctions_H 2 | #define SDFFunctions_H 3 | 4 | #include "../Common.h" 5 | #include "Discregrid/All" 6 | 7 | namespace Utilities 8 | { 9 | /** \brief Functions for generating and querying an SDF. 10 | */ 11 | class SDFFunctions 12 | { 13 | public: 14 | /** Generate SDF from mesh. 15 | */ 16 | static Discregrid::CubicLagrangeDiscreteGrid* generateSDF(const unsigned int numVertices, 17 | const Vector3r *vertices, const unsigned int numFaces, const unsigned int *faces, 18 | const AlignedBox3r &bbox, const std::array &resolution, const bool invert=false); 19 | 20 | /** Compute the bounding box of a mesh. 21 | */ 22 | static AlignedBox3r computeBoundingBox(const unsigned int numVertices, const Vector3r *vertices); 23 | 24 | /** Determine distance of a point x to the surface represented by the SDF and corresponding surface normal and 25 | * next point on the surface. 26 | */ 27 | static double distance(Discregrid::CubicLagrangeDiscreteGrid* sdf, const Vector3r &x, 28 | const Real thickness, Vector3r &normal, Vector3r &nextSurfacePoint); 29 | 30 | /** Determine distance of a point x to the surface represented by the SDF. 31 | */ 32 | static double distance(Discregrid::CubicLagrangeDiscreteGrid* sdf, 33 | const Vector3r &x, const Real thickness); 34 | 35 | }; 36 | } 37 | 38 | #endif // SDFFunctions_H 39 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/SimpleQuadrature.h: -------------------------------------------------------------------------------- 1 | #ifndef __SimpleQuadrature_h__ 2 | #define __SimpleQuadrature_h__ 3 | 4 | #include 5 | #include 6 | #include "SPlisHSPlasH/Common.h" 7 | 8 | namespace SPH 9 | { 10 | class SimpleQuadrature 11 | { 12 | public: 13 | using Integrand = std::function; 14 | using Domain = Eigen::AlignedBox3d; 15 | 16 | static std::vector m_samplePoints; 17 | static double m_volume; 18 | 19 | static void determineSamplePointsInSphere(const double radius, unsigned int p); 20 | static void determineSamplePointsInCircle(const double radius, unsigned int p); 21 | static double integrate(Integrand integrand); 22 | }; 23 | } 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/SurfaceSampling.h: -------------------------------------------------------------------------------- 1 | #ifndef SURFACESAMPLING_H 2 | #define SURFACESAMPLING_H 3 | 4 | #include "SPlisHSPlasH/Utilities/PoissonDiskSampling.h" 5 | #include "SPlisHSPlasH/Utilities/RegularTriangleSampling.h" 6 | #include "SPlisHSPlasH/Utilities/RegularSampling2D.h" 7 | 8 | namespace SPH 9 | { 10 | enum SurfaceSamplingMode { PoissonDisk, RegularTriangle, Regular2D }; 11 | } 12 | 13 | #endif // SURFACESAMPLING_H 14 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/VolumeSampling.h: -------------------------------------------------------------------------------- 1 | #ifndef VolumeSampling_H 2 | #define VolumeSampling_H 3 | 4 | #include "../Common.h" 5 | #include 6 | 7 | 8 | namespace Utilities 9 | { 10 | /** \brief This class implements a volume sampling of 3D models. 11 | */ 12 | class VolumeSampling 13 | { 14 | public: 15 | /** Performs the volume sampling with the 16 | * respective parameters. 17 | * 18 | * @param numVertices number of vertices 19 | * @param vertices vertex data 20 | * @param numFaces number of faces 21 | * @param faces index list of faces 22 | * @param radius radius of sampled particles 23 | * @param region defines a subregion of the mesh to be sampled (nullptr if not used) 24 | * @param resolution resolution of the used SDF 25 | * @param invert defines if the mesh should be inverted and the outside is sampled 26 | * @param sampleMode 0=regular, 1=almost dense, 2=dense 27 | * @param samples sampled vertices that will be returned 28 | */ 29 | static void sampleMesh(const unsigned int numVertices, const Vector3r *vertices, 30 | const unsigned int numFaces, const unsigned int *faces, 31 | const Real radius, const AlignedBox3r *region, 32 | const std::array &resolution, const bool invert, 33 | const unsigned int sampleMode, 34 | std::vector &samples); 35 | }; 36 | } 37 | 38 | #endif // VolumeSampling_H 39 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Utilities/WindingNumbers.h: -------------------------------------------------------------------------------- 1 | #include "SPlisHSPlasH/Common.h" 2 | #include "SPlisHSPlasH/TriangleMesh.h" 3 | 4 | namespace Utilities 5 | { 6 | class WindingNumbers 7 | { 8 | public: 9 | /** Determine the winding number for a point p and a triangle abc. 10 | */ 11 | static Real computeGeneralizedWindingNumber(const Vector3r& p, const Vector3r& a, const Vector3r& b, const Vector3r& c); 12 | 13 | /** Determine the winding number of a point p in a triangle mesh. 14 | */ 15 | static Real computeGeneralizedWindingNumber(const Vector3r& p, const SPH::TriangleMesh &mesh); 16 | }; 17 | } -------------------------------------------------------------------------------- /SPlisHSPlasH/Viscosity/ViscosityBase.cpp: -------------------------------------------------------------------------------- 1 | #include "ViscosityBase.h" 2 | 3 | using namespace SPH; 4 | using namespace GenParam; 5 | 6 | int ViscosityBase::VISCOSITY_COEFFICIENT = -1; 7 | 8 | 9 | ViscosityBase::ViscosityBase(FluidModel *model) : 10 | NonPressureForceBase(model) 11 | { 12 | m_viscosity = 0.01; 13 | } 14 | 15 | ViscosityBase::~ViscosityBase(void) 16 | { 17 | } 18 | 19 | 20 | void ViscosityBase::initParameters() 21 | { 22 | NonPressureForceBase::initParameters(); 23 | 24 | VISCOSITY_COEFFICIENT = createNumericParameter("viscosity", "Viscosity coefficient", &m_viscosity); 25 | setGroup(VISCOSITY_COEFFICIENT, "Fluid Model|Viscosity"); 26 | setDescription(VISCOSITY_COEFFICIENT, "Coefficient for the viscosity force computation"); 27 | RealParameter* rparam = static_cast(getParameter(VISCOSITY_COEFFICIENT)); 28 | rparam->setMinValue(0.0); 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Viscosity/ViscosityBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __ViscosityBaseBase_h__ 2 | #define __ViscosityBaseBase_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "SPlisHSPlasH/NonPressureForceBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Base class for all viscosity methods. 11 | */ 12 | class ViscosityBase : public NonPressureForceBase 13 | { 14 | protected: 15 | Real m_viscosity; 16 | 17 | virtual void initParameters(); 18 | 19 | public: 20 | static int VISCOSITY_COEFFICIENT; 21 | 22 | ViscosityBase(FluidModel *model); 23 | virtual ~ViscosityBase(void); 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Viscosity/Viscosity_Standard.h: -------------------------------------------------------------------------------- 1 | #ifndef __Viscosity_Standard_h__ 2 | #define __Viscosity_Standard_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "ViscosityBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief This class implements the standard method for viscosity descibed e.g. by 11 | * Ihmsen et al. [IOS+14].\n\n 12 | * The method evaluates the term \f$\nu \nabla^2 \mathbf{v}\f$ and uses an approximation 13 | * of the kernel Laplacian to improve the stability. This approximation is given in [IOS+14]. 14 | * 15 | * References: 16 | * - [IOS+14] Markus Ihmsen, Jens Orthmann, Barbara Solenthaler, Andreas Kolb, and Matthias Teschner. SPH Fluids in Computer Graphics. In Sylvain Lefebvre and Michela Spagnuolo, editors, Eurographics 2014 - State of the Art Reports. The Eurographics Association, 2014. URL: http://dx.doi.org/10.2312/egst.20141034 17 | */ 18 | class Viscosity_Standard : public ViscosityBase 19 | { 20 | protected: 21 | Real m_boundaryViscosity; 22 | 23 | virtual void initParameters(); 24 | 25 | public: 26 | static int VISCOSITY_COEFFICIENT_BOUNDARY; 27 | 28 | Viscosity_Standard(FluidModel *model); 29 | virtual ~Viscosity_Standard(void); 30 | 31 | virtual void step(); 32 | virtual void reset(); 33 | 34 | static NonPressureForceBase* creator(FluidModel* model) { return new Viscosity_Standard(model); } 35 | }; 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Vorticity/VorticityBase.cpp: -------------------------------------------------------------------------------- 1 | #include "VorticityBase.h" 2 | 3 | using namespace SPH; 4 | using namespace GenParam; 5 | 6 | int VorticityBase::VORTICITY_COEFFICIENT = -1; 7 | 8 | VorticityBase::VorticityBase(FluidModel *model) : 9 | NonPressureForceBase(model) 10 | { 11 | m_vorticityCoeff = static_cast(0.01); 12 | } 13 | 14 | VorticityBase::~VorticityBase(void) 15 | { 16 | } 17 | 18 | void VorticityBase::initParameters() 19 | { 20 | NonPressureForceBase::initParameters(); 21 | 22 | VORTICITY_COEFFICIENT = createNumericParameter("vorticity", "Vorticity transfer coefficient", &m_vorticityCoeff); 23 | setGroup(VORTICITY_COEFFICIENT, "Fluid Model|Vorticity"); 24 | setDescription(VORTICITY_COEFFICIENT, "Coefficient for the vorticity force computation"); 25 | RealParameter* rparam = static_cast(getParameter(VORTICITY_COEFFICIENT)); 26 | rparam->setMinValue(0.0); 27 | } 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Vorticity/VorticityBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __VorticityBaseBase_h__ 2 | #define __VorticityBaseBase_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "SPlisHSPlasH/NonPressureForceBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief Base class for all vorticity methods. 11 | */ 12 | class VorticityBase : public NonPressureForceBase 13 | { 14 | protected: 15 | Real m_vorticityCoeff; 16 | 17 | virtual void initParameters(); 18 | 19 | public: 20 | static int VORTICITY_COEFFICIENT; 21 | 22 | VorticityBase(FluidModel *model); 23 | virtual ~VorticityBase(void); 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /SPlisHSPlasH/Vorticity/VorticityConfinement.h: -------------------------------------------------------------------------------- 1 | #ifndef __VorticityConfinement_h__ 2 | #define __VorticityConfinement_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "VorticityBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief This class implements the vorticity confinement method introduced 11 | * by Macklin and Mueller [MM13]. 12 | * 13 | * References: 14 | * - [MM13] Miles Macklin and Matthias Müller. Position based fluids. ACM Trans. Graph., 32(4):104:1-104:12, July 2013. URL: http://doi.acm.org/10.1145/2461912.2461984 15 | */ 16 | class VorticityConfinement : public VorticityBase 17 | { 18 | protected: 19 | std::vector m_omega; 20 | std::vector m_normOmega; 21 | 22 | public: 23 | VorticityConfinement(FluidModel *model); 24 | virtual ~VorticityConfinement(void); 25 | 26 | static NonPressureForceBase* creator(FluidModel* model) { return new VorticityConfinement(model); } 27 | 28 | virtual void step(); 29 | virtual void reset(); 30 | 31 | virtual void performNeighborhoodSearchSort(); 32 | 33 | FORCE_INLINE const Vector3r& getAngularVelocity(const unsigned int i) const 34 | { 35 | return m_omega[i]; 36 | } 37 | 38 | FORCE_INLINE Vector3r& getAngularVelocity(const unsigned int i) 39 | { 40 | return m_omega[i]; 41 | } 42 | 43 | FORCE_INLINE void setAngularVelocity(const unsigned int i, const Vector3r& val) 44 | { 45 | m_omega[i] = val; 46 | } 47 | }; 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /SPlisHSPlasH/XSPH.h: -------------------------------------------------------------------------------- 1 | #ifndef __XSPH_h__ 2 | #define __XSPH_h__ 3 | 4 | #include "Common.h" 5 | #include "FluidModel.h" 6 | #include "NonPressureForceBase.h" 7 | 8 | namespace SPH 9 | { 10 | /** \brief This class implements the XSPH method descibed by 11 | * J. J. Monaghan [Mon92]. 12 | * 13 | * References: 14 | * - [Mon92] J. J. Monaghan. Smoothed Particle Hydrodynamics. Annual Review of Astronomy and Astrophysics, 1992, 30, 543-574. 15 | * URL: https://www.annualreviews.org/doi/10.1146/annurev.aa.30.090192.002551 16 | */ 17 | class XSPH : public NonPressureForceBase 18 | { 19 | protected: 20 | Real m_fluidCoefficient; 21 | Real m_boundaryCoefficient; 22 | 23 | virtual void initParameters(); 24 | 25 | public: 26 | static int FLUID_COEFFICIENT; 27 | static int BOUNDARY_COEFFICIENT; 28 | 29 | XSPH(FluidModel *model); 30 | virtual ~XSPH(void); 31 | 32 | virtual void step(); 33 | virtual void reset(); 34 | }; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Scripts/Maya/AESPHFluidNodeTemplate.mel: -------------------------------------------------------------------------------- 1 | global proc AESPHFluidNodeTemplate( string $nodeName ) 2 | { 3 | editorTemplate -beginScrollLayout; 4 | 5 | editorTemplate -beginLayout "Parameters" -collapse 0; 6 | editorTemplate -l "Fluid id" -addControl "id"; 7 | editorTemplate -l "Initial velocity" -addControl "initialVelocity"; 8 | editorTemplate -l "Initial angular velocity" -addControl "initialAngularVelocity"; 9 | editorTemplate -l "SDF resolution" -addControl "resolutionSDF"; 10 | editorTemplate -l "Invert SDF" -addControl "invert"; 11 | editorTemplate -l "Dense mode" -addControl "denseMode"; 12 | editorTemplate -l "Particle sampling file" -addControl "particleFile"; 13 | editorTemplate -endLayout; 14 | 15 | editorTemplate -addExtraControls; 16 | editorTemplate -endScrollLayout; 17 | } 18 | -------------------------------------------------------------------------------- /Scripts/Maya/AESPHRigidBodyNodeTemplate.mel: -------------------------------------------------------------------------------- 1 | global proc AESPHRigidBodyNodeTemplate( string $nodeName ) 2 | { 3 | editorTemplate -beginScrollLayout; 4 | 5 | editorTemplate -beginLayout "Parameters" -collapse 0; 6 | editorTemplate -l "Dynamic" -addControl "isDynamic"; 7 | editorTemplate -l "Wall" -addControl "isWall"; 8 | editorTemplate -l "Color" -addControl "color"; 9 | editorTemplate -l "Density" -addControl "density"; 10 | editorTemplate -l "Map resolution" -addControl "mapResolution"; 11 | editorTemplate -l "Invert map" -addControl "mapInvert"; 12 | editorTemplate -l "Map thickness" -addControl "mapThickness"; 13 | editorTemplate -l "SDF resolution" -addControl "resolutionSDF"; 14 | editorTemplate -l "Invert SDF" -addControl "invert"; 15 | editorTemplate -l "Sampling mode" -addControl "samplingMode"; 16 | editorTemplate -endLayout; 17 | 18 | editorTemplate -addExtraControls; 19 | editorTemplate -endScrollLayout; 20 | } 21 | -------------------------------------------------------------------------------- /Scripts/Paraview/README.md: -------------------------------------------------------------------------------- 1 | # Paraview Partio Plugin 2 | 3 | The plugin can be used to import [Partio](https://www.disneyanimation.com/technology/partio.html) particle data in Paraview. This plugin can be used to import and render the particle data generated with SPlisHSPlasH. 4 | 5 | ## Installation 6 | 7 | 1. This add-on requires the partio python module. To build this module first install pybind11 by 8 | 9 | pip install pybind11 10 | 11 | Then the module can be built by the calling 12 | 13 | python setup.py build_ext 14 | 15 | in the directory partio_extension. Note that you have to use the same Python version as your Paraview version uses (for Paraview 5.9.0 this is Python 3.8, for Paraview 5.10.0 this is Python 3.9). 16 | 17 | 3. Copy the file paraview-partio-plugin.py and the generated file partio.* (name depends on system) to the Paraview site-packages folder (in Windows: bin\Lib\site-packages). 18 | 19 | 4. Start Paraview and load plugin (Tools/Manage Plugins.../Load New...) paraview-partio-plugin.py 20 | 21 | 4. Optinally activate Auto Load. 22 | 23 | ## Usage 24 | 25 | After loading the plugin you can directly open partio files. 26 | -------------------------------------------------------------------------------- /Scripts/Paraview/partio_extension/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=42", 4 | "wheel", 5 | "pybind11>=2.6.0", 6 | ] 7 | 8 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /Scripts/Paraview/partio_extension/setup.cfg: -------------------------------------------------------------------------------- 1 | [build_ext] 2 | inplace=1 -------------------------------------------------------------------------------- /Simulator/BoundarySimulator.cpp: -------------------------------------------------------------------------------- 1 | #include "BoundarySimulator.h" 2 | #include "SPlisHSPlasH/TimeManager.h" 3 | #include "SPlisHSPlasH/Simulation.h" 4 | #include "SPlisHSPlasH/BoundaryModel.h" 5 | 6 | using namespace SPH; 7 | 8 | void BoundarySimulator::updateBoundaryForces() 9 | { 10 | Real h = TimeManager::getCurrent()->getTimeStepSize(); 11 | Simulation *sim = Simulation::getCurrent(); 12 | const unsigned int nObjects = sim->numberOfBoundaryModels(); 13 | for (unsigned int i = 0; i < nObjects; i++) 14 | { 15 | BoundaryModel *bm = sim->getBoundaryModel(i); 16 | RigidBodyObject *rbo = bm->getRigidBodyObject(); 17 | if (rbo->isDynamic()) 18 | { 19 | Vector3r force, torque; 20 | bm->getForceAndTorque(force, torque); 21 | rbo->addForce(force); 22 | rbo->addTorque(torque); 23 | bm->clearForceAndTorque(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Simulator/BoundarySimulator.h: -------------------------------------------------------------------------------- 1 | #ifndef __BoundarySimulator_h__ 2 | #define __BoundarySimulator_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | 6 | namespace SPH 7 | { 8 | class BoundarySimulator 9 | { 10 | public: 11 | BoundarySimulator() {} 12 | virtual ~BoundarySimulator() {} 13 | virtual void init() {} 14 | /** This function is called after the simulation scene is loaded and all 15 | * parameters are initialized. While reading a scene file several parameters 16 | * can change. The deferred init function should initialize all values which 17 | * depend on these parameters. 18 | */ 19 | virtual void deferredInit() {} 20 | virtual void timeStep() {} 21 | virtual void initBoundaryData() {} 22 | virtual void reset() {} 23 | 24 | void updateBoundaryForces(); 25 | }; 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /Simulator/Exporter/ExporterBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __ExporterBaseBase_h__ 2 | #define __ExporterBaseBase_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "Simulator/SimulatorBase.h" 6 | 7 | namespace SPH 8 | { 9 | /** \brief Base class for data exporters. 10 | */ 11 | class ExporterBase 12 | { 13 | protected: 14 | SimulatorBase* m_base; 15 | bool m_active; 16 | 17 | public: 18 | ExporterBase(SimulatorBase* base) : m_active(false) { m_base = base; }; 19 | ExporterBase(const ExporterBase&) = delete; 20 | ExporterBase& operator=(const ExporterBase&) = delete; 21 | virtual ~ExporterBase(void) {}; 22 | 23 | virtual void step(const unsigned int frame) = 0; 24 | virtual void reset() {}; 25 | 26 | virtual void init(const std::string &outputPath) {}; 27 | 28 | virtual void setActive(const bool active) { m_active = active; } 29 | virtual bool getActive() const { return m_active; } 30 | }; 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Simulator/Exporter/ParticleExporter_Partio.h: -------------------------------------------------------------------------------- 1 | #ifndef __ParticleExporter_Partio_h__ 2 | #define __ParticleExporter_Partio_h__ 3 | 4 | #include "ExporterBase.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include "extern/partio/src/lib/Partio.h" 7 | #include 8 | 9 | namespace SPH 10 | { 11 | /** \brief Particle exporter for the partio format. 12 | */ 13 | class ParticleExporter_Partio : public ExporterBase 14 | { 15 | protected: 16 | std::string m_exportPath; 17 | std::string m_particleFile; 18 | Partio::ParticlesDataMutable* m_particleData; 19 | std::future m_handle; 20 | 21 | void writeParticlesPartio(const std::string& fileName, FluidModel* model, const unsigned int objId=0xffffffff); 22 | 23 | public: 24 | ParticleExporter_Partio(SimulatorBase *base); 25 | ParticleExporter_Partio(const ParticleExporter_Partio&) = delete; 26 | ParticleExporter_Partio& operator=(const ParticleExporter_Partio&) = delete; 27 | virtual ~ParticleExporter_Partio(void); 28 | 29 | virtual void init(const std::string& outputPath); 30 | virtual void step(const unsigned int frame); 31 | virtual void reset(); 32 | virtual void setActive(const bool active); 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Simulator/Exporter/ParticleExporter_VTK.h: -------------------------------------------------------------------------------- 1 | #ifndef __ParticleExporter_VTK_h__ 2 | #define __ParticleExporter_VTK_h__ 3 | 4 | #include "ExporterBase.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | #include 7 | 8 | namespace SPH 9 | { 10 | /** \brief Particle exporter for the VTK format. 11 | */ 12 | class ParticleExporter_VTK : public ExporterBase 13 | { 14 | protected: 15 | std::string m_exportPath; 16 | std::ofstream *m_outfile; 17 | std::vector m_attributes; 18 | 19 | void createParticleFile(const std::string& fileName, FluidModel* model); 20 | void writeParticles(const std::string& fileName, FluidModel* model, const unsigned int objId = 0xffffffff); 21 | 22 | // VTK expects big endian 23 | template 24 | inline void swapByteOrder(T* v) 25 | { 26 | constexpr size_t n = sizeof(T); 27 | uint8_t* bytes = reinterpret_cast(v); 28 | for (unsigned int c = 0u; c < n / 2; c++) 29 | std::swap(bytes[c], bytes[n - c - 1]); 30 | } 31 | 32 | public: 33 | ParticleExporter_VTK(SimulatorBase *base); 34 | ParticleExporter_VTK(const ParticleExporter_VTK&) = delete; 35 | ParticleExporter_VTK& operator=(const ParticleExporter_VTK&) = delete; 36 | virtual ~ParticleExporter_VTK(void); 37 | 38 | virtual void init(const std::string& outputPath); 39 | virtual void step(const unsigned int frame); 40 | virtual void reset(); 41 | virtual void setActive(const bool active); 42 | }; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Simulator/Exporter/RigidBodyExporter_BIN.h: -------------------------------------------------------------------------------- 1 | #ifndef __RigidBodyExporter_BIN_h__ 2 | #define __RigidBodyExporter_BIN_h__ 3 | 4 | #include "ExporterBase.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | 7 | namespace SPH 8 | { 9 | /** \brief Rigid body exporter for the bin format (own file format). 10 | */ 11 | class RigidBodyExporter_BIN : public ExporterBase 12 | { 13 | protected: 14 | bool m_isFirstFrame; 15 | std::string m_exportPath; 16 | 17 | void writeRigidBodies(const std::string& fileName); 18 | 19 | public: 20 | RigidBodyExporter_BIN(SimulatorBase* base); 21 | RigidBodyExporter_BIN(const RigidBodyExporter_BIN&) = delete; 22 | RigidBodyExporter_BIN& operator=(const RigidBodyExporter_BIN&) = delete; 23 | virtual ~RigidBodyExporter_BIN(void); 24 | 25 | virtual void init(const std::string& outputPath); 26 | virtual void step(const unsigned int frame); 27 | virtual void reset(); 28 | virtual void setActive(const bool active); 29 | }; 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Simulator/Exporter/RigidBodyExporter_OBJ.h: -------------------------------------------------------------------------------- 1 | #ifndef __RigidBodyExporter_OBJ_h__ 2 | #define __RigidBodyExporter_OBJ_h__ 3 | 4 | #include "ExporterBase.h" 5 | 6 | namespace SPH 7 | { 8 | /** \brief Rigid body exporter for the OBJ format. 9 | */ 10 | class RigidBodyExporter_OBJ : public ExporterBase 11 | { 12 | protected: 13 | bool m_isFirstFrame; 14 | std::string m_exportPath; 15 | 16 | void writeRigidBodies(const unsigned int frame); 17 | 18 | public: 19 | RigidBodyExporter_OBJ(SimulatorBase* base); 20 | RigidBodyExporter_OBJ(const RigidBodyExporter_OBJ&) = delete; 21 | RigidBodyExporter_OBJ& operator=(const RigidBodyExporter_OBJ&) = delete; 22 | virtual ~RigidBodyExporter_OBJ(void); 23 | 24 | virtual void init(const std::string& outputPath); 25 | virtual void step(const unsigned int frame); 26 | virtual void reset(); 27 | virtual void setActive(const bool active); 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Simulator/Exporter/RigidBodyExporter_PLY.h: -------------------------------------------------------------------------------- 1 | #ifndef __RigidBodyExporter_PLY_h__ 2 | #define __RigidBodyExporter_PLY_h__ 3 | 4 | #include "ExporterBase.h" 5 | 6 | namespace SPH 7 | { 8 | /** \brief Rigid body exporter for the OBJ format. 9 | */ 10 | class RigidBodyExporter_PLY : public ExporterBase 11 | { 12 | protected: 13 | bool m_isFirstFrame; 14 | std::string m_exportPath; 15 | 16 | void writeRigidBodies(const unsigned int frame); 17 | 18 | public: 19 | RigidBodyExporter_PLY(SimulatorBase* base); 20 | RigidBodyExporter_PLY(const RigidBodyExporter_PLY&) = delete; 21 | RigidBodyExporter_PLY& operator=(const RigidBodyExporter_PLY&) = delete; 22 | virtual ~RigidBodyExporter_PLY(void); 23 | 24 | virtual void init(const std::string& outputPath); 25 | virtual void step(const unsigned int frame); 26 | virtual void reset(); 27 | virtual void setActive(const bool active); 28 | }; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Simulator/Exporter/RigidBodyExporter_VTK.h: -------------------------------------------------------------------------------- 1 | #ifndef __RigidBodyExporter_VTK_h__ 2 | #define __RigidBodyExporter_VTK_h__ 3 | 4 | #include "ExporterBase.h" 5 | #include "SPlisHSPlasH/FluidModel.h" 6 | 7 | namespace SPH 8 | { 9 | /** \brief Rigid body exporter for the VTK format. 10 | */ 11 | class RigidBodyExporter_VTK : public ExporterBase 12 | { 13 | protected: 14 | bool m_isFirstFrame; 15 | std::string m_exportPath; 16 | 17 | void writeRigidBodies(const unsigned int frame); 18 | 19 | // VTK expects big endian 20 | template 21 | inline void swapByteOrder(T* v) 22 | { 23 | constexpr size_t n = sizeof(T); 24 | uint8_t* bytes = reinterpret_cast(v); 25 | for (unsigned int c = 0u; c < n / 2; c++) 26 | std::swap(bytes[c], bytes[n - c - 1]); 27 | } 28 | 29 | public: 30 | RigidBodyExporter_VTK(SimulatorBase* base); 31 | RigidBodyExporter_VTK(const RigidBodyExporter_VTK&) = delete; 32 | RigidBodyExporter_VTK& operator=(const RigidBodyExporter_VTK&) = delete; 33 | virtual ~RigidBodyExporter_VTK(void); 34 | 35 | virtual void init(const std::string& outputPath); 36 | virtual void step(const unsigned int frame); 37 | virtual void reset(); 38 | virtual void setActive(const bool active); 39 | }; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Simulator/ExporterRegistration.cpp: -------------------------------------------------------------------------------- 1 | #include "SimulatorBase.h" 2 | #include "Exporter/ExporterBase.h" 3 | #include "Exporter/ParticleExporter_Partio.h" 4 | #include "Exporter/ParticleExporter_VTK.h" 5 | #include "Exporter/RigidBodyExporter_BIN.h" 6 | #include "Exporter/RigidBodyExporter_OBJ.h" 7 | #include "Exporter/RigidBodyExporter_PLY.h" 8 | #include "Exporter/RigidBodyExporter_VTK.h" 9 | 10 | using namespace SPH; 11 | 12 | void SimulatorBase::createExporters() 13 | { 14 | addParticleExporter("enablePartioExport", "Partio Exporter", "Enable/disable partio export.", new ParticleExporter_Partio(this)); 15 | addParticleExporter("enableVTKExport", "VTK Exporter", "Enable/disable VTK export.", new ParticleExporter_VTK(this)); 16 | 17 | addRigidBodyExporter("enableRigidBodyExport", "Rigid Body Exporter", "Enable/disable rigid body BIN export.", new RigidBodyExporter_BIN(this)); 18 | addRigidBodyExporter("enableRigidBodyOBJExport", "Rigid Body OBJ Exporter", "Enable/disable rigid body OBJ export.", new RigidBodyExporter_OBJ(this)); 19 | addRigidBodyExporter("enableRigidBodyPLYExport", "Rigid Body PLY Exporter", "Enable/disable rigid body PLY export.", new RigidBodyExporter_PLY(this)); 20 | addRigidBodyExporter("enableRigidBodyVTKExport", "Rigid Body VTK Exporter", "Enable/disable rigid body VTK export.", new RigidBodyExporter_VTK(this)); 21 | } -------------------------------------------------------------------------------- /Simulator/GUI/Simulator_GUI_Base.h: -------------------------------------------------------------------------------- 1 | #ifndef __Simulator_GUI_Base_h__ 2 | #define __Simulator_GUI_Base_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "ParameterObject.h" 6 | #include "Simulator/SimulatorBase.h" 7 | 8 | namespace SPH 9 | { 10 | class Simulator_GUI_Base 11 | { 12 | protected: 13 | SimulatorBase *m_simulatorBase; 14 | 15 | public: 16 | Simulator_GUI_Base(SimulatorBase *simulatorBase) : m_simulatorBase(simulatorBase) {}; 17 | virtual ~Simulator_GUI_Base() {}; 18 | 19 | public: 20 | virtual void init(const char *name) {} 21 | virtual void initSimulationParameterGUI() {} 22 | virtual void initParameterGUI() {} 23 | virtual void render() {} 24 | virtual void reset() {} 25 | virtual void update() {} 26 | virtual void cleanup() {} 27 | virtual void run() {} 28 | virtual void stop() {} 29 | virtual void addKeyFunc(int key, int modifiers, std::function const& func) {} 30 | 31 | SPH::SimulatorBase * getSimulatorBase() const { return m_simulatorBase; } 32 | }; 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /Simulator/GUI/imgui/LogWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef __LogWindow_h__ 2 | #define __LogWindow_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "Utilities/Logger.h" 6 | #include 7 | #include "imgui.h" 8 | 9 | struct ImFont; 10 | 11 | namespace SPH 12 | { 13 | class LogWindow 14 | { 15 | protected: 16 | std::shared_ptr m_bufferSink; 17 | bool m_scrollToBottom; 18 | size_t m_lastSize; 19 | int m_selectedFilter; 20 | 21 | public: 22 | LogWindow(); 23 | ~LogWindow(); 24 | 25 | void drawWindow(ImFont *textFont); 26 | int getSelectedFilter() const { return m_selectedFilter; } 27 | void setSelectedFilter(const int i) { m_selectedFilter = i; } 28 | }; 29 | } 30 | 31 | #endif -------------------------------------------------------------------------------- /Simulator/PositionBasedDynamicsWrapper/PBDBoundarySimulator.h: -------------------------------------------------------------------------------- 1 | #ifndef __PBDBoundarySimulator_h__ 2 | #define __PBDBoundarySimulator_h__ 3 | 4 | #include "Simulator/BoundarySimulator.h" 5 | #include "PBDWrapper.h" 6 | #include "Simulator/SimulatorBase.h" 7 | 8 | namespace SPH 9 | { 10 | class PBDBoundarySimulator : public BoundarySimulator 11 | { 12 | protected: 13 | PBDWrapper *m_pbdWrapper; 14 | SimulatorBase *m_base; 15 | 16 | public: 17 | PBDBoundarySimulator(SimulatorBase *base); 18 | virtual ~PBDBoundarySimulator(); 19 | 20 | virtual void init(); 21 | /** This function is called after the simulation scene is loaded and all 22 | * parameters are initialized. While reading a scene file several parameters 23 | * can change. The deferred init function should initialize all values which 24 | * depend on these parameters. 25 | */ 26 | virtual void deferredInit(); 27 | virtual void timeStep(); 28 | virtual void initBoundaryData(); 29 | virtual void reset(); 30 | 31 | PBDWrapper *getPBDWrapper() { return m_pbdWrapper; } 32 | }; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Simulator/SceneConfiguration.h: -------------------------------------------------------------------------------- 1 | #ifndef __SceneConfiguration_h__ 2 | #define __SceneConfiguration_h__ 3 | 4 | #include "SPlisHSPlasH/Utilities/SceneLoader.h" 5 | 6 | namespace SPH 7 | { 8 | /** \brief Class to store the scene configuration that is imported from the scene file. 9 | */ 10 | class SceneConfiguration 11 | { 12 | private: 13 | static SceneConfiguration *m_current; 14 | 15 | protected: 16 | Utilities::SceneLoader::Scene m_scene; 17 | std::string m_sceneFile; 18 | 19 | public: 20 | SceneConfiguration(); 21 | SceneConfiguration(const SceneConfiguration&) = delete; 22 | SceneConfiguration& operator=(const SceneConfiguration&) = delete; 23 | ~SceneConfiguration(); 24 | 25 | // Singleton 26 | static SceneConfiguration* getCurrent (); 27 | static void setCurrent (SceneConfiguration* sc); 28 | static bool hasCurrent(); 29 | 30 | void setSceneFile(const std::string& file) { m_sceneFile = file; } 31 | const std::string& getSceneFile() const { return m_sceneFile; } 32 | 33 | Utilities::SceneLoader::Scene& getScene() { return m_scene; } 34 | 35 | }; 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Simulator/ScriptObject.h: -------------------------------------------------------------------------------- 1 | #ifndef __ScriptObject_h__ 2 | #define __ScriptObject_h__ 3 | 4 | #include 5 | #include 6 | 7 | namespace SPH 8 | { 9 | class SimulatorBase; 10 | 11 | class ScriptObject : public GenParam::ParameterObject 12 | { 13 | protected: 14 | SimulatorBase* m_base; 15 | bool m_scriptLoaded; 16 | std::string m_scriptModule; 17 | std::string m_scriptFile; 18 | 19 | virtual void initParameters(); 20 | void addFunctionParameters(); 21 | void removeFunctionParameters(); 22 | 23 | public: 24 | static int SCRIPT_FILE; 25 | 26 | ScriptObject(SimulatorBase *base); 27 | virtual ~ScriptObject(void); 28 | 29 | void init(); 30 | std::string loadScriptFile(const std::string& fileName); 31 | 32 | void execResetFct(); 33 | void execStepFct(); 34 | 35 | void updateFunctionParameters(); 36 | 37 | }; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Simulator/StaticBoundarySimulator.h: -------------------------------------------------------------------------------- 1 | #ifndef __StaticBoundarySimulator_h__ 2 | #define __StaticBoundarySimulator_h__ 3 | 4 | #include "BoundarySimulator.h" 5 | 6 | namespace SPH 7 | { 8 | class SimulatorBase; 9 | class TriangleMesh; 10 | 11 | class StaticBoundarySimulator : public BoundarySimulator 12 | { 13 | protected: 14 | SimulatorBase *m_base; 15 | 16 | public: 17 | StaticBoundarySimulator(SimulatorBase *base); 18 | virtual ~StaticBoundarySimulator(); 19 | 20 | virtual void initBoundaryData(); 21 | /** This function is called after the simulation scene is loaded and all 22 | * parameters are initialized. While reading a scene file several parameters 23 | * can change. The deferred init function should initialize all values which 24 | * depend on these parameters. 25 | */ 26 | virtual void deferredInit(); 27 | 28 | virtual void timeStep(); 29 | virtual void reset(); 30 | }; 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Simulator/main.cpp: -------------------------------------------------------------------------------- 1 | #include "SPlisHSPlasH/Common.h" 2 | #include "Simulator/SimulatorBase.h" 3 | #include "Simulator/GUI/OpenGL/Simulator_OpenGL.h" 4 | #include "PositionBasedDynamicsWrapper/PBDBoundarySimulator.h" 5 | #include "Simulator/GUI/imgui/Simulator_GUI_imgui.h" 6 | #include "PositionBasedDynamicsWrapper/PBD_Simulator_GUI_imgui.h" 7 | 8 | // Enable memory leak detection 9 | #ifdef _DEBUG 10 | #ifndef EIGEN_ALIGN 11 | #define new DEBUG_NEW 12 | #endif 13 | #endif 14 | 15 | using namespace SPH; 16 | using namespace std; 17 | 18 | SimulatorBase *base = nullptr; 19 | Simulator_GUI_Base *gui = nullptr; 20 | 21 | // main 22 | int main( int argc, char **argv ) 23 | { 24 | REPORT_MEMORY_LEAKS; 25 | base = new SimulatorBase(); 26 | base->init(argc, argv, "SPlisHSPlasH"); 27 | 28 | if (base->getUseGUI()) 29 | { 30 | if (base->isStaticScene()) 31 | gui = new Simulator_GUI_imgui(base); 32 | else 33 | gui = new PBD_Simulator_GUI_imgui(base, ((PBDBoundarySimulator*)base->getBoundarySimulator())->getPBDWrapper()); 34 | base->setGui(gui); 35 | } 36 | base->run(); 37 | 38 | delete base; 39 | delete gui; 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /Tests/AVX/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(AVXTests 2 | AVXTests.cpp 3 | ) 4 | add_dependencies(AVXTests SPlisHSPlasH) 5 | target_include_directories(AVXTests PRIVATE ${PROJECT_SOURCE_DIR}/extern/Catch2) 6 | target_link_libraries(AVXTests PRIVATE SPlisHSPlasH) 7 | 8 | set_target_properties(AVXTests PROPERTIES FOLDER "Tests") 9 | set_target_properties(AVXTests PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 10 | set_target_properties(AVXTests PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 11 | set_target_properties(AVXTests PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 12 | -------------------------------------------------------------------------------- /Tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Kernel) 2 | add_subdirectory(ReadWriteState) 3 | if (FOUND_AVX2) 4 | add_subdirectory(AVX) 5 | endif() 6 | -------------------------------------------------------------------------------- /Tests/Kernel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(KernelTests 2 | KernelTests.cpp 3 | ) 4 | add_dependencies(KernelTests SPlisHSPlasH) 5 | target_include_directories(KernelTests PRIVATE ${PROJECT_SOURCE_DIR}/extern/Catch2) 6 | target_link_libraries(KernelTests PRIVATE SPlisHSPlasH) 7 | 8 | set_target_properties(KernelTests PROPERTIES FOLDER "Tests") 9 | set_target_properties(KernelTests PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 10 | set_target_properties(KernelTests PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 11 | set_target_properties(KernelTests PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 12 | -------------------------------------------------------------------------------- /Tests/ReadWriteState/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(ReadWriteStateTests 2 | ReadWriteStateTests.cpp 3 | ) 4 | add_dependencies(ReadWriteStateTests SimulatorBase) 5 | target_include_directories(ReadWriteStateTests PRIVATE ${PROJECT_SOURCE_DIR}/extern/Catch2) 6 | target_link_libraries(ReadWriteStateTests SimulatorBase) 7 | 8 | set_target_properties(ReadWriteStateTests PROPERTIES FOLDER "Tests") 9 | set_target_properties(ReadWriteStateTests PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 10 | set_target_properties(ReadWriteStateTests PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 11 | set_target_properties(ReadWriteStateTests PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 12 | -------------------------------------------------------------------------------- /Tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | macro(add_tool arg) 2 | option(Build_${arg} "Build ${arg}" ON) 3 | if (Build_${arg}) 4 | add_subdirectory(${arg}) 5 | endif() 6 | endmacro() 7 | 8 | add_tool(PartioViewer) 9 | add_tool(FoamGenerator) 10 | add_tool(SurfaceSampling) 11 | add_tool(VolumeSampling) 12 | add_tool(partio2vtk) 13 | add_tool(MeshSkinning) 14 | add_tool(ParameterParser) 15 | 16 | -------------------------------------------------------------------------------- /Tools/FoamGenerator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(FoamGenerator 2 | main.cpp 3 | 4 | FoamKernel.cpp 5 | FoamKernel.h 6 | ) 7 | 8 | add_dependencies(FoamGenerator SPlisHSPlasH) 9 | target_link_libraries(FoamGenerator PRIVATE SPlisHSPlasH) 10 | 11 | set_target_properties(FoamGenerator PROPERTIES FOLDER "Tools") 12 | set_target_properties(FoamGenerator PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 13 | set_target_properties(FoamGenerator PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 14 | set_target_properties(FoamGenerator PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 15 | 16 | -------------------------------------------------------------------------------- /Tools/FoamGenerator/FoamKernel.cpp: -------------------------------------------------------------------------------- 1 | #include "FoamKernel.h" 2 | 3 | using namespace SPH; 4 | 5 | Real FoamKernel::m_radius; 6 | Real FoamKernel::m_W_zero; 7 | Real FoamKernel::m_norm_fac; -------------------------------------------------------------------------------- /Tools/FoamGenerator/FoamKernel.h: -------------------------------------------------------------------------------- 1 | #ifndef FOAMKERNEL_H 2 | #define FOAMKERNEL_H 3 | 4 | #define _USE_MATH_DEFINES 5 | #include 6 | #include "SPlisHSPlasH/Common.h" 7 | 8 | namespace SPH 9 | { 10 | class FoamKernel 11 | { 12 | protected: 13 | static Real m_radius; 14 | static Real m_W_zero; 15 | static Real m_norm_fac; 16 | public: 17 | static Real getRadius() { return m_radius; } 18 | static void setRadius(Real val) 19 | { 20 | m_radius = val; 21 | //// The normalization factor is 1 divided by the integral over the kernel function. 22 | //// WolframAlpha code for 3D integral over kernel in spherical coordinates: int_0^(2pi) int_0^pi int_0^h ((1-r/h) r^2 sin(theta)) dr dtheta dphi 23 | //// r^2 sin(theta) is the Jacobian determinant, necessary for the transformation of the volume integral from Cartesian into spherical coordinates. 24 | //m_norm_fac = 1.0 / ((1.0 / 3.0) * M_PI * val * val * val); 25 | //m_W_zero = m_norm_fac; 26 | m_W_zero = 1.0; 27 | } 28 | 29 | public: 30 | static Real W(const Real r) 31 | { 32 | Real res = 0.0; 33 | const Real q = r / m_radius; 34 | if (q <= 1.0) 35 | //res = m_norm_fac * (1.0 - q); 36 | res = (static_cast(1.0) - q); 37 | return res; 38 | } 39 | 40 | static Real W(const Vector3r& r) 41 | { 42 | return W(r.norm()); 43 | } 44 | 45 | static Real W_zero() 46 | { 47 | return m_W_zero; 48 | } 49 | }; 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Tools/MeshSkinning/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(MeshSkinning 2 | main.cpp 3 | ) 4 | add_dependencies(MeshSkinning SPlisHSPlasH) 5 | target_link_libraries(MeshSkinning PRIVATE SPlisHSPlasH) 6 | 7 | set_target_properties(MeshSkinning PROPERTIES FOLDER "Tools") 8 | set_target_properties(MeshSkinning PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 9 | set_target_properties(MeshSkinning PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 10 | set_target_properties(MeshSkinning PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 11 | -------------------------------------------------------------------------------- /Tools/ParameterParser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(ParameterParser 2 | main.cpp 3 | 4 | JsonSchemaGenerator.cpp 5 | JsonSchemaGenerator.h 6 | ParameterObjectParser.cpp 7 | ParameterObjectParser.h 8 | SceneExampleGenerator.cpp 9 | SceneExampleGenerator.h 10 | ) 11 | add_dependencies(ParameterParser SimulatorBase) 12 | target_link_libraries(ParameterParser PRIVATE SimulatorBase) 13 | 14 | set_target_properties(ParameterParser PROPERTIES FOLDER "Tools") 15 | set_target_properties(ParameterParser PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 16 | set_target_properties(ParameterParser PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 17 | set_target_properties(ParameterParser PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 18 | -------------------------------------------------------------------------------- /Tools/ParameterParser/SceneExampleGenerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SPlisHSPlasH/Common.h" 4 | #include "ParameterObject.h" 5 | #include "extern/json/json.hpp" 6 | 7 | namespace SPH 8 | { 9 | class SceneExampleGenerator 10 | { 11 | protected: 12 | nlohmann::json m_jsonData; 13 | nlohmann::json* m_currentData; 14 | 15 | void jsonEnumParam(GenParam::EnumParameter* param); 16 | void jsonStringParam(GenParam::StringParameter* param); 17 | void jsonVecParam(GenParam::RealVectorParameter* param); 18 | void jsonVecUintParam(GenParam::VectorParameter* param); 19 | 20 | template 21 | void jsonParam(T* param) 22 | { 23 | std::string str1 = param->getName() + " - comment"; 24 | std::string str2 = param->getDescription() + "(Default: " + std::to_string(param->getValue()) + ", Type: " + typeid(param->getValue()).name() + ")"; 25 | (*m_currentData)[str1] = str2; 26 | (*m_currentData)[param->getName()] = param->getValue(); 27 | } 28 | 29 | void jsonParameterObject(const GenParam::ParameterObject* obj); 30 | 31 | public: 32 | void generateExampleSceneFile(const std::string& fileName); 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /Tools/PartioViewer/GUI/PartioViewer_GUI_Base.h: -------------------------------------------------------------------------------- 1 | #ifndef __PartioViewer_GUI_Base_h__ 2 | #define __PartioViewer_GUI_Base_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "ParameterObject.h" 6 | #include "Simulator/SimulatorBase.h" 7 | #include "extern/cxxopts/cxxopts.hpp" 8 | 9 | namespace SPH 10 | { 11 | class PartioViewer_GUI_Base 12 | { 13 | protected: 14 | SimulatorBase *m_simulatorBase; 15 | 16 | public: 17 | PartioViewer_GUI_Base() {}; 18 | virtual ~PartioViewer_GUI_Base() {}; 19 | 20 | public: 21 | virtual void init() {} 22 | virtual void initSimulationParameterGUI() {} 23 | virtual void initParameterGUI() {} 24 | virtual void render() {} 25 | virtual void run() {} 26 | virtual void stop() {} 27 | virtual void update() {} 28 | virtual void cleanup() {} 29 | virtual void addOptions(cxxopts::Options &options) {} 30 | virtual void parseOptions(cxxopts::ParseResult &result) {} 31 | virtual unsigned int getWidth() const { return 0; } 32 | virtual unsigned int getHeight() const { return 0; } 33 | 34 | SPH::SimulatorBase * getSimulatorBase() const { return m_simulatorBase; } 35 | void setSimulatorBase(SPH::SimulatorBase * val) { m_simulatorBase = val; } 36 | }; 37 | } 38 | 39 | #endif -------------------------------------------------------------------------------- /Tools/PartioViewer/GUI/imgui/PartioViewer_GUI_imgui.h: -------------------------------------------------------------------------------- 1 | #ifndef __PartioViewer_GUI_imgui_h__ 2 | #define __PartioViewer_GUI_imgui_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include "../PartioViewer_GUI_Base.h" 6 | #include 7 | 8 | namespace SPH 9 | { 10 | class PartioViewer; 11 | 12 | class PartioViewer_GUI_imgui : public PartioViewer_GUI_Base 13 | { 14 | public: 15 | PartioViewer_GUI_imgui(PartioViewer *viewer); 16 | virtual ~PartioViewer_GUI_imgui(); 17 | 18 | protected: 19 | PartioViewer *m_viewer; 20 | unsigned int m_currentFluidModel; 21 | bool m_renderWalls; 22 | bool m_showBBox; 23 | Vector3r m_camPos; 24 | Vector3r m_camLookat; 25 | std::map m_mapColorField2Attr; 26 | 27 | void initImgui(); 28 | void initImguiParameters(); 29 | void renderScene(); 30 | void determineMinMaxValues(); 31 | 32 | static void selection(const Vector2i &start, const Vector2i &end, void *clientData); 33 | 34 | void destroy(); 35 | void createSimulationParameterGUI(); 36 | 37 | public: 38 | virtual void init(); 39 | virtual void initParameterGUI(); 40 | virtual void addOptions(cxxopts::Options &options); 41 | virtual void parseOptions(cxxopts::ParseResult &result); 42 | virtual void render(); 43 | virtual void update(); 44 | virtual void cleanup(); 45 | virtual void run(); 46 | virtual void stop(); 47 | virtual unsigned int getWidth() const; 48 | virtual unsigned int getHeight() const; 49 | }; 50 | } 51 | 52 | #endif -------------------------------------------------------------------------------- /Tools/PartioViewer/main.cpp: -------------------------------------------------------------------------------- 1 | #include "SPlisHSPlasH/Common.h" 2 | #include 3 | #include "Utilities/Timing.h" 4 | #include "Utilities/Counting.h" 5 | #include "PartioViewer.h" 6 | 7 | 8 | // Enable memory leak detection 9 | #ifdef _DEBUG 10 | #ifndef EIGEN_ALIGN 11 | #define new DEBUG_NEW 12 | #endif 13 | #endif 14 | 15 | INIT_LOGGING 16 | INIT_TIMING 17 | INIT_COUNTING 18 | 19 | using namespace SPH; 20 | using namespace std; 21 | using namespace Utilities; 22 | 23 | 24 | // main 25 | int main( int argc, char **argv ) 26 | { 27 | REPORT_MEMORY_LEAKS; 28 | 29 | PartioViewer viewer; 30 | return viewer.run(argc, argv); 31 | } 32 | -------------------------------------------------------------------------------- /Tools/SurfaceSampling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(SurfaceSampling 2 | main.cpp 3 | ) 4 | add_dependencies(SurfaceSampling SPlisHSPlasH) 5 | target_link_libraries(SurfaceSampling PRIVATE SPlisHSPlasH) 6 | 7 | set_target_properties(SurfaceSampling PROPERTIES FOLDER "Tools") 8 | set_target_properties(SurfaceSampling PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 9 | set_target_properties(SurfaceSampling PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 10 | set_target_properties(SurfaceSampling PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 11 | -------------------------------------------------------------------------------- /Tools/VolumeSampling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(VolumeSampling 2 | main.cpp 3 | SamplingBase.h 4 | SamplingBase.cpp 5 | SPHSamplingBase.cpp 6 | SPHSamplingBase.h 7 | SPHVolumeSampling.cpp 8 | SPHVolumeSampling.h 9 | SPHVolumeSampling_Jiang2015.cpp 10 | SPHVolumeSampling_Jiang2015.h 11 | ) 12 | add_dependencies(VolumeSampling SPlisHSPlasH) 13 | target_link_libraries(VolumeSampling PRIVATE SPlisHSPlasH) 14 | 15 | if(DL_OUTPUT) 16 | target_compile_definitions(VolumeSampling PUBLIC -DDL_OUTPUT) 17 | endif() 18 | 19 | set_target_properties(VolumeSampling PROPERTIES FOLDER "Tools") 20 | set_target_properties(VolumeSampling PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 21 | set_target_properties(VolumeSampling PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 22 | set_target_properties(VolumeSampling PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 23 | 24 | -------------------------------------------------------------------------------- /Tools/VolumeSampling/SPHVolumeSampling.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/Tools/VolumeSampling/SPHVolumeSampling.h -------------------------------------------------------------------------------- /Tools/VolumeSampling/SPHVolumeSampling_Jiang2015.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SPHSamplingBase.h" 4 | #include "SPlisHSPlasH/NeighborhoodSearch.h" 5 | 6 | 7 | namespace SPH 8 | { 9 | /** \brief This class implements the sampling method introduced 10 | * by Jiang et al. [JZW15]. 11 | * 12 | * References: 13 | * - [JZW15] M. Jiang, Y. Zhou, R. Wang, R. Southern, J. J. Zhang. 14 | * Blue noise sampling using an SPH-based method. 15 | * ACM Transactions on Graphics, 2015 16 | */ 17 | class SPHVolumeSampling_Jiang2015 : public SPHSamplingBase 18 | { 19 | protected: 20 | Real m_stiffness; 21 | Real m_dt; 22 | std::vector m_v; 23 | std::vector m_a; 24 | std::vector m_n; 25 | std::vector m_p; 26 | 27 | void computePressure(); 28 | void computeCohesion(); 29 | void computeNormals(); 30 | 31 | virtual void initSPHOptimization(); 32 | virtual void step(Real &avg_density_error); 33 | virtual void generateSamples(); 34 | 35 | 36 | public: 37 | SPHVolumeSampling_Jiang2015(); 38 | ~SPHVolumeSampling_Jiang2015(); 39 | 40 | Real getTimeStepSize() const { return m_dt; } 41 | void setTimeStepSize(const Real dt) { m_dt; } 42 | Real getStiffness() const { return m_stiffness; } 43 | void setStiffness(const Real stiffness) { m_stiffness = stiffness; } 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /Tools/partio2vtk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(partio2vtk 2 | main.cpp 3 | ) 4 | add_dependencies(partio2vtk SPlisHSPlasH) 5 | target_link_libraries(partio2vtk PRIVATE SPlisHSPlasH) 6 | 7 | set_target_properties(partio2vtk PROPERTIES FOLDER "Tools") 8 | set_target_properties(partio2vtk PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 9 | set_target_properties(partio2vtk PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 10 | set_target_properties(partio2vtk PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 11 | -------------------------------------------------------------------------------- /Utilities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(GetGitRevisionDescription) 2 | get_git_head_revision(GIT_REFSPEC GIT_SHA1) 3 | git_local_changes(GIT_LOCAL_CHANGES) 4 | if (${GIT_LOCAL_CHANGES} STREQUAL "DIRTY") 5 | set(COMPILER_MESSAGE "#pragma WARNING(Local changes not committed.)") 6 | endif() 7 | 8 | file (STRINGS "../version.txt" SPLISHSPLASH_VERSION) 9 | 10 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/Version.h @ONLY) 11 | 12 | 13 | 14 | 15 | add_library(Utilities 16 | 17 | BinaryFileReaderWriter.h 18 | Counting.h 19 | FileSystem.h 20 | Logger.h 21 | OBJLoader.h 22 | PartioReaderWriter.cpp 23 | PartioReaderWriter.h 24 | PLYLoader.h 25 | StringTools.h 26 | SystemInfo.h 27 | Timing.h 28 | Version.h 29 | ) 30 | 31 | add_dependencies(Utilities partio zlib) 32 | target_include_directories(Utilities PUBLIC ${TOPLEVEL_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR}) 33 | target_link_libraries(Utilities INTERFACE partio zlib MD5) 34 | -------------------------------------------------------------------------------- /Utilities/PLYLoader.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLYLoader_h__ 2 | #define __PLYLoader_h__ 3 | 4 | #include 5 | #include "Logger.h" 6 | #include "extern/happly/happly.h" 7 | #include 8 | 9 | namespace Utilities 10 | { 11 | /** \brief Read for PLY files. 12 | */ 13 | class PLYLoader 14 | { 15 | public: 16 | /** This function loads an PLY file. 17 | * Only triangulated meshes are supported. 18 | */ 19 | 20 | static void loadPly(const std::string &filename, std::vector> &x, std::vector> &faces, const std::array&scale) 21 | { 22 | LOG_INFO << "Loading " << filename; 23 | 24 | happly::PLYData plyIn(filename.c_str()); 25 | std::vector> vPos = plyIn.getVertexPositions(); 26 | std::vector> fInd = plyIn.getFaceIndices(); 27 | 28 | x.resize(vPos.size()); 29 | for (unsigned int i = 0; i < vPos.size(); i++) 30 | { 31 | x[i] = { 32 | scale[0] * static_cast(vPos[i][0]), 33 | scale[1] * static_cast(vPos[i][1]), 34 | scale[2] * static_cast(vPos[i][2]) 35 | }; 36 | } 37 | 38 | faces.resize(fInd.size()); 39 | for (unsigned int i = 0; i < fInd.size(); i++) 40 | faces[i] = { static_cast(fInd[i][0]), static_cast(fInd[i][1]), static_cast(fInd[i][2]) }; 41 | } 42 | 43 | }; 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /Utilities/PartioReaderWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef __PartioReaderWriter_h__ 2 | #define __PartioReaderWriter_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #include 6 | 7 | namespace Utilities 8 | { 9 | /** \brief Class for reading and writing partio files. 10 | */ 11 | class PartioReaderWriter 12 | { 13 | public: 14 | static bool readParticles(const std::string &fileName, const Vector3r &translation, const Matrix3r &rotation, const Real scale, 15 | std::vector &pos, std::vector &vel); 16 | 17 | static bool readParticles(const std::string &fileName, const Vector3r &translation, const Matrix3r &rotation, const Real scale, 18 | std::vector &positions, std::vector &velocities, Real &particleRadius); 19 | 20 | static bool readParticles(const std::string &fileName, const Vector3r &translation, const Matrix3r &rotation, const Real scale, 21 | std::vector &pos); 22 | 23 | static void writeParticles(const std::string &fileName, const unsigned int numParticles, const Vector3r *particlePositions, 24 | const Vector3r *particleVelocities, const Real particleRadius); 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Utilities/SystemInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __SystemInfo_h__ 2 | #define __SystemInfo_h__ 3 | 4 | #include "SPlisHSPlasH/Common.h" 5 | #if WIN32 6 | #define NOMINMAX 7 | #include "windows.h" 8 | #else 9 | #include 10 | #include 11 | #endif 12 | 13 | namespace Utilities 14 | { 15 | class SystemInfo 16 | { 17 | public: 18 | static std::string getHostName() 19 | { 20 | #ifdef WIN32 21 | const unsigned int bufferSize = 32767; 22 | TCHAR *infoBuf = new TCHAR[bufferSize]; 23 | DWORD bufCharCount = bufferSize; 24 | if (!GetComputerName(infoBuf, &bufCharCount)) 25 | return ""; 26 | std::string name = infoBuf; 27 | delete[] infoBuf; 28 | return name; 29 | #else 30 | const unsigned int bufferSize = 32767; 31 | char hostname[bufferSize]; 32 | gethostname(hostname, bufferSize); 33 | return hostname; 34 | #endif 35 | } 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Utilities/Version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef __Version_h__ 2 | #define __Version_h__ 3 | 4 | #define STRINGIZE_HELPER(x) #x 5 | #define STRINGIZE(x) STRINGIZE_HELPER(x) 6 | #define WARNING(desc) message(__FILE__ "(" STRINGIZE(__LINE__) ") : Warning: " #desc) 7 | 8 | #define GIT_SHA1 "@GIT_SHA1@" 9 | #define GIT_REFSPEC "@GIT_REFSPEC@" 10 | #define GIT_LOCAL_STATUS "@GIT_LOCAL_CHANGES@" 11 | 12 | #define SPLISHSPLASH_VERSION "@SPLISHSPLASH_VERSION@" 13 | 14 | #ifdef DL_OUTPUT 15 | @COMPILER_MESSAGE@ 16 | #endif 17 | 18 | #endif -------------------------------------------------------------------------------- /data/Scenes/AnimatedBody_2D.py: -------------------------------------------------------------------------------- 1 | import splishsplash as sph 2 | import numpy as np 3 | import math 4 | 5 | simulationBase = None 6 | 7 | # This function is called automatically when the script is loaded in SPlisHSPlasH. 8 | # The parameter base contains the current SimulationBase object. 9 | def init(base): 10 | global simulationBase 11 | simulationBase = base 12 | 13 | # This function is called automatically in each simulation step. 14 | def step(): 15 | sim = sph.Simulation.getCurrent() 16 | boundary = sim.getBoundaryModel(1) 17 | animatedBody = boundary.getRigidBodyObject() 18 | 19 | tm = sph.TimeManager.getCurrent() 20 | t = tm.getTime() 21 | animatedBody.setVelocity([ 0.35*math.sin(0.75*t), -0.35*math.cos(0.75*t), 0]) 22 | animatedBody.animate() 23 | -------------------------------------------------------------------------------- /data/Scenes/Beam.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.002, 5 | "particleRadius": 0.025, 6 | "numberOfStepsPerRenderUpdate": 1, 7 | "density0": 1000, 8 | "simulationMethod": 0, 9 | "gravitation": [0,-9.81,0], 10 | "cflMethod": 0, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 0, 18 | "exponent": 1, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "enableZSort": true, 22 | "boundaryHandlingMethod": 2, 23 | "enablePartioExport": false 24 | }, 25 | "Materials": [ 26 | { 27 | "id": "Fluid", 28 | "elasticityMethod": 3, 29 | "viscosity": 0.01, 30 | "viscosityMethod": 1, 31 | "surfaceTension": 0.02, 32 | "surfaceTensionMethod": 0, 33 | "youngsModulus": 5000000.0, 34 | "poissonsRatio": 0.33, 35 | "alpha": 0.1, 36 | "maxNeighbors": 15, 37 | "fixedBoxMin" : [-10,-10,-10], 38 | "fixedBoxMax" : [-1.5,10,10] 39 | } 40 | ], 41 | "FluidModels": [ 42 | { 43 | "particleFile": "../models/beam_r_0.025.bgeo", 44 | "translation": [0,0.5,0], 45 | "scale": [1, 1, 1] 46 | } 47 | ] 48 | } 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /data/Scenes/Beam_2D.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "sim2D": true, 5 | "timeStepSize": 0.005, 6 | "particleRadius": 0.025, 7 | "numberOfStepsPerRenderUpdate": 1, 8 | "density0": 1000, 9 | "simulationMethod": 0, 10 | "gravitation": [0,-9.81,0], 11 | "cflMethod": 0, 12 | "cflFactor": 1, 13 | "cflMaxTimeStepSize": 0.005, 14 | "maxIterations": 100, 15 | "maxError": 0.01, 16 | "maxIterationsV": 100, 17 | "maxErrorV": 0.1, 18 | "stiffness": 0, 19 | "exponent": 1, 20 | "velocityUpdateMethod": 0, 21 | "enableDivergenceSolver": true, 22 | "enableZSort": true, 23 | "boundaryHandlingMethod": 2, 24 | "enablePartioExport": true 25 | }, 26 | "Materials": [ 27 | { 28 | "id": "Fluid", 29 | "elasticityMethod": 3, 30 | "viscosity": 0.01, 31 | "viscosityMethod": 1, 32 | "surfaceTension": 0.02, 33 | "surfaceTensionMethod": 0, 34 | "youngsModulus": 5000000.0, 35 | "poissonsRatio": 0.33, 36 | "alpha": 0.1, 37 | "maxNeighbors": 15, 38 | "fixedBoxMin" : [-10,-10,-10], 39 | "fixedBoxMax" : [-1.5,10,10] 40 | } 41 | ], 42 | "FluidBlocks": [ 43 | { 44 | "denseMode": 0, 45 | "start": [-2.0, -0.2, -0.5], 46 | "end": [2.0, 0.2, 0.5], 47 | "translation": [0,0,0], 48 | "scale": [1, 1, 1] 49 | } 50 | ] 51 | } 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /data/Scenes/BucklingModel_Bender2017.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 0, 11 | "cflFactor": 0.5, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 0.6, 29 | "viscosityMethod": 2, 30 | "viscoMaxIter": 200, 31 | "viscoMaxError": 0.05 32 | } 33 | ], 34 | "RigidBodies": [ 35 | { 36 | "geometryFile": "../models/UnitBox.obj", 37 | "translation": [0,-0.25,0], 38 | "rotationAxis": [1, 0, 0], 39 | "rotationAngle": 0, 40 | "scale": [3, 0.5, 3], 41 | "color": [0.1, 0.4, 0.6, 1.0], 42 | "isDynamic": false, 43 | "isWall": false, 44 | "mapInvert": false, 45 | "mapThickness": 0.0, 46 | "mapResolution": [20,20,20] 47 | } 48 | ], 49 | "FluidBlocks": [ 50 | { 51 | "denseMode": 0, 52 | "start": [-0.1, 0.01, -0.4], 53 | "end": [0.1, 6.0, 0.4], 54 | "translation": [0, 0.1, 0.0], 55 | "scale": [0.75,1,0.75] 56 | } 57 | ] 58 | } 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /data/Scenes/BucklingModel_Peer2015.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 0, 11 | "cflFactor": 0.5, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 0.05, 29 | "viscosityMethod": 3, 30 | "viscoMaxIter": 200, 31 | "viscoMaxError": 0.08 32 | } 33 | ], 34 | "RigidBodies": [ 35 | { 36 | "geometryFile": "../models/UnitBox.obj", 37 | "translation": [0,-0.25,0], 38 | "rotationAxis": [1, 0, 0], 39 | "rotationAngle": 0, 40 | "scale": [3, 0.5, 3], 41 | "color": [0.1, 0.4, 0.6, 1.0], 42 | "isDynamic": false, 43 | "isWall": false, 44 | "mapInvert": false, 45 | "mapThickness": 0.0, 46 | "mapResolution": [20,20,20] 47 | } 48 | ], 49 | "FluidBlocks": [ 50 | { 51 | "denseMode": 0, 52 | "start": [-0.1, 0.01, -0.4], 53 | "end": [0.1, 6.0, 0.4], 54 | "translation": [0, 0.1, 0.0], 55 | "scale": [0.75,1,0.75] 56 | } 57 | ] 58 | } 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /data/Scenes/BucklingModel_Takahashi2015.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 20, 29 | "viscosityMethod": 5, 30 | "viscoMaxIter": 200, 31 | "viscoMaxError": 0.05 32 | } 33 | ], 34 | "RigidBodies": [ 35 | { 36 | "geometryFile": "../models/UnitBox.obj", 37 | "translation": [0,-0.25,0], 38 | "rotationAxis": [1, 0, 0], 39 | "rotationAngle": 0, 40 | "scale": [3, 0.5, 3], 41 | "color": [0.1, 0.4, 0.6, 1.0], 42 | "isDynamic": false, 43 | "isWall": false, 44 | "mapInvert": false, 45 | "mapThickness": 0.0, 46 | "mapResolution": [20,20,20] 47 | } 48 | ], 49 | "FluidBlocks": [ 50 | { 51 | "denseMode": 0, 52 | "start": [-0.1, 0.01, -0.4], 53 | "end": [0.1, 6.0, 0.4], 54 | "translation": [0, 0.1, 0.0], 55 | "scale": [0.75,1,0.75] 56 | } 57 | ] 58 | } 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /data/Scenes/BucklingModel_Weiler2018.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 5, 29 | "viscosityBoundary": 5, 30 | "viscosityMethod": 6, 31 | "viscoMaxIter": 200, 32 | "viscoMaxError": 0.05 33 | } 34 | ], 35 | "RigidBodies": [ 36 | { 37 | "geometryFile": "../models/UnitBox.obj", 38 | "translation": [0,-0.25,0], 39 | "rotationAxis": [1, 0, 0], 40 | "rotationAngle": 0, 41 | "scale": [3, 0.5, 3], 42 | "color": [0.1, 0.4, 0.6, 1.0], 43 | "isDynamic": false, 44 | "isWall": false, 45 | "mapInvert": false, 46 | "mapThickness": 0.0, 47 | "mapResolution": [20,20,20] 48 | } 49 | ], 50 | "FluidBlocks": [ 51 | { 52 | "denseMode": 0, 53 | "start": [-0.1, 0.01, -0.4], 54 | "end": [0.1, 6.0, 0.4], 55 | "translation": [0, 0.1, 0.0], 56 | "scale": [0.75,1,0.75] 57 | } 58 | ] 59 | } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /data/Scenes/CoilingModel_Bender2017.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 0, 11 | "cflFactor": 0.5, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 0.5, 29 | "viscosityMethod": 2, 30 | "viscoMaxIter": 100, 31 | "viscoMaxError": 0.05 32 | } 33 | ], 34 | "RigidBodies": [ 35 | { 36 | "geometryFile": "../models/UnitBox.obj", 37 | "translation": [0,-0.25,0], 38 | "rotationAxis": [1, 0, 0], 39 | "rotationAngle": 0, 40 | "scale": [3, 0.5, 3], 41 | "color": [0.1, 0.4, 0.6, 1.0], 42 | "isDynamic": false, 43 | "isWall": false, 44 | "mapInvert": false, 45 | "mapThickness": 0.0, 46 | "mapResolution": [20,20,20], 47 | "samplingMode": 0 48 | } 49 | ], 50 | "FluidBlocks": [ 51 | { 52 | "denseMode": 0, 53 | "start": [-0.1, 0.01, -0.1], 54 | "end": [0.1, 12.0, 0.1], 55 | "translation": [0, 0.1, 0.0], 56 | "scale": [0.75,1,0.75] 57 | } 58 | ] 59 | } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /data/Scenes/CoilingModel_Peer2015.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 0, 11 | "cflFactor": 0.5, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 0.05, 29 | "viscosityMethod": 3, 30 | "viscoMaxIter": 200, 31 | "viscoMaxError": 0.08 32 | } 33 | ], 34 | "RigidBodies": [ 35 | { 36 | "geometryFile": "../models/UnitBox.obj", 37 | "translation": [0,-0.25,0], 38 | "rotationAxis": [1, 0, 0], 39 | "rotationAngle": 0, 40 | "scale": [3, 0.5, 3], 41 | "color": [0.1, 0.4, 0.6, 1.0], 42 | "isDynamic": false, 43 | "isWall": false, 44 | "mapInvert": false, 45 | "mapThickness": 0.0, 46 | "mapResolution": [20,20,20], 47 | "samplingMode": 0 48 | } 49 | ], 50 | "FluidBlocks": [ 51 | { 52 | "denseMode": 0, 53 | "start": [-0.1, 0.01, -0.1], 54 | "end": [0.1, 12.0, 0.1], 55 | "translation": [0, 0.1, 0.0], 56 | "scale": [0.75,1,0.75] 57 | } 58 | ] 59 | } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /data/Scenes/CoilingModel_Takahashi2015.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0], 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 20, 29 | "viscosityMethod": 5, 30 | "viscoMaxIter": 200, 31 | "viscoMaxError": 0.05 32 | } 33 | ], 34 | "RigidBodies": [ 35 | { 36 | "geometryFile": "../models/UnitBox.obj", 37 | "translation": [0,-0.25,0], 38 | "rotationAxis": [1, 0, 0], 39 | "rotationAngle": 0, 40 | "scale": [3, 0.5, 3], 41 | "color": [0.1, 0.4, 0.6, 1.0], 42 | "isDynamic": false, 43 | "isWall": false, 44 | "mapInvert": false, 45 | "mapThickness": 0.0, 46 | "mapResolution": [20,20,20], 47 | "samplingMode": 0 48 | } 49 | ], 50 | "FluidBlocks": [ 51 | { 52 | "denseMode": 0, 53 | "start": [-0.1, 0.01, -0.1], 54 | "end": [0.1, 12.0, 0.1], 55 | "translation": [0, 0.1, 0.0], 56 | "scale": [0.75,1,0.75] 57 | } 58 | ] 59 | } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /data/Scenes/CoilingModel_Weiler2018.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.1,-9.81,0.02], 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "surfaceTension": 0.2, 27 | "surfaceTensionMethod": 0, 28 | "viscosity": 5, 29 | "viscosityBoundary": 4, 30 | "viscosityMethod": 6, 31 | "viscoMaxIter": 200, 32 | "viscoMaxError": 0.05 33 | } 34 | ], 35 | "RigidBodies": [ 36 | { 37 | "geometryFile": "../models/UnitBox.obj", 38 | "translation": [0,-0.25,0], 39 | "rotationAxis": [1, 0, 0], 40 | "rotationAngle": 0, 41 | "scale": [3, 0.5, 3], 42 | "color": [0.1, 0.4, 0.6, 1.0], 43 | "isDynamic": false, 44 | "isWall": false, 45 | "mapInvert": false, 46 | "mapThickness": 0.0, 47 | "mapResolution": [20,20,20], 48 | "samplingMode": 0 49 | } 50 | ], 51 | "FluidBlocks": [ 52 | { 53 | "denseMode": 0, 54 | "start": [-0.1, 0.01, -0.1], 55 | "end": [0.1, 12.0, 0.1], 56 | "translation": [0, 0.1, 0.0], 57 | "scale": [0.75,1,0.75] 58 | } 59 | ] 60 | } 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /data/Scenes/DamBreakModel.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "particleRadius": 0.025, 5 | "numberOfStepsPerRenderUpdate": 4, 6 | "density0": 1000, 7 | "simulationMethod": 4, 8 | "gravitation": [0,-9.81,0], 9 | "timeStepSize": 0.005, 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.05, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "particleAttributes": "density;velocity", 22 | "boundaryHandlingMethod": 2 23 | }, 24 | "Materials": [ 25 | { 26 | "id": "Fluid", 27 | "surfaceTension": 0.2, 28 | "surfaceTensionMethod": 0, 29 | "viscosity": 0.01, 30 | "viscosityMethod": 1 31 | } 32 | ], 33 | "RigidBodies": [ 34 | { 35 | "geometryFile": "../models/UnitBox.obj", 36 | "translation": [0,1.5,0], 37 | "rotationAxis": [1, 0, 0], 38 | "rotationAngle": 0, 39 | "scale": [4, 3, 1.5], 40 | "color": [0.1, 0.4, 0.6, 1.0], 41 | "isDynamic": false, 42 | "isWall": true, 43 | "mapInvert": true, 44 | "mapThickness": 0.0, 45 | "mapResolution": [40,30,15] 46 | } 47 | ], 48 | "FluidBlocks": [ 49 | { 50 | "denseMode": 0, 51 | "start": [-0.5, 0.0, -0.5], 52 | "end": [0.5, 1.0, 0.5], 53 | "translation": [-1.45, 0.05, 0.0], 54 | "scale": [1, 1, 1] 55 | } 56 | ] 57 | } 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /data/Scenes/DeformableModel.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "imteStepSize": 0.001, 5 | "particleRadius": 0.025, 6 | "numberOfStepsPerRenderUpdate": 2, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0,-9.81,0], 10 | "cflMethod": 0, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 2 22 | }, 23 | "Materials": [ 24 | { 25 | "id": "Fluid", 26 | "elasticityMethod": 2, 27 | "viscosity": 0.01, 28 | "viscosityMethod": 1, 29 | "surfaceTension": 0.02, 30 | "surfaceTensionMethod": 0, 31 | "youngsModulus": 250000.0, 32 | "poissonsRatio": 0.33, 33 | "alpha": 0.1 34 | } 35 | ], 36 | "RigidBodies": [ 37 | { 38 | "geometryFile": "../models/UnitBox.obj", 39 | "translation": [0,2.5,0], 40 | "rotationAxis": [1, 0, 0], 41 | "rotationAngle": 0, 42 | "scale": [3, 5, 3], 43 | "color": [0.1, 0.4, 0.6, 1.0], 44 | "isDynamic": false, 45 | "isWall": true, 46 | "mapInvert": true, 47 | "mapThickness": 0.0, 48 | "mapResolution": [20,30,20] 49 | } 50 | ], 51 | "FluidBlocks": [ 52 | { 53 | "denseMode": 0, 54 | "start": [-0.25, 0.5, -0.25], 55 | "end": [0.25, 1.0, 0.25] 56 | } 57 | ] 58 | } 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /data/Scenes/DoubleDamBreak.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "cameraPosition": [0,2,5], 5 | "cameraLookat": [0,0,0], 6 | "particleRadius": 0.025, 7 | "numberOfStepsPerRenderUpdate": 4, 8 | "density0": 1000, 9 | "simulationMethod": 4, 10 | "gravitation": [0,-9.81,0], 11 | "cflMethod": 1, 12 | "cflFactor": 1, 13 | "cflMaxTimeStepSize": 0.005, 14 | "maxIterations": 100, 15 | "maxError": 0.05, 16 | "maxIterationsV": 100, 17 | "maxErrorV": 0.1, 18 | "stiffness": 50000, 19 | "exponent": 7, 20 | "velocityUpdateMethod": 0, 21 | "enableDivergenceSolver": true, 22 | "boundaryHandlingMethod": 2 23 | }, 24 | "Materials": [ 25 | { 26 | "id": "Fluid", 27 | "viscosity": 0.01, 28 | "viscosityMethod": 1, 29 | "colorMapType": 1 30 | } 31 | ], 32 | "RigidBodies": [ 33 | { 34 | "geometryFile": "../models/UnitBox.obj", 35 | "translation": [0,1.5,0], 36 | "rotationAxis": [1, 0, 0], 37 | "rotationAngle": 0, 38 | "scale": [3.1, 3.1, 3.1], 39 | "color": [0.1, 0.4, 0.6, 1.0], 40 | "isDynamic": false, 41 | "isWall": true, 42 | "mapInvert": true, 43 | "mapThickness": 0.0, 44 | "mapResolution": [25,25,25] 45 | } 46 | ], 47 | "FluidBlocks": [ 48 | { 49 | "denseMode": 0, 50 | "start": [-1.5, 0.0, -1.5], 51 | "end": [-0.8, 0.75, -0.8] 52 | }, 53 | { 54 | "denseMode": 0, 55 | "start": [0.8, 0.0, 0.8], 56 | "end": [1.5, 0.75, 1.5] 57 | } 58 | ] 59 | } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /data/Scenes/DragTest.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.025, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0,-9.81,0], 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true 21 | }, 22 | "Materials": [ 23 | { 24 | "id": "Fluid", 25 | "dragMethod": 2, 26 | "drag": 10.0 27 | } 28 | ], 29 | "FluidBlocks": [ 30 | { 31 | "denseMode": 0, 32 | "start": [-0.5, 0.0, -0.5], 33 | "end": [0.5, 1.0, 0.5], 34 | "translation": [0.0, 3.0, 0.0], 35 | "scale": [1, 1, 1] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /data/Scenes/Empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "simulationMethod": 4 5 | } 6 | } 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /data/Scenes/GridModel_Akinci2012.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "stopAt": 15, 6 | "numberOfStepsPerRenderUpdate": 2, 7 | "particleRadius": 0.02, 8 | "density0": 1000, 9 | "simulationMethod": 4, 10 | "gravitation": [0.0,-6,0.0], 11 | "cflMethod": 1, 12 | "cflFactor": 1, 13 | "cflMaxTimeStepSize": 0.005, 14 | "maxIterations": 100, 15 | "maxError": 0.01, 16 | "maxIterationsV": 100, 17 | "maxErrorV": 0.1, 18 | "stiffness": 50000, 19 | "exponent": 7, 20 | "velocityUpdateMethod": 0, 21 | "enableDivergenceSolver": true, 22 | "boundaryHandlingMethod": 0, 23 | "enablePartioExport": true, 24 | "partioAttributes": "velocity" 25 | }, 26 | "RigidBodies": [ 27 | { 28 | "geometryFile": "../models/UnitBox.obj", 29 | "translation": [-6,-0.25,0], 30 | "rotationAxis": [0, 0, 1], 31 | "rotationAngle": 0.05, 32 | "scale": [16, 0.5, 4], 33 | "color": [0.1, 0.4, 0.6, 1.0], 34 | "isDynamic": false, 35 | "isWall": false, 36 | "samplingMode": 1, 37 | "mapInvert": false, 38 | "mapThickness": 0.0, 39 | "mapResolution": [80,5,20], 40 | "samplingMode": 0 41 | } 42 | ], 43 | "FluidModels": [ 44 | { 45 | "particleFile": "../models/particle_grid.bgeo", 46 | "translation": [0.0, 0.35, 0.0], 47 | "scale": [0.125,0.125,0.125] 48 | } 49 | ] 50 | } 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /data/Scenes/GridModel_Bender2019.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "stopAt": 15, 6 | "numberOfStepsPerRenderUpdate": 2, 7 | "particleRadius": 0.02, 8 | "density0": 1000, 9 | "simulationMethod": 4, 10 | "gravitation": [0.0,-6,0.0], 11 | "cflMethod": 1, 12 | "cflFactor": 1, 13 | "cflMaxTimeStepSize": 0.005, 14 | "maxIterations": 100, 15 | "maxError": 0.01, 16 | "maxIterationsV": 100, 17 | "maxErrorV": 0.1, 18 | "stiffness": 50000, 19 | "exponent": 7, 20 | "velocityUpdateMethod": 0, 21 | "enableDivergenceSolver": true, 22 | "boundaryHandlingMethod": 2, 23 | "enablePartioExport": true, 24 | "partioAttributes": "velocity" 25 | }, 26 | "RigidBodies": [ 27 | { 28 | "geometryFile": "../models/UnitBox.obj", 29 | "translation": [-6,-0.25,0], 30 | "rotationAxis": [0, 0, 1], 31 | "rotationAngle": 0.05, 32 | "scale": [16, 0.5, 4], 33 | "color": [0.1, 0.4, 0.6, 1.0], 34 | "isDynamic": false, 35 | "isWall": false, 36 | "mapInvert": false, 37 | "mapThickness": 0.0, 38 | "mapResolution": [40,5,10] 39 | } 40 | ], 41 | "FluidModels": [ 42 | { 43 | "particleFile": "../models/particle_grid.bgeo", 44 | "translation": [0.0, 0.35, 0.0], 45 | "scale": [0.125,0.125,0.125] 46 | } 47 | ] 48 | } 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /data/Scenes/GridModel_Koschier2017.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "timeStepSize": 0.001, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "particleRadius": 0.02, 7 | "density0": 1000, 8 | "simulationMethod": 4, 9 | "gravitation": [0.0,-6,0.0], 10 | "cflMethod": 1, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.005, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "boundaryHandlingMethod": 1, 22 | "enablePartioExport": true, 23 | "partioAttributes": "velocity" 24 | }, 25 | "RigidBodies": [ 26 | { 27 | "geometryFile": "../models/UnitBox.obj", 28 | "translation": [-6,-0.25,0], 29 | "rotationAxis": [0, 0, 1], 30 | "rotationAngle": 0.05, 31 | "scale": [16, 0.5, 4], 32 | "color": [0.1, 0.4, 0.6, 1.0], 33 | "isDynamic": false, 34 | "isWall": false, 35 | "mapInvert": false, 36 | "mapThickness": 0.0, 37 | "mapResolution": [80,5,20] 38 | } 39 | ], 40 | "FluidModels": [ 41 | { 42 | "particleFile": "../models/particle_grid.bgeo", 43 | "translation": [0.0, 0.35, 0.0], 44 | "scale": [0.125,0.125,0.125] 45 | } 46 | ] 47 | } 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /data/Scenes/ScriptTest.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "cameraPosition": [0,2,5], 5 | "cameraLookat": [0,0,0], 6 | "particleRadius": 0.025, 7 | "numberOfStepsPerRenderUpdate": 4, 8 | "density0": 1000, 9 | "simulationMethod": 4, 10 | "gravitation": [0,-9.81,0], 11 | "cflMethod": 1, 12 | "cflFactor": 1, 13 | "cflMaxTimeStepSize": 0.005, 14 | "maxIterations": 100, 15 | "maxError": 0.05, 16 | "maxIterationsV": 100, 17 | "maxErrorV": 0.1, 18 | "stiffness": 50000, 19 | "exponent": 7, 20 | "velocityUpdateMethod": 0, 21 | "enableDivergenceSolver": true, 22 | "boundaryHandlingMethod": 2, 23 | "scriptFile": "ScriptTest.py" 24 | }, 25 | "Materials": [ 26 | { 27 | "id": "Fluid", 28 | "viscosity": 0.01, 29 | "viscosityMethod": 1, 30 | "colorMapType": 1 31 | } 32 | ], 33 | "RigidBodies": [ 34 | { 35 | "geometryFile": "../models/UnitBox.obj", 36 | "translation": [0,1.5,0], 37 | "rotationAxis": [1, 0, 0], 38 | "rotationAngle": 0, 39 | "scale": [3.1, 3.1, 3.1], 40 | "color": [0.1, 0.4, 0.6, 1.0], 41 | "isDynamic": false, 42 | "isWall": true, 43 | "mapInvert": true, 44 | "mapThickness": 0.0, 45 | "mapResolution": [25,25,25] 46 | } 47 | ], 48 | "FluidBlocks": [ 49 | { 50 | "denseMode": 0, 51 | "start": [-1.5, 0.0, -1.5], 52 | "end": [-0.8, 0.75, -0.8] 53 | }, 54 | { 55 | "denseMode": 0, 56 | "start": [0.8, 0.0, 0.8], 57 | "end": [1.5, 0.75, 1.5] 58 | } 59 | ] 60 | } 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /data/Scenes/ScriptTest.py: -------------------------------------------------------------------------------- 1 | import splishsplash as sph 2 | import numpy as np 3 | 4 | # List of functions that can be executed via the SPlisHSPlasH GUI (buttons will be added). 5 | function_list = ['getExePath', 'getOutputPath', 'getSceneFile'] 6 | 7 | counter = 0 8 | simulationBase = None 9 | 10 | # This function is called automatically when the script is loaded in SPlisHSPlasH. 11 | # The parameter base contains the current SimulationBase object. 12 | def init(base): 13 | global counter 14 | global simulationBase 15 | 16 | print("init") 17 | simulationBase = base 18 | counter = 1 19 | 20 | # This function is called automatically in each simulation step. 21 | def step(): 22 | global counter 23 | sim = sph.Simulation.getCurrent() 24 | fluid = sim.getFluidModel(0) 25 | tm = sph.TimeManager.getCurrent() 26 | print(fluid.getPosition(0)) 27 | 28 | print(counter) 29 | counter += 1 30 | print("---") 31 | 32 | # This function is called automatically in each simulation reset. 33 | def reset(): 34 | print("reset") 35 | 36 | def getExePath(): 37 | global simulationBase 38 | print("Exe path:") 39 | print(simulationBase.getExePath()) 40 | print("-") 41 | 42 | def getOutputPath(): 43 | global simulationBase 44 | print("Output path:") 45 | print(simulationBase.getOutputPath()) 46 | print("-") 47 | 48 | def getSceneFile(): 49 | print("Scene file:") 50 | print(sph.Exec.SceneConfiguration.getCurrent().getSceneFile()) 51 | print("-") -------------------------------------------------------------------------------- /data/Scenes/SurfaceTension_NoGravCube_ZR2020.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration": 3 | { 4 | "particleRadius": 0.02, 5 | "numberOfStepsPerRenderUpdate": 2, 6 | "density0": 1000, 7 | "simulationMethod": 3, 8 | "gravitation": [0,0,0], 9 | "timeStepSize": 0.001, 10 | "cflMethod": 0, 11 | "cflFactor": 1, 12 | "cflMaxTimeStepSize": 0.001, 13 | "maxIterations": 100, 14 | "maxError": 0.01, 15 | "maxIterationsV": 100, 16 | "maxErrorV": 0.1, 17 | "stiffness": 50000, 18 | "exponent": 7, 19 | "velocityUpdateMethod": 0, 20 | "enableDivergenceSolver": true, 21 | "particleAttributes": "density;velocity", 22 | "boundaryHandlingMethod": 2 23 | }, 24 | "Materials": [ 25 | { 26 | "id": "Fluid", 27 | "renderMaxValue": 1.0, 28 | "surfaceTension": 0.1, 29 | "surfaceTensionMethod": 5, 30 | "surfTZRversion": 0, 31 | "surfTZRCsd": 60000, 32 | "surfTZRr-ratio": 0.8, 33 | "surfTZRtau": 0.5, 34 | "surfTZRd": 28, 35 | "surfTZRsampling": 0, 36 | "surfTZRnormal-mode": 2, 37 | "surfTZRd-offset": 3, 38 | "surfTZRPcaMixNrm": 0.8, 39 | "surfTZRPcaMixCur": 0.4, 40 | "surfTZRMCSamples": 120, 41 | "surfTZRNeighLimit": 13, 42 | "viscosity": 0.01, 43 | "viscosityMethod": 1 44 | } 45 | ], 46 | "FluidBlocks": [ 47 | { 48 | "denseMode": 0, 49 | "start": [-0.5, -0.5, -0.5], 50 | "end": [0.5, 0.5, 0.5], 51 | "translation": [0.0, 0.0, 0.0], 52 | "scale": [0.9,0.9,0.9] 53 | } 54 | 55 | ] 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /data/models/UnitBox.obj: -------------------------------------------------------------------------------- 1 | # This file uses centimeters as units for non-parametric coordinates. 2 | 3 | v -0.500000 -0.500000 0.500000 4 | v 0.500000 -0.500000 0.500000 5 | v -0.500000 0.500000 0.500000 6 | v 0.500000 0.500000 0.500000 7 | v -0.500000 0.500000 -0.500000 8 | v 0.500000 0.500000 -0.500000 9 | v -0.500000 -0.500000 -0.500000 10 | v 0.500000 -0.500000 -0.500000 11 | vt 0.375000 0.000000 12 | vt 0.625000 0.000000 13 | vt 0.375000 0.250000 14 | vt 0.625000 0.250000 15 | vt 0.375000 0.500000 16 | vt 0.625000 0.500000 17 | vt 0.375000 0.750000 18 | vt 0.625000 0.750000 19 | vt 0.375000 1.000000 20 | vt 0.625000 1.000000 21 | vt 0.875000 0.000000 22 | vt 0.875000 0.250000 23 | vt 0.125000 0.000000 24 | vt 0.125000 0.250000 25 | f 1/1 2/2 3/3 26 | f 3/3 2/2 4/4 27 | f 3/3 4/4 5/5 28 | f 5/5 4/4 6/6 29 | f 5/5 6/6 7/7 30 | f 7/7 6/6 8/8 31 | f 7/7 8/8 1/9 32 | f 1/9 8/8 2/10 33 | f 2/2 8/11 4/4 34 | f 4/4 8/11 6/12 35 | f 7/13 1/1 5/14 36 | f 5/14 1/1 3/3 37 | -------------------------------------------------------------------------------- /data/models/beam_r_0.025.bgeo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/data/models/beam_r_0.025.bgeo -------------------------------------------------------------------------------- /data/models/bunny.bgeo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/data/models/bunny.bgeo -------------------------------------------------------------------------------- /data/models/bunny2.bgeo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/data/models/bunny2.bgeo -------------------------------------------------------------------------------- /data/models/particle_grid.bgeo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/data/models/particle_grid.bgeo -------------------------------------------------------------------------------- /data/models/sphere.bgeo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/data/models/sphere.bgeo -------------------------------------------------------------------------------- /data/shaders/fs_smooth.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform vec3 surface_color; 4 | uniform float shininess; 5 | uniform float specular_factor; 6 | 7 | layout(location = 0, index = 0) out vec4 frag_color; 8 | 9 | in VertexData 10 | { 11 | vec3 normal; 12 | vec3 view; 13 | } 14 | inData; 15 | 16 | void main() 17 | { 18 | vec3 normal = inData.normal; 19 | 20 | if (!gl_FrontFacing) 21 | { 22 | normal = -inData.normal; 23 | } 24 | 25 | const vec3 ambient = vec3(0.6, 0.6, 0.6); 26 | const vec3 diffuse = vec3(1.0, 1.0, 1.0); 27 | const vec3 specular = vec3(1.0, 1.0, 1.0); 28 | 29 | vec3 eye_n = normalize(normal); 30 | vec3 eye_v = normalize(inData.view); 31 | const vec3 eye_l = vec3(0.0, 0.0, 1.0); 32 | float cos_ln = max(dot(eye_l, eye_n), 0.0); 33 | vec3 h = normalize(eye_l + eye_v); 34 | float cos_nh = max(dot(eye_n, h), 0.0); 35 | 36 | vec3 color = surface_color * (ambient + diffuse * cos_ln + specular_factor * specular * pow(cos_nh, shininess)); 37 | 38 | frag_color = vec4(color, 1.0); 39 | } 40 | -------------------------------------------------------------------------------- /data/shaders/vs_points_scalar.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | uniform mat4 projection_matrix; 5 | 6 | uniform float radius; 7 | uniform float viewport_width; 8 | 9 | layout (location = 0) in vec3 position; 10 | layout (location = 1) in float scalar_field; 11 | 12 | out block 13 | { 14 | flat vec3 mv_pos; 15 | flat float scalar_field; 16 | } 17 | Out; 18 | 19 | void main() 20 | { 21 | vec4 mv_pos = modelview_matrix * vec4(position, 1.0); 22 | vec4 proj = projection_matrix * vec4(radius, 0.0, mv_pos.z, mv_pos.w); 23 | gl_PointSize = viewport_width * proj.x / proj.w; 24 | 25 | Out.mv_pos = mv_pos.xyz; 26 | Out.scalar_field = scalar_field; 27 | gl_Position = projection_matrix * mv_pos; 28 | } 29 | -------------------------------------------------------------------------------- /data/shaders/vs_points_vector.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | uniform mat4 projection_matrix; 5 | 6 | uniform float radius; 7 | uniform float viewport_width; 8 | 9 | layout (location = 0) in vec3 position; 10 | layout (location = 1) in vec3 vector_field; 11 | 12 | out block 13 | { 14 | flat vec3 mv_pos; 15 | flat float scalar_field; 16 | } 17 | Out; 18 | 19 | void main() 20 | { 21 | vec4 mv_pos = modelview_matrix * vec4(position, 1.0); 22 | vec4 proj = projection_matrix * vec4(radius, 0.0, mv_pos.z, mv_pos.w); 23 | gl_PointSize = viewport_width * proj.x / proj.w; 24 | 25 | Out.mv_pos = mv_pos.xyz; 26 | Out.scalar_field = length(vector_field); 27 | gl_Position = projection_matrix * mv_pos; 28 | } 29 | -------------------------------------------------------------------------------- /data/shaders/vs_smooth.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform mat4 modelview_matrix; 4 | uniform mat4 projection_matrix; 5 | 6 | layout(location = 0) in vec3 position; 7 | layout(location = 2) in vec3 normal; 8 | 9 | out VertexData 10 | { 11 | vec3 normal; 12 | vec3 view; 13 | } 14 | outData; 15 | 16 | void main() 17 | { 18 | vec4 v_position = projection_matrix * modelview_matrix * vec4(position, 1.0); 19 | outData.normal = mat3(modelview_matrix) * normal; 20 | outData.view = -v_position.xyz; 21 | gl_Position = v_position; 22 | } 23 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile clean 16 | 17 | clean: 18 | rm -rf doxyoutput/ api/ 19 | @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 20 | 21 | # Catch-all target: route all unknown targets to Sphinx using the new 22 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 23 | %: Makefile 24 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /doc/SurfaceSampling.md: -------------------------------------------------------------------------------- 1 | # SurfaceSampling 2 | 3 | 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. -------------------------------------------------------------------------------- /doc/bibliography.rst: -------------------------------------------------------------------------------- 1 | References 2 | ========== 3 | 4 | .. bibliography:: bibliography.bib 5 | :all: 6 | 7 | -------------------------------------------------------------------------------- /doc/images/SPlisHSPlasH.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/SPlisHSPlasH.jpg -------------------------------------------------------------------------------- /doc/images/SPlisHSPlasH1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/SPlisHSPlasH1.jpg -------------------------------------------------------------------------------- /doc/images/SPlisHSPlasH2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/SPlisHSPlasH2.jpg -------------------------------------------------------------------------------- /doc/images/SPlisHSPlasH3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/SPlisHSPlasH3.jpg -------------------------------------------------------------------------------- /doc/images/SPlisHSPlasH4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/SPlisHSPlasH4.jpg -------------------------------------------------------------------------------- /doc/images/SoftwareArchitechture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/SoftwareArchitechture.jpg -------------------------------------------------------------------------------- /doc/images/beam_meshes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/beam_meshes.jpg -------------------------------------------------------------------------------- /doc/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/logo.jpg -------------------------------------------------------------------------------- /doc/images/logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/logo.pdf -------------------------------------------------------------------------------- /doc/images/logo_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/logo_small.jpg -------------------------------------------------------------------------------- /doc/images/river_foam.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/river_foam.jpg -------------------------------------------------------------------------------- /doc/images/teaser.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/teaser.gif -------------------------------------------------------------------------------- /doc/images/volume_sampling1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/volume_sampling1.jpg -------------------------------------------------------------------------------- /doc/images/volume_sampling2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/volume_sampling2.jpg -------------------------------------------------------------------------------- /doc/images/walrus_press.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/doc/images/walrus_press.jpg -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | 2 | .. image:: https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/master/doc/images/logo_small.jpg 3 | | 4 | | An open-source library for the simulation of fluids and solids 5 | | Web page: https://splishsplash.physics-simulation.org/ 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | :caption: Introduction: 10 | 11 | about 12 | getting_started 13 | file_format 14 | replicability 15 | 16 | 17 | .. toctree:: 18 | :maxdepth: 2 19 | :caption: Developer Guide: 20 | 21 | build_from_source 22 | cmake_options 23 | architecture 24 | implement_nonpressure_force 25 | implement_exporter 26 | creating_pressure 27 | macros 28 | 29 | 30 | .. toctree:: 31 | :maxdepth: 2 32 | :caption: Python Package: 33 | 34 | py_getting_started 35 | py_embedded_python 36 | py_creating_scenes 37 | py_restrictions 38 | 39 | 40 | .. toctree:: 41 | :maxdepth: 2 42 | :caption: Tools: 43 | 44 | FoamGenerator 45 | MeshSkinning 46 | partio2vtk 47 | PartioViewer 48 | SurfaceSampling 49 | VolumeSampling 50 | 51 | 52 | .. toctree:: 53 | :maxdepth: 2 54 | :caption: API Documentation: 55 | 56 | api/library_root 57 | 58 | .. toctree:: 59 | :caption: References 60 | 61 | bibliography 62 | 63 | 64 | Indices and tables 65 | ================== 66 | 67 | * :ref:`genindex` 68 | * :ref:`search` 69 | 70 | -------------------------------------------------------------------------------- /doc/mainpage.dox: -------------------------------------------------------------------------------- 1 | namespace SPH { 2 | 3 | /** \mainpage notitle 4 | 5 | This is the API documentation for SPlisHSPlasH. 6 | 7 | @author Jan Bender 8 | 9 | \copyright 10 | 11 | The MIT License (MIT) 12 | 13 | Copyright (c) 2016-present, SPlisHSPlasH contributors 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /doc/partio2vtk.md: -------------------------------------------------------------------------------- 1 | # partio2vtk 2 | 3 | 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. -------------------------------------------------------------------------------- /doc/py_restrictions.md: -------------------------------------------------------------------------------- 1 | # Restrictions 2 | 3 | - When modifying simulation parameters this is the recommended structure, as modification will only work after `base.initSimulation()` has been called. 4 | ```python 5 | base.initSimulation() 6 | sim = sph.Simulation.getCurrent() 7 | sim.setValue...() 8 | base.runSimulation() 9 | base.cleanup() 10 | ``` 11 | - `setValue...()` and `getValue...()` functions cannot accept vectors as arguments yet 12 | 13 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | exhale 2 | recommonmark 3 | Sphinx==5.2.3 4 | sphinx_rtd_theme==1.3.0 5 | sphinxcontrib.bibtex==2.6.1 6 | docutils==0.16 7 | -------------------------------------------------------------------------------- /extern/Catch2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /extern/eigen/COPYING.README: -------------------------------------------------------------------------------- 1 | Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: 2 | http://www.mozilla.org/MPL/2.0/ 3 | http://www.mozilla.org/MPL/2.0/FAQ.html 4 | 5 | Some files contain third-party code under BSD or LGPL licenses, whence the other 6 | COPYING.* files here. 7 | 8 | All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. 9 | For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. 10 | 11 | If you want to guarantee that the Eigen code that you are #including is licensed 12 | under the MPL2 and possibly more permissive licenses (like BSD), #define this 13 | preprocessor symbol: 14 | EIGEN_MPL2_ONLY 15 | For example, with most compilers, you could add this to your project CXXFLAGS: 16 | -DEIGEN_MPL2_ONLY 17 | This will cause a compilation error to be generated if you #include any code that is 18 | LGPL licensed. 19 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 20 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #ifdef EIGEN_USE_MKL 36 | #include "mkl_lapacke.h" 37 | #else 38 | #include "src/misc/lapacke.h" 39 | #endif 40 | #include "src/Cholesky/LLT_LAPACKE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_CHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | 33 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #ifdef EIGEN_USE_MKL 32 | #include "mkl_lapacke.h" 33 | #else 34 | #include "src/misc/lapacke.h" 35 | #endif 36 | #include "src/LU/PartialPivLU_LAPACKE.h" 37 | #endif 38 | #include "src/LU/Determinant.h" 39 | #include "src/LU/InverseImpl.h" 40 | 41 | #if defined EIGEN_VECTORIZE_SSE || defined EIGEN_VECTORIZE_NEON 42 | #include "src/LU/arch/InverseSize4.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_LU_MODULE_H 48 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #ifdef EIGEN_USE_MKL 40 | #include "mkl_lapacke.h" 41 | #else 42 | #include "src/misc/lapacke.h" 43 | #endif 44 | #include "src/QR/HouseholderQR_LAPACKE.h" 45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_QR_MODULE_H 51 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #include "SparseCholesky" 29 | #include "SparseLU" 30 | #include "SparseQR" 31 | #include "IterativeLinearSolvers" 32 | 33 | #endif // EIGEN_SPARSE_MODULE_H 34 | 35 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/SparseCholesky/SimplicialCholesky.h" 34 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 38 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | EIGEN_DEVICE_FUNC inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * math_constants.h - 3 | * HIP equivalent of the CUDA header of the same name 4 | */ 5 | 6 | #ifndef __MATH_CONSTANTS_H__ 7 | #define __MATH_CONSTANTS_H__ 8 | 9 | /* single precision constants */ 10 | 11 | #define HIPRT_INF_F __int_as_float(0x7f800000) 12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff) 13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001) 14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff) 15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000) 16 | #define HIPRT_ZERO_F 0.0f 17 | #define HIPRT_ONE_F 1.0f 18 | 19 | /* double precision constants */ 20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000) 21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MATH_FUNCTIONS_SVE_H 11 | #define EIGEN_MATH_FUNCTIONS_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pexp(const PacketXf& x) { 18 | return pexp_float(x); 19 | } 20 | 21 | template <> 22 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf plog(const PacketXf& x) { 23 | return plog_float(x); 24 | } 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf psin(const PacketXf& x) { 28 | return psin_float(x); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pcos(const PacketXf& x) { 33 | return pcos_float(x); 34 | } 35 | 36 | // Hyperbolic Tangent function. 37 | template <> 38 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf ptanh(const PacketXf& x) { 39 | return internal::generic_fast_tanh_float(x); 40 | } 41 | } // end namespace internal 42 | } // end namespace Eigen 43 | 44 | #endif // EIGEN_MATH_FUNCTIONS_SVE_H 45 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't reenable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #pragma diag_default code_is_unreachable 24 | // #pragma diag_default initialization_not_reachable 25 | // #pragma diag_default 2651 26 | // #pragma diag_default 2653 27 | #endif 28 | 29 | #endif 30 | 31 | #endif // EIGEN_WARNINGS_DISABLED 32 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /extern/eigen/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /extern/eigen/signature_of_eigen3_matrix_library: -------------------------------------------------------------------------------- 1 | This file is just there as a signature to help identify directories containing Eigen3. When writing a script looking for Eigen3, just look for this file. This is especially useful to help disambiguate with Eigen2... 2 | -------------------------------------------------------------------------------- /extern/eigen/version.txt: -------------------------------------------------------------------------------- 1 | Eigen 3.4.0 -------------------------------------------------------------------------------- /extern/glfw/CMake/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${MACOSX_BUNDLE_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /extern/glfw/CMake/i686-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindEpollShim.cmake: -------------------------------------------------------------------------------- 1 | # Find EpollShim 2 | # Once done, this will define 3 | # 4 | # EPOLLSHIM_FOUND - System has EpollShim 5 | # EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories 6 | # EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim 7 | 8 | find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) 9 | find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) 10 | 11 | if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 12 | set(EPOLLSHIM_FOUND TRUE) 13 | endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) 17 | mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) 18 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindOSMesa.cmake: -------------------------------------------------------------------------------- 1 | # Try to find OSMesa on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # OSMESA_LIBRARIES - Link these to use OSMesa 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) 14 | 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindWaylandProtocols.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION}) 4 | 5 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols 6 | OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR 7 | RESULT_VARIABLE _pkgconfig_failed) 8 | if (_pkgconfig_failed) 9 | message(FATAL_ERROR "Missing wayland-protocols pkgdatadir") 10 | endif() 11 | 12 | string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") 13 | 14 | find_package_handle_standard_args(WaylandProtocols 15 | FOUND_VAR 16 | WaylandProtocols_FOUND 17 | REQUIRED_VARS 18 | WaylandProtocols_PKGDATADIR 19 | VERSION_VAR 20 | WaylandProtocols_VERSION 21 | HANDLE_COMPONENTS 22 | ) 23 | 24 | set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) 25 | set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) 26 | set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) 27 | -------------------------------------------------------------------------------- /extern/glfw/CMake/modules/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find XKBCommon 2 | # Once done, this will define 3 | # 4 | # XKBCOMMON_FOUND - System has XKBCommon 5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories 6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon 7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon 8 | 9 | find_package(PkgConfig) 10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) 11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) 12 | 13 | find_path(XKBCOMMON_INCLUDE_DIR 14 | NAMES xkbcommon/xkbcommon.h 15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} 16 | ) 17 | 18 | find_library(XKBCOMMON_LIBRARY 19 | NAMES xkbcommon 20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} 21 | ) 22 | 23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) 24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) 25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG 29 | XKBCOMMON_LIBRARY 30 | XKBCOMMON_INCLUDE_DIR 31 | ) 32 | 33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) 34 | 35 | -------------------------------------------------------------------------------- /extern/glfw/CMake/x86_64-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /extern/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /extern/glfw/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /extern/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION@ 9 | URL: https://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /extern/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 2 | -------------------------------------------------------------------------------- /extern/glfw/src/null_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE struct { int dummyJoystick; } 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyLibraryJoystick; } 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "" 31 | 32 | -------------------------------------------------------------------------------- /extern/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define GLFW_INVALID_CODEPOINT 0xffffffffu 28 | 29 | uint32_t _glfwKeySym2Unicode(unsigned int keysym); 30 | 31 | -------------------------------------------------------------------------------- /extern/glfw/version.txt: -------------------------------------------------------------------------------- 1 | glfw-3.3.8 -------------------------------------------------------------------------------- /extern/happly/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Nick Sharp 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /extern/imgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(IMGUI_HEADERS 2 | imconfig.h 3 | imgui.h 4 | imgui_internal.h 5 | imstb_rectpack.h 6 | imstb_textedit.h 7 | imstb_truetype.h 8 | 9 | backends/imgui_impl_glfw.h 10 | backends/imgui_impl_opengl3.h 11 | backends/imgui_impl_opengl3_loader.h 12 | ) 13 | 14 | set(IMGUI_SOURCES 15 | imgui.cpp 16 | imgui_demo.cpp # useful examples of how to use imgui 17 | imgui_draw.cpp 18 | imgui_tables.cpp 19 | imgui_widgets.cpp 20 | 21 | backends/imgui_impl_glfw.cpp 22 | backends/imgui_impl_opengl3.cpp 23 | ) 24 | 25 | add_library(imgui 26 | ${IMGUI_HEADERS} 27 | ${IMGUI_SOURCES} 28 | ) 29 | 30 | target_compile_definitions(imgui PUBLIC -DIMGUI_IMPL_OPENGL_LOADER_GLAD) 31 | 32 | add_dependencies(imgui glfw) 33 | target_link_libraries(imgui PUBLIC glfw) 34 | 35 | target_include_directories(glfw PUBLIC ${CMAKE_CURRENT_LIST_DIR}) 36 | set_target_properties(imgui PROPERTIES FOLDER "External Dependencies") 37 | set_target_properties(imgui PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 38 | set_target_properties(imgui PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 39 | set_target_properties(imgui PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 40 | 41 | -------------------------------------------------------------------------------- /extern/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2022 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /extern/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /extern/md5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(MD5 STATIC 2 | md5.cpp 3 | md5.h 4 | ) 5 | 6 | set_target_properties(MD5 PROPERTIES FOLDER "External Dependencies") 7 | set_target_properties(MD5 PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 8 | set_target_properties(MD5 PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 9 | set_target_properties(MD5 PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 10 | -------------------------------------------------------------------------------- /extern/nfd/LICENSE: -------------------------------------------------------------------------------- 1 | This software is provided 'as-is', without any express or implied 2 | warranty. In no event will the authors be held liable for any damages 3 | arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any purpose, 6 | including commercial applications, and to alter it and redistribute it 7 | freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not 10 | claim that you wrote the original software. If you use this software 11 | in a product, an acknowledgment in the product documentation would be 12 | appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be 14 | misrepresented as being the original software. 15 | 3. This notice may not be removed or altered from any source distribution. 16 | 17 | -------------------------------------------------------------------------------- /extern/pybind/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include pybind11/include/pybind11 *.h 2 | recursive-include pybind11 *.py 3 | recursive-include pybind11 py.typed 4 | include pybind11/share/cmake/pybind11/*.cmake 5 | include LICENSE README.rst pyproject.toml setup.py setup.cfg 6 | -------------------------------------------------------------------------------- /extern/pybind/include/pybind11/common.h: -------------------------------------------------------------------------------- 1 | #include "detail/common.h" 2 | #warning "Including 'common.h' is deprecated. It will be removed in v3.0. Use 'pybind11.h'." 3 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if sys.version_info < (3, 6): 4 | msg = "pybind11 does not support Python < 3.6. 2.9 was the last release supporting Python 2.7 and 3.5." 5 | raise ImportError(msg) 6 | 7 | 8 | from ._version import __version__, version_info 9 | from .commands import get_cmake_dir, get_include, get_pkgconfig_dir 10 | 11 | __all__ = ( 12 | "version_info", 13 | "__version__", 14 | "get_include", 15 | "get_cmake_dir", 16 | "get_pkgconfig_dir", 17 | ) 18 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/_version.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | 4 | def _to_int(s: str) -> Union[int, str]: 5 | try: 6 | return int(s) 7 | except ValueError: 8 | return s 9 | 10 | 11 | __version__ = "2.10.1" 12 | version_info = tuple(_to_int(s) for s in __version__.split(".")) 13 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/commands.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | DIR = os.path.abspath(os.path.dirname(__file__)) 4 | 5 | 6 | def get_include(user: bool = False) -> str: # pylint: disable=unused-argument 7 | """ 8 | Return the path to the pybind11 include directory. The historical "user" 9 | argument is unused, and may be removed. 10 | """ 11 | installed_path = os.path.join(DIR, "include") 12 | source_path = os.path.join(os.path.dirname(DIR), "include") 13 | return installed_path if os.path.exists(installed_path) else source_path 14 | 15 | 16 | def get_cmake_dir() -> str: 17 | """ 18 | Return the path to the pybind11 CMake module directory. 19 | """ 20 | cmake_installed_path = os.path.join(DIR, "share", "cmake", "pybind11") 21 | if os.path.exists(cmake_installed_path): 22 | return cmake_installed_path 23 | 24 | msg = "pybind11 not installed, installation required to access the CMake files" 25 | raise ImportError(msg) 26 | 27 | 28 | def get_pkgconfig_dir() -> str: 29 | """ 30 | Return the path to the pybind11 pkgconfig directory. 31 | """ 32 | pkgconfig_installed_path = os.path.join(DIR, "share", "pkgconfig") 33 | if os.path.exists(pkgconfig_installed_path): 34 | return pkgconfig_installed_path 35 | 36 | msg = "pybind11 not installed, installation required to access the pkgconfig files" 37 | raise ImportError(msg) 38 | -------------------------------------------------------------------------------- /extern/pybind/pybind11/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/extern/pybind/pybind11/py.typed -------------------------------------------------------------------------------- /extern/pybind/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "cmake>=3.18", "ninja"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.check-manifest] 6 | ignore = [ 7 | "tests/**", 8 | "docs/**", 9 | "tools/**", 10 | "include/**", 11 | ".*", 12 | "pybind11/include/**", 13 | "pybind11/share/**", 14 | "CMakeLists.txt", 15 | "noxfile.py", 16 | ] 17 | 18 | [tool.isort] 19 | # Needs the compiled .so modules and env.py from tests 20 | known_first_party = "env,pybind11_cross_module_tests,pybind11_tests," 21 | # For black compatibility 22 | profile = "black" 23 | 24 | [tool.mypy] 25 | files = ["pybind11"] 26 | python_version = "3.6" 27 | strict = true 28 | show_error_codes = true 29 | enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] 30 | warn_unreachable = true 31 | 32 | [[tool.mypy.overrides]] 33 | module = ["ghapi.*", "setuptools.*"] 34 | ignore_missing_imports = true 35 | 36 | 37 | [tool.pytest.ini_options] 38 | minversion = "6.0" 39 | addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] 40 | xfail_strict = true 41 | filterwarnings = ["error"] 42 | log_cli_level = "info" 43 | testpaths = [ 44 | "tests", 45 | ] 46 | timeout=300 47 | 48 | 49 | [tool.pylint] 50 | master.py-version = "3.6" 51 | reports.output-format = "colorized" 52 | messages_control.disable = [ 53 | "design", 54 | "fixme", 55 | "imports", 56 | "line-too-long", 57 | "imports", 58 | "invalid-name", 59 | "protected-access", 60 | "missing-module-docstring", 61 | ] 62 | -------------------------------------------------------------------------------- /extern/pybind/tools/JoinPaths.cmake: -------------------------------------------------------------------------------- 1 | # This module provides function for joining paths 2 | # known from most languages 3 | # 4 | # SPDX-License-Identifier: (MIT OR CC0-1.0) 5 | # Copyright 2020 Jan Tojnar 6 | # https://github.com/jtojnar/cmake-snips 7 | # 8 | # Modelled after Python’s os.path.join 9 | # https://docs.python.org/3.7/library/os.path.html#os.path.join 10 | # Windows not supported 11 | function(join_paths joined_path first_path_segment) 12 | set(temp_path "${first_path_segment}") 13 | foreach(current_segment IN LISTS ARGN) 14 | if(NOT ("${current_segment}" STREQUAL "")) 15 | if(IS_ABSOLUTE "${current_segment}") 16 | set(temp_path "${current_segment}") 17 | else() 18 | set(temp_path "${temp_path}/${current_segment}") 19 | endif() 20 | endif() 21 | endforeach() 22 | set(${joined_path} "${temp_path}" PARENT_SCOPE) 23 | endfunction() 24 | -------------------------------------------------------------------------------- /extern/pybind/tools/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake 2 | 3 | if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 4 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") 5 | endif() 6 | 7 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 8 | string(REGEX REPLACE "\n" ";" files "${files}") 9 | foreach(file ${files}) 10 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 11 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program( 13 | "@CMAKE_COMMAND@" ARGS 14 | "-E remove \"$ENV{DESTDIR}${file}\"" 15 | OUTPUT_VARIABLE rm_out 16 | RETURN_VALUE rm_retval) 17 | if(NOT "${rm_retval}" STREQUAL 0) 18 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 19 | endif() 20 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 22 | endif() 23 | endforeach() 24 | -------------------------------------------------------------------------------- /extern/pybind/tools/codespell_ignore_lines_from_errors.py: -------------------------------------------------------------------------------- 1 | """Simple script for rebuilding .codespell-ignore-lines 2 | 3 | Usage: 4 | 5 | cat < /dev/null > .codespell-ignore-lines 6 | pre-commit run --all-files codespell >& /tmp/codespell_errors.txt 7 | python3 tools/codespell_ignore_lines_from_errors.py /tmp/codespell_errors.txt > .codespell-ignore-lines 8 | 9 | git diff to review changes, then commit, push. 10 | """ 11 | 12 | import sys 13 | from typing import List 14 | 15 | 16 | def run(args: List[str]) -> None: 17 | assert len(args) == 1, "codespell_errors.txt" 18 | cache = {} 19 | done = set() 20 | for line in sorted(open(args[0]).read().splitlines()): 21 | i = line.find(" ==> ") 22 | if i > 0: 23 | flds = line[:i].split(":") 24 | if len(flds) >= 2: 25 | filename, line_num = flds[:2] 26 | if filename not in cache: 27 | cache[filename] = open(filename).read().splitlines() 28 | supp = cache[filename][int(line_num) - 1] 29 | if supp not in done: 30 | print(supp) 31 | done.add(supp) 32 | 33 | 34 | if __name__ == "__main__": 35 | run(args=sys.argv[1:]) 36 | -------------------------------------------------------------------------------- /extern/pybind/tools/libsize.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | # Internal build script for generating debugging test .so size. 5 | # Usage: 6 | # python libsize.py file.so save.txt -- displays the size of file.so and, if save.txt exists, compares it to the 7 | # size in it, then overwrites save.txt with the new size for future runs. 8 | 9 | if len(sys.argv) != 3: 10 | sys.exit("Invalid arguments: usage: python libsize.py file.so save.txt") 11 | 12 | lib = sys.argv[1] 13 | save = sys.argv[2] 14 | 15 | if not os.path.exists(lib): 16 | sys.exit(f"Error: requested file ({lib}) does not exist") 17 | 18 | libsize = os.path.getsize(lib) 19 | 20 | print("------", os.path.basename(lib), "file size:", libsize, end="") 21 | 22 | if os.path.exists(save): 23 | with open(save) as sf: 24 | oldsize = int(sf.readline()) 25 | 26 | if oldsize > 0: 27 | change = libsize - oldsize 28 | if change == 0: 29 | print(" (no change)") 30 | else: 31 | print(f" (change of {change:+} bytes = {change / oldsize:+.2%})") 32 | else: 33 | print() 34 | 35 | with open(save, "w") as sf: 36 | sf.write(str(libsize)) 37 | -------------------------------------------------------------------------------- /extern/pybind/tools/pybind11.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix_for_pc_file@ 2 | includedir=@includedir_for_pc_file@ 3 | 4 | Name: @PROJECT_NAME@ 5 | Description: Seamless operability between C++11 and Python 6 | Version: @PROJECT_VERSION@ 7 | Cflags: -I${includedir} 8 | -------------------------------------------------------------------------------- /extern/pybind/tools/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /extern/pybind/tools/setup_main.py.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Setup script (in the sdist or in tools/setup_main.py in the repository) 4 | 5 | from setuptools import setup 6 | 7 | cmdclass = {} 8 | $extra_cmd 9 | 10 | setup( 11 | name="pybind11", 12 | version="$version", 13 | download_url='https://github.com/pybind/pybind11/tarball/v$version', 14 | packages=[ 15 | "pybind11", 16 | "pybind11.include.pybind11", 17 | "pybind11.include.pybind11.detail", 18 | "pybind11.include.pybind11.stl", 19 | "pybind11.share.cmake.pybind11", 20 | "pybind11.share.pkgconfig", 21 | ], 22 | package_data={ 23 | "pybind11": ["py.typed"], 24 | "pybind11.include.pybind11": ["*.h"], 25 | "pybind11.include.pybind11.detail": ["*.h"], 26 | "pybind11.include.pybind11.stl": ["*.h"], 27 | "pybind11.share.cmake.pybind11": ["*.cmake"], 28 | "pybind11.share.pkgconfig": ["*.pc"], 29 | }, 30 | extras_require={ 31 | "global": ["pybind11_global==$version"] 32 | }, 33 | entry_points={ 34 | "console_scripts": [ 35 | "pybind11-config = pybind11.__main__:main", 36 | ], 37 | "pipx.run": [ 38 | "pybind11 = pybind11.__main__:main", 39 | ] 40 | }, 41 | cmdclass=cmdclass 42 | ) 43 | -------------------------------------------------------------------------------- /extern/pybind/version.txt: -------------------------------------------------------------------------------- 1 | 2.10.1 -------------------------------------------------------------------------------- /extern/tinyexpr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(tinyexpr STATIC 2 | tinyexpr.c 3 | tinyexpr.h 4 | ) 5 | 6 | set_target_properties(tinyexpr PROPERTIES FOLDER "External Dependencies") 7 | set_target_properties(tinyexpr PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) 8 | set_target_properties(tinyexpr PROPERTIES RELWITHDEBINFO_POSTFIX ${CMAKE_RELWITHDEBINFO_POSTFIX}) 9 | set_target_properties(tinyexpr PROPERTIES MINSIZEREL_POSTFIX ${CMAKE_MINSIZEREL_POSTFIX}) 10 | -------------------------------------------------------------------------------- /extern/tinyexpr/LICENSE: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (C) 2015, 2016 Lewis Van Winkle 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgement in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /extern/toojpeg/LICENSE: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (c) 2011-2016 Stephan Brumme 4 | 5 | This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. 6 | Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 7 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 8 | If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 9 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 10 | 3. This notice may not be removed or altered from any source distribution. 11 | -------------------------------------------------------------------------------- /extern/zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(zlib STATIC 2 | src/adler32.c 3 | src/compress.c 4 | src/crc32.c 5 | src/crc32.h 6 | src/deflate.c 7 | src/deflate.h 8 | src/gzio.c 9 | src/infback.c 10 | src/inffast.c 11 | src/inffast.h 12 | src/inffixed.h 13 | src/inflate.c 14 | src/inflate.h 15 | src/inftrees.c 16 | src/inftrees.h 17 | src/trees.c 18 | src/trees.h 19 | src/uncompr.c 20 | src/zconf.h 21 | src/zlib.h 22 | src/zutil.c 23 | src/zutil.h 24 | ) 25 | target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) 26 | set_target_properties(zlib PROPERTIES FOLDER "External Dependencies") 27 | -------------------------------------------------------------------------------- /extern/zlib/src/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/DragModule.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by sjeske on 1/22/20. 3 | // 4 | #include "common.h" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace py = pybind11; 13 | 14 | void DragModule(py::module m_sub) { 15 | // --------------------------------------- 16 | // Class Drag Base 17 | // --------------------------------------- 18 | py::class_(m_sub, "DragBase") 19 | .def_readwrite_static("DRAG_COEFFICIENT", &SPH::DragBase::DRAG_COEFFICIENT); 20 | 21 | // --------------------------------------- 22 | // Class Drag Force Gissler 23 | // --------------------------------------- 24 | py::class_(m_sub, "DragForce_Gissler2017") 25 | .def(py::init()); 26 | 27 | // --------------------------------------- 28 | // Class Drag Force Macklin 29 | // --------------------------------------- 30 | py::class_(m_sub, "DragForce_Macklin2014") 31 | .def(py::init()); 32 | } 33 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/Embedded.h: -------------------------------------------------------------------------------- 1 | #ifndef __Embedded_h__ 2 | #define __Embedded_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace SPH 10 | { 11 | class SimulatorBase; 12 | 13 | class Embedded 14 | { 15 | private: 16 | static Embedded *current; 17 | 18 | protected: 19 | pybind11::object m_mainScope; 20 | std::vector m_functions; 21 | 22 | void findFunctions(const std::string &moduleName); 23 | 24 | public: 25 | Embedded (); 26 | ~Embedded (); 27 | 28 | // Singleton 29 | static Embedded* getCurrent (); 30 | static void setCurrent (Embedded* tm); 31 | static bool hasCurrent(); 32 | 33 | 34 | std::string import_script(const std::string& fileName); 35 | void exec_script_str(const std::string& str); 36 | void exec_script_file(const std::string& fileName); 37 | void exec_fct(const std::string &moduleName, const std::string& fctName); 38 | void exec_init(const std::string& moduleName, SimulatorBase *base); 39 | 40 | const std::vector& getFunctions() const { return m_functions; } 41 | 42 | void reloadModule(const std::string &moduleName); 43 | void releaseModule(const std::string& moduleName); 44 | }; 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/ExporterModule.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | 9 | #include 10 | 11 | namespace py = pybind11; 12 | 13 | class pyExporterBase : public SPH::ExporterBase 14 | { 15 | using SPH::ExporterBase::ExporterBase; 16 | 17 | virtual void init(const std::string& outputPath) { PYBIND11_OVERRIDE(void, SPH::ExporterBase, init, outputPath); }; 18 | virtual void reset() { PYBIND11_OVERRIDE(void, SPH::ExporterBase, reset, ); }; 19 | virtual void step(const unsigned int frame) { PYBIND11_OVERRIDE_PURE(void, SPH::ExporterBase, step, frame); }; 20 | virtual void setActive(const bool active) { PYBIND11_OVERRIDE(void, SPH::ExporterBase, setActive, active); } 21 | }; 22 | 23 | void ExporterModule(py::module m_sub) { 24 | // --------------------------------------- 25 | // Exporter Base 26 | // --------------------------------------- 27 | py::class_(m_sub, "ExporterBase") 28 | .def(py::init()) 29 | .def("step", &SPH::ExporterBase::step) 30 | .def("reset", &SPH::ExporterBase::reset) 31 | .def("setActive", &SPH::ExporterBase::setActive) 32 | .def("getActive", &SPH::ExporterBase::getActive) 33 | .def("init", &SPH::ExporterBase::init); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/NonPressureForceBaseModule.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by sjeske on 1/22/20. 3 | // 4 | #include "common.h" 5 | 6 | #include 7 | 8 | #include 9 | 10 | namespace py = pybind11; 11 | 12 | void NonPressureForceBaseModule(py::module m_sub) { 13 | py::class_(m_sub, "NonPressureForceBase") 14 | .def("step", &SPH::NonPressureForceBase::step) 15 | .def("reset", &SPH::NonPressureForceBase::reset) 16 | .def("performNeighborhoodSearchSort", &SPH::NonPressureForceBase::performNeighborhoodSearchSort) 17 | .def("emittedParticles", &SPH::NonPressureForceBase::emittedParticles) 18 | .def("saveState", &SPH::NonPressureForceBase::saveState) 19 | .def("loadState", &SPH::NonPressureForceBase::loadState) 20 | .def("getModel", &SPH::NonPressureForceBase::getModel, py::return_value_policy::reference_internal) 21 | .def("init", &SPH::NonPressureForceBase::init); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/XSPHModule.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace py = pybind11; 9 | 10 | void XSPHModule(py::module m_sub) { 11 | // --------------------------------------- 12 | // XSPH 13 | // --------------------------------------- 14 | py::class_(m_sub, "XSPH") 15 | .def_readwrite_static("FLUID_COEFFICIENT", &SPH::XSPH::FLUID_COEFFICIENT) 16 | .def_readwrite_static("BOUNDARY_COEFFICIENT", &SPH::XSPH::BOUNDARY_COEFFICIENT) 17 | 18 | .def(py::init()); 19 | } -------------------------------------------------------------------------------- /pySPlisHSPlasH/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/pySPlisHSPlasH/__init__.py -------------------------------------------------------------------------------- /pySPlisHSPlasH/common.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by sjeske on 2/20/20. 3 | // 4 | 5 | #ifndef SPLISHSPLASH_COMMON_H 6 | #define SPLISHSPLASH_COMMON_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | PYBIND11_MAKE_OPAQUE(std::vector) 20 | PYBIND11_MAKE_OPAQUE(std::vector) 21 | PYBIND11_MAKE_OPAQUE(std::vector) 22 | PYBIND11_MAKE_OPAQUE(std::vector>) 23 | PYBIND11_MAKE_OPAQUE(std::vector>) 24 | PYBIND11_MAKE_OPAQUE(std::vector) 25 | PYBIND11_MAKE_OPAQUE(std::vector) 26 | PYBIND11_MAKE_OPAQUE(std::vector) 27 | PYBIND11_MAKE_OPAQUE(std::vector) 28 | PYBIND11_MAKE_OPAQUE(std::vector) 29 | PYBIND11_MAKE_OPAQUE(std::vector) 30 | PYBIND11_MAKE_OPAQUE(std::vector) 31 | PYBIND11_MAKE_OPAQUE(std::vector) 32 | PYBIND11_MAKE_OPAQUE(std::vector) 33 | 34 | #endif //SPLISHSPLASH_COMMON_H 35 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/examples/callbacks.py: -------------------------------------------------------------------------------- 1 | import pysplishsplash as sph 2 | 3 | def key_callback(): 4 | print("Hello World") 5 | 6 | def time_step_callback(): 7 | print("step") 8 | 9 | def main(): 10 | base = sph.Exec.SimulatorBase() 11 | base.init() 12 | gui = sph.GUI.Simulator_GUI_imgui(base) 13 | base.setGui(gui) 14 | 15 | # 75 -> 'k', 0 -> no modifier 16 | gui.addKeyFunc(75, 0 , key_callback) 17 | base.setTimeStepCB(time_step_callback) 18 | 19 | base.run() 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/examples/custom_scene.py: -------------------------------------------------------------------------------- 1 | import pysplishsplash as sph 2 | import pysplishsplash.Utilities.SceneLoaderStructs as Scenes 3 | 4 | 5 | def main(): 6 | # Set up the simulator 7 | base = sph.Exec.SimulatorBase() 8 | base.init(useGui=True, sceneFile=sph.Extras.Scenes.Empty) 9 | 10 | # Create an imgui simulator 11 | gui = sph.GUI.Simulator_GUI_imgui(base) 12 | base.setGui(gui) 13 | 14 | # Get the scene and add objects 15 | scene = sph.Exec.SceneConfiguration.getCurrent().getScene() 16 | 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])) 17 | scene.fluidBlocks.append(Scenes.FluidBlock(id='Fluid', boxMin = [-1.5, 0.0, -1.5], boxMax = [-0.5, 2.0, -0.5], mode=0, initialVelocity=[0.0, 0.0, 0.0])) 18 | scene.fluidBlocks.append(Scenes.FluidBlock(id='Fluid', boxMin = [0.5, 0.0, 0.5], boxMax = [1.5, 2.0, 1.5], mode=0, initialVelocity=[0.0, 0.0, 0.0])) 19 | 20 | # Run the GUI 21 | base.run() 22 | 23 | 24 | if __name__ == "__main__": 25 | main() 26 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/examples/minimal_gui.py: -------------------------------------------------------------------------------- 1 | import pysplishsplash as sph 2 | 3 | 4 | def main(): 5 | base = sph.Exec.SimulatorBase() 6 | base.init() 7 | gui = sph.GUI.Simulator_GUI_imgui(base) 8 | base.setGui(gui) 9 | base.run() 10 | 11 | 12 | if __name__ == "__main__": 13 | main() 14 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/examples/minimal_no_gui.py: -------------------------------------------------------------------------------- 1 | import pysplishsplash as sph 2 | 3 | 4 | def main(): 5 | base = sph.Exec.SimulatorBase() 6 | base.init(useGui=False) 7 | base.setValueFloat(base.STOP_AT, 10.0) # Important to have the dot to denote a float 8 | base.run() 9 | 10 | 11 | if __name__ == "__main__": 12 | main() 13 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/examples/plot.py: -------------------------------------------------------------------------------- 1 | # Note that for this example you have to install matplotlib by: 2 | # pip install matplotlib 3 | 4 | import pysplishsplash as sph 5 | import matplotlib.pyplot as plt 6 | import numpy as np 7 | 8 | counter = 0 9 | velocities = [] 10 | times = [] 11 | 12 | def time_step_callback(): 13 | global counter 14 | sim = sph.Simulation.getCurrent() 15 | tm = sph.TimeManager.getCurrent() 16 | fluid = sim.getFluidModel(0) 17 | 18 | # plot the norm of the velocity of particle 0 19 | v = np.array(fluid.getVelocity(0)) 20 | vn = np.linalg.norm(v) 21 | velocities.append(vn) 22 | times.append(tm.getTime()) 23 | 24 | if counter % 20 == 0: 25 | plt.plot(times, velocities, 'b') 26 | plt.draw() 27 | plt.pause(0.001) 28 | counter += 1 29 | 30 | def main(): 31 | plt.xlabel('time (s)') 32 | plt.ylabel('velocity (m/s)') 33 | plt.title('Example plot') 34 | plt.grid(True) 35 | plt.ion() 36 | plt.plot([0.0], [0.0], 'b') 37 | plt.draw() 38 | plt.pause(0.001) 39 | plt.show() 40 | 41 | base = sph.Exec.SimulatorBase() 42 | base.init() 43 | gui = sph.GUI.Simulator_GUI_imgui(base) 44 | base.setGui(gui) 45 | 46 | base.setTimeStepCB(time_step_callback) 47 | 48 | # init the simulation 49 | base.initSimulation() 50 | 51 | sim = sph.Simulation.getCurrent() 52 | sim.setValueBool(sim.ENABLE_Z_SORT, False) 53 | 54 | base.runSimulation() 55 | base.cleanup() 56 | 57 | if __name__ == "__main__": 58 | main() 59 | -------------------------------------------------------------------------------- /pySPlisHSPlasH/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InteractiveComputerGraphics/SPlisHSPlasH/e773d3e26655b32ab67a9ac7c48f6f2bf22f9429/pySPlisHSPlasH/scripts/__init__.py -------------------------------------------------------------------------------- /pySPlisHSPlasH/scripts/simulator.py: -------------------------------------------------------------------------------- 1 | import pysplishsplash as sph 2 | import sys 3 | import os 4 | import tkinter as tk 5 | from tkinter import filedialog 6 | 7 | 8 | def main(): 9 | base = sph.Exec.SimulatorBase() 10 | 11 | is_windows = sys.platform.startswith("win32") or sys.platform.startswith("cygwin") 12 | no_gui_flags = ["-h", "--help", "--no-gui", "-v", "--version"] 13 | if not any(flag in sys.argv for flag in no_gui_flags) and not is_windows: 14 | tk.Tk().withdraw() 15 | scene_dir = os.path.join(os.path.dirname(sys.executable), "data/Scenes/") 16 | scene_file = filedialog.askopenfilename(initialdir=scene_dir) 17 | base.init(sys.argv + [scene_file], "[Python] SPlisHSPlasH") 18 | else: 19 | base.init(sys.argv, "[Python] SPlisHSPlasH") 20 | 21 | gui = sph.GUI.Simulator_GUI_imgui(base) 22 | base.setGui(gui) 23 | 24 | base.run() 25 | 26 | 27 | if __name__ == "__main__": 28 | main() 29 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | dist-dir = build/dist 3 | 4 | [egg_info] 5 | egg_base = build/ -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 2.13.1 --------------------------------------------------------------------------------