APICSolver3.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_APIC_SOLVER3_HPP
12 #define CUBBYFLOW_APIC_SOLVER3_HPP
13 
15 
16 namespace CubbyFlow
17 {
27 class APICSolver3 : public PICSolver3
28 {
29  public:
30  class Builder;
31 
33  APICSolver3();
34 
36  APICSolver3(const Vector3UZ& resolution, const Vector3D& gridSpacing,
37  const Vector3D& gridOrigin);
38 
40  APICSolver3(const APICSolver3&) = delete;
41 
43  APICSolver3(APICSolver3&&) noexcept = delete;
44 
46  ~APICSolver3() override = default;
47 
49  APICSolver3& operator=(const APICSolver3&) = delete;
50 
52  APICSolver3& operator=(APICSolver3&&) noexcept = delete;
53 
55  [[nodiscard]] static Builder GetBuilder();
56 
57  protected:
59  void TransferFromParticlesToGrids() override;
60 
62  void TransferFromGridsToParticles() override;
63 
64  private:
65  Array1<Vector3D> m_cX;
66  Array1<Vector3D> m_cY;
67  Array1<Vector3D> m_cZ;
68 };
69 
71 using APICSolver3Ptr = std::shared_ptr<APICSolver3>;
72 
77 {
78  public:
80  [[nodiscard]] APICSolver3 Build() const;
81 
83  [[nodiscard]] APICSolver3Ptr MakeShared() const;
84 };
85 } // namespace CubbyFlow
86 
87 #endif
APICSolver3 & operator=(const APICSolver3 &)=delete
Deleted copy assignment operator.
static Builder GetBuilder()
Returns builder fox APICSolver3.
3-D Particle-in-Cell (PIC) implementation.
Definition: PICSolver3.hpp:30
~APICSolver3() override=default
Default virtual destructor.
Front-end to create APICSolver3 objects step by step.
Definition: APICSolver3.hpp:76
Base class for grid-based fluid solver builder.
Definition: GridFluidSolver3.hpp:315
Definition: Matrix.hpp:27
Definition: pybind11Utils.hpp:20
Definition: Array-Impl.hpp:19
APICSolver3()
Default constructor.
void TransferFromGridsToParticles() override
Transfers velocity field from grids to particles.
std::shared_ptr< APICSolver3 > APICSolver3Ptr
Shared pointer type for the APICSolver3.
Definition: APICSolver3.hpp:71
3-D Affine Particle-in-Cell (APIC) implementation
Definition: APICSolver3.hpp:27
void TransferFromParticlesToGrids() override
Transfers velocity field from particles to grids.