Loading...
Searching...
No Matches
PCISPHSolver2.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_SOLVER2_HPP
12#define CUBBYFLOW_PCISPH_SOLVER2_HPP
13
15
16namespace CubbyFlow
17{
28{
29 public:
30 class Builder;
31
34
39
41 PCISPHSolver2(const PCISPHSolver2&) = 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 ParticleSystemData2::VectorData m_tempPositions;
95 ParticleSystemData2::VectorData m_tempVelocities;
96 ParticleSystemData2::VectorData m_pressureForces;
97 ParticleSystemData2::ScalarData m_densityErrors;
98};
99
102
115} // namespace CubbyFlow
116
117#endif
Definition Matrix.hpp:30
Front-end to create PCISPHSolver2 objects step by step.
Definition PCISPHSolver2.hpp:107
PCISPHSolver2Ptr MakeShared() const
Builds shared pointer of PCISPHSolver2 instance.
PCISPHSolver2 Build() const
Builds PCISPHSolver2.
2-D PCISPH solver.
Definition PCISPHSolver2.hpp:28
static Builder GetBuilder()
Returns builder fox PCISPHSolver2.
PCISPHSolver2()
Constructs a solver with empty particle set.
PCISPHSolver2(double targetDensity, double targetSpacing, double relativeKernelRadius)
void OnBeginAdvanceTimeStep(double timeStepInSeconds) override
Performs pre-processing step before the simulation.
PCISPHSolver2(PCISPHSolver2 &&) noexcept=delete
Deleted move constructor.
void SetMaxDensityErrorRatio(double ratio)
Sets max allowed density error ratio.
PCISPHSolver2(const PCISPHSolver2 &)=delete
Deleted copy constructor.
void SetMaxNumberOfIterations(unsigned int n)
Sets max number of PCISPH iterations.
void AccumulatePressureForce(double timeIntervalInSeconds) override
unsigned int GetMaxNumberOfIterations() const
Returns max number of iterations.
double GetMaxDensityErrorRatio() const
Returns max allowed density error ratio.
N-D particle system data.
Definition ParticleSystemData.hpp:49
2-D SPH solver.
Definition SPHSolver2.hpp:33
Base class for SPH-based fluid solver builder.
Definition SPHSolver2.hpp:209
Definition pybind11Utils.hpp:21
std::shared_ptr< PCISPHSolver2 > PCISPHSolver2Ptr
Shared pointer type for the PCISPHSolver2.
Definition PCISPHSolver2.hpp:101
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738