Loading...
Searching...
No Matches
GridFluidSolver2.hpp
Go to the documentation of this file.
Abstract base class for N-D collocated vector grid structure.
Definition CollocatedVectorGrid.hpp:23
N-D face-centered (a.k.a MAC or staggered) grid.
Definition FaceCenteredGrid.hpp:32
Front-end to create GridFluidSolver2 objects step by step.
Definition GridFluidSolver2.hpp:405
GridFluidSolver2Ptr MakeShared() const
Builds shared pointer of GridFluidSolver2 instance.
Definition GridFluidSolver2.hpp:411
Abstract base class for grid-based 2-D fluid solver.
Definition GridFluidSolver2.hpp:36
void ResizeGrid(const Vector2UZ &newSize, const Vector2D &newGridSpacing, const Vector2D &newGridOrigin) const
Resizes grid system data.
void SetViscosityCoefficient(double newValue)
Sets the viscosity coefficient.
const GridPressureSolver2Ptr & GetPressureSolver() const
Returns the pressure solver instance.
int GetClosedDomainBoundaryFlag() const
Returns the closed domain boundary flag.
virtual void ComputeViscosity(double timeIntervalInSeconds)
Computes the viscosity term using the diffusion solver.
void ComputeGravity(double timeIntervalInSeconds)
Computes the gravity term.
Vector2D GetGridSpacing() const
Returns the grid spacing of the grid system data.
unsigned int GetNumberOfSubTimeSteps(double timeIntervalInSeconds) const override
Returns the required sub-time-steps for given time interval.
void ApplyBoundaryCondition() const
Applies the boundary condition to the velocity field.
const GridEmitter2Ptr & GetEmitter() const
Returns the emitter.
void SetUseCompressedLinearSystem(bool isOn)
Sets whether the solver should use compressed linear system.
const Vector2D & GetGravity() const
Returns the gravity vector of the system.
virtual void ComputePressure(double timeIntervalInSeconds)
Computes the pressure term using the pressure solver.
VectorField2Ptr GetColliderVelocityField() const
Returns the velocity field of the collider.
void OnInitialize() override
Called when it needs to setup initial condition.
void SetPressureSolver(const GridPressureSolver2Ptr &newSolver)
Sets the pressure solver.
void SetGravity(const Vector2D &newGravity)
Sets the gravity of the system.
const Collider2Ptr & GetCollider() const
Returns the collider.
bool GetUseCompressedLinearSystem() const
Returns true if the solver is using compressed linear system.
virtual ScalarField2Ptr GetFluidSDF() const
Returns the signed-distance representation of the fluid.
void ExtrapolateIntoCollider(ScalarGrid2 *grid)
Extrapolates given field into the collider-occupied region.
virtual void OnEndAdvanceTimeStep(double timeIntervalInSeconds)
Called at the end of a time-step.
Vector2D GetGridOrigin() const
Returns the origin of the grid system data.
void SetCollider(const Collider2Ptr &newCollider)
Sets the collider.
virtual void OnBeginAdvanceTimeStep(double timeIntervalInSeconds)
Called at the beginning of a time-step.
virtual void ComputeExternalForces(double timeIntervalInSeconds)
Computes the external force terms.
GridFluidSolver2(const GridFluidSolver2 &)=delete
Deleted copy constructor.
GridFluidSolver2(GridFluidSolver2 &&) noexcept=delete
Deleted move constructor.
double GetViscosityCoefficient() const
Returns the viscosity coefficient.
ScalarField2Ptr GetColliderSDF() const
Returns the signed-distance field representation of the collider.
static Builder GetBuilder()
Returns builder fox GridFluidSolver2.
double GetCFL(double timeIntervalInSeconds) const
Returns the CFL number from the current velocity field for given time interval.
Vector2UZ GetResolution() const
Returns the resolution of the grid system data.
void OnAdvanceTimeStep(double timeIntervalInSeconds) override
Called when advancing a single time-step.
const FaceCenteredGrid2Ptr & GetVelocity() const
Returns the velocity field.
virtual void ComputeAdvection(double timeIntervalInSeconds)
Computes the advection term using the advection solver.
const GridSystemData2Ptr & GetGridSystemData() const
Returns the grid system data.
const GridDiffusionSolver2Ptr & GetDiffusionSolver() const
Returns the diffusion solver instance.
void SetAdvectionSolver(const AdvectionSolver2Ptr &newSolver)
Sets the advection solver.
GridFluidSolver2(const Vector2UZ &resolution, const Vector2D &gridSpacing, const Vector2D &gridOrigin)
Constructs solver with initial grid size.
void SetDiffusionSolver(const GridDiffusionSolver2Ptr &newSolver)
Sets the diffusion solver.
void SetEmitter(const GridEmitter2Ptr &newEmitter)
Sets the emitter.
const AdvectionSolver2Ptr & GetAdvectionSolver() const
Returns the advection solver instance.
void SetClosedDomainBoundaryFlag(int flag)
Sets the closed domain boundary flag.
Base class for grid-based fluid solver builder.
Definition GridFluidSolver2.hpp:316
bool m_useDomainSize
Definition GridFluidSolver2.hpp:345
Vector2UZ m_resolution
Definition GridFluidSolver2.hpp:341
double m_domainSizeX
Definition GridFluidSolver2.hpp:344
DerivedBuilder & WithOrigin(const Vector2D &gridOrigin)
Returns builder with grid origin.
Definition GridFluidSolver2.hpp:381
DerivedBuilder & WithGridSpacing(double gridSpacing)
Returns builder with grid spacing.
Definition GridFluidSolver2.hpp:364
DerivedBuilder & WithGridSpacing(const Vector2D &gridSpacing)
Returns builder with grid spacing.
Definition GridFluidSolver2.hpp:356
DerivedBuilder & WithDomainSizeX(double domainSizeX)
Returns builder with domain size in x-direction.
Definition GridFluidSolver2.hpp:373
Vector2D m_gridOrigin
Definition GridFluidSolver2.hpp:343
DerivedBuilder & WithResolution(const Vector2UZ &resolution)
Returns builder with grid resolution.
Definition GridFluidSolver2.hpp:349
Vector2D m_gridSpacing
Definition GridFluidSolver2.hpp:342
Vector2D GetGridSpacing() const
Definition GridFluidSolver2.hpp:388
Definition Matrix.hpp:30
Abstract base class for physics-based animation.
Definition PhysicsAnimation.hpp:25
Definition pybind11Utils.hpp:21
std::shared_ptr< GridSystemData2 > GridSystemData2Ptr
Shared pointer type of GridSystemData2.
Definition GridSystemData.hpp:273
std::shared_ptr< Collider2 > Collider2Ptr
Shared pointer type for the Collider2.
Definition Collider.hpp:141
std::shared_ptr< GridFluidSolver2 > GridFluidSolver2Ptr
Shared pointer type for the GridFluidSolver2.
Definition GridFluidSolver2.hpp:309
std::shared_ptr< GridDiffusionSolver2 > GridDiffusionSolver2Ptr
Shared pointer type for the GridDiffusionSolver2.
Definition GridDiffusionSolver2.hpp:108
std::shared_ptr< ScalarField2 > ScalarField2Ptr
Shared pointer for the ScalarField2 type.
Definition ScalarField.hpp:67
std::shared_ptr< AdvectionSolver2 > AdvectionSolver2Ptr
Shared pointer type for the 2-D advection solver.
Definition AdvectionSolver2.hpp:125
std::shared_ptr< GridPressureSolver2 > GridPressureSolver2Ptr
Shared pointer type for the GridPressureSolver2.
Definition GridPressureSolver2.hpp:95
std::shared_ptr< VectorField2 > VectorField2Ptr
Shared pointer for the VectorField2 type.
Definition VectorField.hpp:87
std::shared_ptr< FaceCenteredGrid2 > FaceCenteredGrid2Ptr
Shared pointer type for the FaceCenteredGrid2.
Definition FaceCenteredGrid.hpp:434
std::shared_ptr< GridBoundaryConditionSolver2 > GridBoundaryConditionSolver2Ptr
Shared pointer type for the GridBoundaryConditionSolver2.
Definition GridBoundaryConditionSolver2.hpp:117
std::shared_ptr< GridEmitter2 > GridEmitter2Ptr
Shared pointer type for the GridEmitter2.
Definition GridEmitter2.hpp:87
1.9.8