Loading...
Searching...
No Matches
GridFluidSolver3.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 GridFluidSolver3 objects step by step.
Definition GridFluidSolver3.hpp:406
GridFluidSolver3Ptr MakeShared() const
Builds shared pointer of GridFluidSolver3 instance.
Definition GridFluidSolver3.hpp:412
Abstract base class for grid-based 3-D fluid solver.
Definition GridFluidSolver3.hpp:36
void ResizeGrid(const Vector3UZ &newSize, const Vector3D &newGridSpacing, const Vector3D &newGridOrigin) const
Resizes grid system data.
void SetUseCompressedLinearSystem(bool isOn)
Sets whether the solver should use compressed linear system.
virtual void ComputeExternalForces(double timeIntervalInSeconds)
Computes the external force terms.
void SetViscosityCoefficient(double newValue)
Sets the viscosity coefficient.
void SetClosedDomainBoundaryFlag(int flag)
Sets the closed domain boundary flag.
const AdvectionSolver3Ptr & GetAdvectionSolver() const
Returns the advection solver instance.
void ExtrapolateIntoCollider(ScalarGrid3 *grid)
Extrapolates given field into the collider-occupied region.
virtual void ComputeAdvection(double timeIntervalInSeconds)
Computes the advection term using the advection solver.
Vector3D GetGridSpacing() const
Returns the grid spacing of the grid system data.
virtual void ComputeViscosity(double timeIntervalInSeconds)
Computes the viscosity term using the diffusion solver.
virtual void OnBeginAdvanceTimeStep(double timeIntervalInSeconds)
Called at the beginning of a time-step.
virtual ScalarField3Ptr GetFluidSDF() const
Returns the signed-distance representation of the fluid.
double GetViscosityCoefficient() const
Returns the viscosity coefficient.
void OnInitialize() override
Called when it needs to setup initial condition.
GridFluidSolver3(const Vector3UZ &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
Constructs solver with initial grid size.
static Builder GetBuilder()
Returns builder fox GridFluidSolver3.
void SetCollider(const Collider3Ptr &newCollider)
Sets the collider.
const Collider3Ptr & GetCollider() const
Returns the collider.
double GetCFL(double timeIntervalInSeconds) const
Returns the CFL number from the current velocity field for given time interval.
void SetEmitter(const GridEmitter3Ptr &newEmitter)
Sets the emitter.
void ComputeGravity(double timeIntervalInSeconds)
Computes the gravity term.
void SetPressureSolver(const GridPressureSolver3Ptr &newSolver)
Sets the pressure solver.
GridFluidSolver3(GridFluidSolver3 &&) noexcept=delete
Deleted move constructor.
virtual void OnEndAdvanceTimeStep(double timeIntervalInSeconds)
Called at the end of a time-step.
ScalarField3Ptr GetColliderSDF() const
Returns the signed-distance field representation of the collider.
unsigned int GetNumberOfSubTimeSteps(double timeIntervalInSeconds) const override
Returns the required sub-time-steps for given time interval.
Vector3UZ GetResolution() const
Returns the resolution of the grid system data.
Vector3D GetGridOrigin() const
Returns the origin of the grid system data.
int GetClosedDomainBoundaryFlag() const
Returns the closed domain boundary flag.
GridFluidSolver3(const GridFluidSolver3 &)=delete
Deleted copy constructor.
const GridSystemData3Ptr & GetGridSystemData() const
Returns the grid system data.
void ApplyBoundaryCondition() const
Applies the boundary condition to the velocity field.
void SetGravity(const Vector3D &newGravity)
Sets the gravity of the system.
VectorField3Ptr GetColliderVelocityField() const
Returns the velocity field of the collider.
const Vector3D & GetGravity() const
Returns the gravity vector of the system.
const FaceCenteredGrid3Ptr & GetVelocity() const
Returns the velocity field.
const GridDiffusionSolver3Ptr & GetDiffusionSolver() const
Returns the diffusion solver instance.
virtual void ComputePressure(double timeIntervalInSeconds)
Computes the pressure term using the pressure solver.
void SetAdvectionSolver(const AdvectionSolver3Ptr &newSolver)
Sets the advection solver.
bool GetUseCompressedLinearSystem() const
Returns true if the solver is using compressed linear system.
const GridPressureSolver3Ptr & GetPressureSolver() const
Returns the pressure solver instance.
const GridEmitter3Ptr & GetEmitter() const
Returns the emitter.
void SetDiffusionSolver(const GridDiffusionSolver3Ptr &newSolver)
Sets the diffusion solver.
void OnAdvanceTimeStep(double timeIntervalInSeconds) override
Called when advancing a single time-step.
Base class for grid-based fluid solver builder.
Definition GridFluidSolver3.hpp:316
bool m_useDomainSize
Definition GridFluidSolver3.hpp:345
Vector3D m_gridOrigin
Definition GridFluidSolver3.hpp:343
DerivedBuilder & WithDomainSizeX(double domainSizeX)
Returns builder with domain size in x-direction.
Definition GridFluidSolver3.hpp:374
DerivedBuilder & WithResolution(const Vector3UZ &resolution)
Returns builder with grid resolution.
Definition GridFluidSolver3.hpp:349
double m_domainSizeX
Definition GridFluidSolver3.hpp:344
DerivedBuilder & WithGridSpacing(double gridSpacing)
Returns builder with grid spacing.
Definition GridFluidSolver3.hpp:364
Vector3D m_gridSpacing
Definition GridFluidSolver3.hpp:342
DerivedBuilder & WithOrigin(const Vector3D &gridOrigin)
Returns builder with grid origin.
Definition GridFluidSolver3.hpp:382
Vector3D GetGridSpacing() const
Definition GridFluidSolver3.hpp:389
DerivedBuilder & WithGridSpacing(const Vector3D &gridSpacing)
Returns builder with grid spacing.
Definition GridFluidSolver3.hpp:356
Vector3UZ m_resolution
Definition GridFluidSolver3.hpp:341
Definition Matrix.hpp:30
Abstract base class for physics-based animation.
Definition PhysicsAnimation.hpp:25
Definition pybind11Utils.hpp:21
std::shared_ptr< GridEmitter3 > GridEmitter3Ptr
Shared pointer type for the GridEmitter3.
Definition GridEmitter3.hpp:87
std::shared_ptr< GridDiffusionSolver3 > GridDiffusionSolver3Ptr
Shared pointer type for the GridDiffusionSolver3.
Definition GridDiffusionSolver3.hpp:108
std::shared_ptr< GridSystemData3 > GridSystemData3Ptr
Shared pointer type of GridSystemData3.
Definition GridSystemData.hpp:276
std::shared_ptr< GridFluidSolver3 > GridFluidSolver3Ptr
Shared pointer type for the GridFluidSolver3.
Definition GridFluidSolver3.hpp:309
std::shared_ptr< GridPressureSolver3 > GridPressureSolver3Ptr
Shared pointer type for the GridPressureSolver3.
Definition GridPressureSolver3.hpp:96
std::shared_ptr< Collider3 > Collider3Ptr
Shared pointer type for the Collider3.
Definition Collider.hpp:144
std::shared_ptr< ScalarField3 > ScalarField3Ptr
Shared pointer for the ScalarField3 type.
Definition ScalarField.hpp:70
std::shared_ptr< AdvectionSolver3 > AdvectionSolver3Ptr
Shared pointer type for the 3-D advection solver.
Definition AdvectionSolver3.hpp:125
std::shared_ptr< FaceCenteredGrid3 > FaceCenteredGrid3Ptr
Shared pointer type for the FaceCenteredGrid3.
Definition FaceCenteredGrid.hpp:437
std::shared_ptr< VectorField3 > VectorField3Ptr
Shared pointer for the VectorField3 type.
Definition VectorField.hpp:90
std::shared_ptr< GridBoundaryConditionSolver3 > GridBoundaryConditionSolver3Ptr
Shared pointer type for the GridBoundaryConditionSolver3.
Definition GridBoundaryConditionSolver3.hpp:117
1.9.8