GridFractionalBoundaryConditionSolver2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: GridFractionalBoundaryConditionSolver2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Fractional 2-D boundary condition solver for grids.
6 > Created Time: 2017/08/09
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_GRID_FRACTIONAL_BOUNDARY_CONDITION_SOLVER2_H
10 #define CUBBYFLOW_GRID_FRACTIONAL_BOUNDARY_CONDITION_SOLVER2_H
11 
15 
16 namespace CubbyFlow
17 {
27  {
28  public:
31 
34 
42  void ConstrainVelocity(
43  FaceCenteredGrid2* velocity,
44  unsigned int extrapolationDepth = 5) override;
45 
47  ScalarField2Ptr GetColliderSDF() const override;
48 
51 
52  protected:
54  void OnColliderUpdated(
55  const Size2& gridSize,
56  const Vector2D& gridSpacing,
57  const Vector2D& gridOrigin) override;
58 
59  private:
60  CellCenteredScalarGrid2Ptr m_colliderSDF;
61  CustomVectorField2Ptr m_colliderVel;
62  };
63 
65  using GridFractionalBoundaryConditionSolver2Ptr = std::shared_ptr<GridFractionalBoundaryConditionSolver2>;
66 }
67 
68 #endif
Abstract base class for 2-D boundary condition solver for grids.
Definition: GridBoundaryConditionSolver2.h:26
virtual ~GridFractionalBoundaryConditionSolver2()
Default destructor.
2-D point class.
Definition: Point2.h:25
std::shared_ptr< ScalarField2 > ScalarField2Ptr
Shared pointer for the ScalarField2 type.
Definition: ScalarField2.h:44
2-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid2.h:25
std::shared_ptr< GridFractionalBoundaryConditionSolver2 > GridFractionalBoundaryConditionSolver2Ptr
Shared pointer type for the GridFractionalBoundaryConditionSolver2.
Definition: GridFractionalBoundaryConditionSolver2.h:65
Fractional 2-D boundary condition solver for grids.
Definition: GridFractionalBoundaryConditionSolver2.h:26
Definition: pybind11Utils.h:24
void ConstrainVelocity(FaceCenteredGrid2 *velocity, unsigned int extrapolationDepth=5) override
std::shared_ptr< VectorField2 > VectorField2Ptr
Shared pointer for the VectorField2 type.
Definition: VectorField2.h:44
ScalarField2Ptr GetColliderSDF() const override
Returns the signed distance field of the collider.
std::shared_ptr< CellCenteredScalarGrid2 > CellCenteredScalarGrid2Ptr
Shared pointer for the CellCenteredScalarGrid2 type.
Definition: CellCenteredScalarGrid2.h:83
void OnColliderUpdated(const Size2 &gridSize, const Vector2D &gridSpacing, const Vector2D &gridOrigin) override
Invoked when a new collider is set.
2-D vector class.
Definition: Vector2.h:26
std::shared_ptr< CustomVectorField2 > CustomVectorField2Ptr
Shared pointer type for the CustomVectorField2.
Definition: CustomVectorField2.h:76
VectorField2Ptr GetColliderVelocityField() const override
Returns the velocity field of the collider.
GridFractionalBoundaryConditionSolver2()
Default constructor.