Jet
v1.3.3
|
3-D Particle-in-Cell (PIC) implementation. More...
#include <jet/pic_solver3.h>
Classes | |
class | Builder |
Front-end to create PicSolver3 objects step by step. More... | |
Public Member Functions | |
PicSolver3 () | |
Default constructor. More... | |
PicSolver3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin) | |
Constructs solver with initial grid size. More... | |
virtual | ~PicSolver3 () |
Default destructor. More... | |
ScalarGrid3Ptr | signedDistanceField () const |
Returns the signed-distance field of particles. More... | |
const ParticleSystemData3Ptr & | particleSystemData () const |
Returns the particle system data. More... | |
const ParticleEmitter3Ptr & | particleEmitter () const |
Returns the particle emitter. More... | |
void | setParticleEmitter (const ParticleEmitter3Ptr &newEmitter) |
Sets the particle emitter. More... | |
![]() | |
GridFluidSolver3 () | |
Default constructor. More... | |
GridFluidSolver3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin) | |
Constructs solver with initial grid size. More... | |
virtual | ~GridFluidSolver3 () |
Default destructor. More... | |
const Vector3D & | gravity () const |
Returns the gravity vector of the system. More... | |
void | setGravity (const Vector3D &newGravity) |
Sets the gravity of the system. More... | |
double | viscosityCoefficient () const |
Returns the viscosity coefficient. More... | |
void | setViscosityCoefficient (double newValue) |
Sets the viscosity coefficient. More... | |
double | cfl (double timeIntervalInSeconds) const |
Returns the CFL number from the current velocity field for given time interval. More... | |
double | maxCfl () const |
Returns the max allowed CFL number. More... | |
void | setMaxCfl (double newCfl) |
Sets the max allowed CFL number. More... | |
bool | useCompressedLinearSystem () const |
Returns true if the solver is using compressed linear system. More... | |
void | setUseCompressedLinearSystem (bool onoff) |
Sets whether the solver should use compressed linear system. More... | |
const AdvectionSolver3Ptr & | advectionSolver () const |
Returns the advection solver instance. More... | |
void | setAdvectionSolver (const AdvectionSolver3Ptr &newSolver) |
Sets the advection solver. More... | |
const GridDiffusionSolver3Ptr & | diffusionSolver () const |
Returns the diffusion solver instance. More... | |
void | setDiffusionSolver (const GridDiffusionSolver3Ptr &newSolver) |
Sets the diffusion solver. More... | |
const GridPressureSolver3Ptr & | pressureSolver () const |
Returns the pressure solver instance. More... | |
void | setPressureSolver (const GridPressureSolver3Ptr &newSolver) |
Sets the pressure solver. More... | |
int | closedDomainBoundaryFlag () const |
Returns the closed domain boundary flag. More... | |
void | setClosedDomainBoundaryFlag (int flag) |
Sets the closed domain boundary flag. More... | |
const GridSystemData3Ptr & | gridSystemData () const |
Returns the grid system data. More... | |
void | resizeGrid (const Size3 &newSize, const Vector3D &newGridSpacing, const Vector3D &newGridOrigin) |
Resizes grid system data. More... | |
Size3 | resolution () const |
Returns the resolution of the grid system data. More... | |
Vector3D | gridSpacing () const |
Returns the grid spacing of the grid system data. More... | |
Vector3D | gridOrigin () const |
Returns the origin of the grid system data. More... | |
const FaceCenteredGrid3Ptr & | velocity () const |
Returns the velocity field. More... | |
const Collider3Ptr & | collider () const |
Returns the collider. More... | |
void | setCollider (const Collider3Ptr &newCollider) |
Sets the collider. More... | |
const GridEmitter3Ptr & | emitter () const |
Returns the emitter. More... | |
void | setEmitter (const GridEmitter3Ptr &newEmitter) |
Sets the emitter. More... | |
![]() | |
PhysicsAnimation () | |
Default constructor. More... | |
virtual | ~PhysicsAnimation () |
Destructor. More... | |
bool | isUsingFixedSubTimeSteps () const |
Returns true if fixed sub-timestepping is used. More... | |
void | setIsUsingFixedSubTimeSteps (bool isUsing) |
Sets true if fixed sub-timestepping is used. More... | |
unsigned int | numberOfFixedSubTimeSteps () const |
Returns the number of fixed sub-timesteps. More... | |
void | setNumberOfFixedSubTimeSteps (unsigned int numberOfSteps) |
Sets the number of fixed sub-timesteps. More... | |
void | advanceSingleFrame () |
Advances a single frame. More... | |
Frame | currentFrame () const |
Returns current frame. More... | |
void | setCurrentFrame (const Frame &frame) |
Sets current frame cursor (but do not invoke update()). More... | |
double | currentTimeInSeconds () const |
Returns current time in seconds. More... | |
![]() | |
Animation () | |
virtual | ~Animation () |
void | update (const Frame &frame) |
Updates animation state for given frame . More... | |
Static Public Member Functions | |
static Builder | builder () |
Returns builder fox PicSolver3. More... | |
![]() | |
static Builder | builder () |
Returns builder fox GridFluidSolver3. More... | |
Protected Member Functions | |
void | onInitialize () override |
Initializes the simulator. More... | |
void | onBeginAdvanceTimeStep (double timeIntervalInSeconds) override |
Invoked before a simulation time-step begins. More... | |
void | computeAdvection (double timeIntervalInSeconds) override |
Computes the advection term of the fluid solver. More... | |
ScalarField3Ptr | fluidSdf () const override |
Returns the signed-distance field of the fluid. More... | |
virtual void | transferFromParticlesToGrids () |
Transfers velocity field from particles to grids. More... | |
virtual void | transferFromGridsToParticles () |
Transfers velocity field from grids to particles. More... | |
virtual void | moveParticles (double timeIntervalInSeconds) |
Moves particles. More... | |
![]() | |
void | onAdvanceTimeStep (double timeIntervalInSeconds) override |
Called when advancing a single time-step. More... | |
unsigned int | numberOfSubTimeSteps (double timeIntervalInSeconds) const override |
Returns the required sub-time-steps for given time interval. More... | |
virtual void | onEndAdvanceTimeStep (double timeIntervalInSeconds) |
Called at the end of a time-step. More... | |
virtual void | computeExternalForces (double timeIntervalInSeconds) |
Computes the external force terms. More... | |
virtual void | computeViscosity (double timeIntervalInSeconds) |
Computes the viscosity term using the diffusion solver. More... | |
virtual void | computePressure (double timeIntervalInSeconds) |
Computes the pressure term using the pressure solver. More... | |
void | computeGravity (double timeIntervalInSeconds) |
Computes the gravity term. More... | |
void | applyBoundaryCondition () |
Applies the boundary condition to the velocity field. More... | |
void | extrapolateIntoCollider (ScalarGrid3 *grid) |
Extrapolates given field into the collider-occupied region. More... | |
void | extrapolateIntoCollider (CollocatedVectorGrid3 *grid) |
Extrapolates given field into the collider-occupied region. More... | |
void | extrapolateIntoCollider (FaceCenteredGrid3 *grid) |
Extrapolates given field into the collider-occupied region. More... | |
ScalarField3Ptr | colliderSdf () const |
Returns the signed-distance field representation of the collider. More... | |
VectorField3Ptr | colliderVelocityField () const |
Returns the velocity field of the collider. More... | |
Protected Attributes | |
Array3< char > | _uMarkers |
Array3< char > | _vMarkers |
Array3< char > | _wMarkers |
3-D Particle-in-Cell (PIC) implementation.
This class implements 3-D Particle-in-Cell (PIC) method by inheriting GridFluidSolver3. Since it is a grid-particle hybrid method, the solver also has a particle system to track fluid particles.
jet::PicSolver3::PicSolver3 | ( | ) |
Default constructor.
jet::PicSolver3::PicSolver3 | ( | const Size3 & | resolution, |
const Vector3D & | gridSpacing, | ||
const Vector3D & | gridOrigin | ||
) |
Constructs solver with initial grid size.
|
virtual |
Default destructor.
|
static |
Returns builder fox PicSolver3.
|
overrideprotectedvirtual |
Computes the advection term of the fluid solver.
Reimplemented from jet::GridFluidSolver3.
|
overrideprotectedvirtual |
Returns the signed-distance field of the fluid.
Reimplemented from jet::GridFluidSolver3.
|
protectedvirtual |
Moves particles.
|
overrideprotectedvirtual |
Invoked before a simulation time-step begins.
Reimplemented from jet::GridFluidSolver3.
|
overrideprotectedvirtual |
Initializes the simulator.
Reimplemented from jet::GridFluidSolver3.
const ParticleEmitter3Ptr& jet::PicSolver3::particleEmitter | ( | ) | const |
Returns the particle emitter.
const ParticleSystemData3Ptr& jet::PicSolver3::particleSystemData | ( | ) | const |
Returns the particle system data.
void jet::PicSolver3::setParticleEmitter | ( | const ParticleEmitter3Ptr & | newEmitter | ) |
Sets the particle emitter.
ScalarGrid3Ptr jet::PicSolver3::signedDistanceField | ( | ) | const |
Returns the signed-distance field of particles.
|
protectedvirtual |
Transfers velocity field from grids to particles.
Reimplemented in jet::FlipSolver3, and jet::ApicSolver3.
|
protectedvirtual |
Transfers velocity field from particles to grids.
Reimplemented in jet::FlipSolver3, and jet::ApicSolver3.
|
protected |
|
protected |
|
protected |