APICSolver3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: APICSolver3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 3-D Affine Particle-in-Cell (APIC) implementation.
6 > Created Time: 2017/10/06
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_APIC_SOLVER3_H
10 #define CUBBYFLOW_APIC_SOLVER3_H
11 
13 
14 namespace CubbyFlow
15 {
25  class APICSolver3 : public PICSolver3
26  {
27  public:
28  class Builder;
29 
31  APICSolver3();
32 
35  const Size3& resolution,
36  const Vector3D& gridSpacing,
37  const Vector3D& gridOrigin);
38 
40  virtual ~APICSolver3();
41 
43  static Builder GetBuilder();
44 
45  protected:
47  void TransferFromParticlesToGrids() override;
48 
50  void TransferFromGridsToParticles() override;
51 
52  private:
53  Array1<Vector3D> m_cX;
54  Array1<Vector3D> m_cY;
55  Array1<Vector3D> m_cZ;
56  };
57 
59  using APICSolver3Ptr = std::shared_ptr<APICSolver3>;
60 
64  class APICSolver3::Builder final : public GridFluidSolverBuilderBase3<APICSolver3::Builder>
65  {
66  public:
68  APICSolver3 Build() const;
69 
71  APICSolver3Ptr MakeShared() const;
72  };
73 }
74 
75 #endif
3-D vector class.
Definition: Vector3.h:26
APICSolver3Ptr MakeShared() const
Builds shared pointer of APICSolver3 instance.
virtual ~APICSolver3()
Default destructor.
static Builder GetBuilder()
Returns builder fox APICSolver3.
3-D Particle-in-Cell (PIC) implementation.
Definition: PICSolver3.h:28
Front-end to create APICSolver3 objects step by step.
Definition: APICSolver3.h:64
3-D point class.
Definition: Point3.h:26
Base class for grid-based fluid solver builder.
Definition: GridFluidSolver3.h:303
1-D array class.
Definition: Array1.h:29
Definition: pybind11Utils.h:24
APICSolver3()
Default constructor.
void TransferFromGridsToParticles() override
Transfers velocity field from grids to particles.
APICSolver3 Build() const
Builds APICSolver3.
std::shared_ptr< APICSolver3 > APICSolver3Ptr
Shared pointer type for the APICSolver3.
Definition: APICSolver3.h:59
3-D Affine Particle-in-Cell (APIC) implementation
Definition: APICSolver3.h:25
void TransferFromParticlesToGrids() override
Transfers velocity field from particles to grids.