Loading...
Searching...
No Matches
PCISPHSolver3.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_PCISPH_SOLVER3_HPP
12#define CUBBYFLOW_PCISPH_SOLVER3_HPP
13
15
16namespace CubbyFlow
17{
28{
29 public:
30 class Builder;
31
34
39
41 PCISPHSolver3(const PCISPHSolver3&) = delete;
42
45
48
51
54
57
65
68
74 void SetMaxNumberOfIterations(unsigned int n);
75
78
82 void AccumulatePressureForce(double timeIntervalInSeconds) override;
83
86
87 private:
88 [[nodiscard]] double ComputeDelta(double timeStepInSeconds) const;
89 [[nodiscard]] double ComputeBeta(double timeStepInSeconds) const;
90
91 double m_maxDensityErrorRatio = 0.01;
92 unsigned int m_maxNumberOfIterations = 5;
93
94 ParticleSystemData3::VectorData m_tempPositions;
95 ParticleSystemData3::VectorData m_tempVelocities;
96 ParticleSystemData3::VectorData m_pressureForces;
97 ParticleSystemData3::ScalarData m_densityErrors;
98};
99
102
115} // namespace CubbyFlow
116
117#endif
Definition Matrix.hpp:30
Front-end to create PCISPHSolver3 objects step by step.
Definition PCISPHSolver3.hpp:107
PCISPHSolver3Ptr MakeShared() const
Builds shared pointer of PCISPHSolver3 instance.
PCISPHSolver3 Build() const
Builds PCISPHSolver3.
3-D PCISPH solver.
Definition PCISPHSolver3.hpp:28
static Builder GetBuilder()
Returns builder fox PCISPHSolver3.
void AccumulatePressureForce(double timeIntervalInSeconds) override
PCISPHSolver3(PCISPHSolver3 &&) noexcept=delete
Deleted move constructor.
unsigned int GetMaxNumberOfIterations() const
Returns max number of iterations.
void SetMaxDensityErrorRatio(double ratio)
Sets max allowed density error ratio.
PCISPHSolver3(double targetDensity, double targetSpacing, double relativeKernelRadius)
void OnBeginAdvanceTimeStep(double timeStepInSeconds) override
Performs pre-processing step before the simulation.
double GetMaxDensityErrorRatio() const
Returns max allowed density error ratio.
PCISPHSolver3()
Constructs a solver with empty particle set.
void SetMaxNumberOfIterations(unsigned int n)
Sets max number of PCISPH iterations.
PCISPHSolver3(const PCISPHSolver3 &)=delete
Deleted copy constructor.
N-D particle system data.
Definition ParticleSystemData.hpp:49
3-D SPH solver.
Definition SPHSolver3.hpp:33
Base class for SPH-based fluid solver builder.
Definition SPHSolver3.hpp:209
Definition pybind11Utils.hpp:21
std::shared_ptr< PCISPHSolver3 > PCISPHSolver3Ptr
Shared pointer type for the PCISPHSolver3.
Definition PCISPHSolver3.hpp:101
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738