FLIPSolver3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: FLIPSolver3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 3-D Fluid-Implicit Particle (FLIP) implementation.
6 > Created Time: 2017/09/13
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_FLIP_SOLVER3_H
10 #define CUBBYFLOW_FLIP_SOLVER3_H
11 
13 
14 namespace CubbyFlow
15 {
27  class FLIPSolver3 : public PICSolver3
28  {
29  public:
30  class Builder;
31 
33  FLIPSolver3();
34 
37  const Size3& resolution,
38  const Vector3D& gridSpacing,
39  const Vector3D& gridOrigin);
40 
42  virtual ~FLIPSolver3();
43 
45  double GetPICBlendingFactor() const;
46 
57  void SetPICBlendingFactor(double factor);
58 
60  static Builder GetBuilder();
61 
62  protected:
64  void TransferFromParticlesToGrids() override;
65 
67  void TransferFromGridsToParticles() override;
68 
69  private:
70  double m_picBlendingFactor = 0.0;
71  Array3<float> m_uDelta;
72  Array3<float> m_vDelta;
73  Array3<float> m_wDelta;
74  };
75 
77  using FLIPSolver3Ptr = std::shared_ptr<FLIPSolver3>;
78 
82  class FLIPSolver3::Builder final : public GridFluidSolverBuilderBase3<FLIPSolver3::Builder>
83  {
84  public:
86  FLIPSolver3 Build() const;
87 
89  FLIPSolver3Ptr MakeShared() const;
90  };
91 }
92 
93 #endif
3-D vector class.
Definition: Vector3.h:26
double GetPICBlendingFactor() const
Returns the PIC blending factor.
FLIPSolver3()
Default constructor.
3-D Particle-in-Cell (PIC) implementation.
Definition: PICSolver3.h:28
FLIPSolver3 Build() const
Builds FLIPSolver3.
std::shared_ptr< FLIPSolver3 > FLIPSolver3Ptr
Shared pointer type for the FLIPSolver3.
Definition: FLIPSolver3.h:77
3-D point class.
Definition: Point3.h:26
Front-end to create FLIPSolver3 objects step by step.
Definition: FLIPSolver3.h:82
Base class for grid-based fluid solver builder.
Definition: GridFluidSolver3.h:303
void SetPICBlendingFactor(double factor)
Sets the PIC blending factor.
Definition: pybind11Utils.h:24
virtual ~FLIPSolver3()
Default destructor.
static Builder GetBuilder()
Returns builder fox FLIPSolver3.
void TransferFromParticlesToGrids() override
Transfers velocity field from particles to grids.
3-D array class.
Definition: Array3.h:45
void TransferFromGridsToParticles() override
Transfers velocity field from grids to particles.
3-D Fluid-Implicit Particle (FLIP) implementation.
Definition: FLIPSolver3.h:27
FLIPSolver3Ptr MakeShared() const
Builds shared pointer of FLIPSolver3 instance.