GridFractionalBoundaryConditionSolver3.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_GRID_FRACTIONAL_BOUNDARY_CONDITION_SOLVER3_HPP
12 #define CUBBYFLOW_GRID_FRACTIONAL_BOUNDARY_CONDITION_SOLVER3_HPP
13 
17 
18 namespace CubbyFlow
19 {
30 {
31  public:
34 
38 
41  GridFractionalBoundaryConditionSolver3&&) noexcept = delete;
42 
44  ~GridFractionalBoundaryConditionSolver3() override = default;
45 
49 
52  GridFractionalBoundaryConditionSolver3&&) noexcept = delete;
53 
61  void ConstrainVelocity(FaceCenteredGrid3* velocity,
62  unsigned int extrapolationDepth = 5) override;
63 
65  [[nodiscard]] ScalarField3Ptr GetColliderSDF() const override;
66 
68  [[nodiscard]] VectorField3Ptr GetColliderVelocityField() const override;
69 
70  protected:
72  void OnColliderUpdated(const Vector3UZ& gridSize,
73  const Vector3D& gridSpacing,
74  const Vector3D& gridOrigin) override;
75 
76  private:
77  CellCenteredScalarGrid3Ptr m_colliderSDF;
78  CustomVectorField3Ptr m_colliderVel;
79 };
80 
83  std::shared_ptr<GridFractionalBoundaryConditionSolver3>;
84 } // namespace CubbyFlow
85 
86 #endif
std::shared_ptr< CustomVectorField3 > CustomVectorField3Ptr
Shared pointer type for the CustomVectorField3.
Definition: CustomVectorField.hpp:96
std::shared_ptr< CellCenteredScalarGrid3 > CellCenteredScalarGrid3Ptr
Shared pointer for the CellCenteredScalarGrid3 type.
Definition: CellCenteredScalarGrid.hpp:106
std::shared_ptr< GridFractionalBoundaryConditionSolver3 > GridFractionalBoundaryConditionSolver3Ptr
Shared pointer type for the GridFractionalBoundaryConditionSolver3.
Definition: GridFractionalBoundaryConditionSolver3.hpp:83
Fractional 3-D boundary condition solver for grids.
Definition: GridFractionalBoundaryConditionSolver3.hpp:28
std::shared_ptr< ScalarField3 > ScalarField3Ptr
Shared pointer for the ScalarField3 type.
Definition: ScalarField.hpp:70
GridFractionalBoundaryConditionSolver3()=default
Default constructor.
ScalarField3Ptr GetColliderSDF() const override
Returns the signed distance field of the collider.
Abstract base class for 3-D boundary condition solver for grids.
Definition: GridBoundaryConditionSolver3.hpp:27
std::shared_ptr< VectorField3 > VectorField3Ptr
Shared pointer for the VectorField3 type.
Definition: VectorField.hpp:90
void OnColliderUpdated(const Vector3UZ &gridSize, const Vector3D &gridSpacing, const Vector3D &gridOrigin) override
Invoked when a new collider is set.
void ConstrainVelocity(FaceCenteredGrid3 *velocity, unsigned int extrapolationDepth=5) override
Definition: Matrix.hpp:27
Definition: pybind11Utils.hpp:20
VectorField3Ptr GetColliderVelocityField() const override
Returns the velocity field of the collider.
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
GridFractionalBoundaryConditionSolver3 & operator=(const GridFractionalBoundaryConditionSolver3 &)=delete
Deleted copy assignment operator.
~GridFractionalBoundaryConditionSolver3() override=default
Default virtual destructor.