Jet  v1.3.3
Public Member Functions | List of all members
jet::SphSystemData3 Class Reference

3-D SPH particle system data. More...

#include <jet/sph_system_data3.h>

Inheritance diagram for jet::SphSystemData3:
jet::ParticleSystemData3 jet::Serializable

Public Member Functions

 SphSystemData3 ()
 Constructs empty SPH system. More...
 
 SphSystemData3 (size_t numberOfParticles)
 Constructs SPH system data with given number of particles. More...
 
 SphSystemData3 (const SphSystemData3 &other)
 Copy constructor. More...
 
virtual ~SphSystemData3 ()
 Destructor. More...
 
void setRadius (double newRadius) override
 Sets the radius. More...
 
void setMass (double newMass) override
 Sets the mass of a particle. More...
 
ConstArrayAccessor1< double > densities () const
 Returns the density array accessor (immutable). More...
 
ArrayAccessor1< double > densities ()
 Returns the density array accessor (mutable). More...
 
ConstArrayAccessor1< double > pressures () const
 Returns the pressure array accessor (immutable). More...
 
ArrayAccessor1< double > pressures ()
 Returns the pressure array accessor (mutable). More...
 
void updateDensities ()
 Updates the density array with the latest particle positions. More...
 
void setTargetDensity (double targetDensity)
 Sets the target density of this particle system. More...
 
double targetDensity () const
 Returns the target density of this particle system. More...
 
void setTargetSpacing (double spacing)
 Sets the target particle spacing in meters. More...
 
double targetSpacing () const
 Returns the target particle spacing in meters. More...
 
void setRelativeKernelRadius (double relativeRadius)
 Sets the relative kernel radius. More...
 
void setKernelRadius (double kernelRadius)
 Sets the absolute kernel radius. More...
 
double relativeKernelRadius () const
 Returns the relative kernel radius. More...
 
double kernelRadius () const
 Returns the kernel radius in meters unit. More...
 
double sumOfKernelNearby (const Vector3D &position) const
 Returns sum of kernel function evaluation for each nearby particle. More...
 
double interpolate (const Vector3D &origin, const ConstArrayAccessor1< double > &values) const
 Returns interpolated value at given origin point. More...
 
Vector3D interpolate (const Vector3D &origin, const ConstArrayAccessor1< Vector3D > &values) const
 Returns interpolated vector value at given origin point. More...
 
Vector3D gradientAt (size_t i, const ConstArrayAccessor1< double > &values) const
 Returns the gradient of the given values at i-th particle. More...
 
double laplacianAt (size_t i, const ConstArrayAccessor1< double > &values) const
 Returns the laplacian of the given values at i-th particle. More...
 
Vector3D laplacianAt (size_t i, const ConstArrayAccessor1< Vector3D > &values) const
 Returns the laplacian of the given values at i-th particle. More...
 
void buildNeighborSearcher ()
 Builds neighbor searcher with kernel radius. More...
 
void buildNeighborLists ()
 Builds neighbor lists with kernel radius. More...
 
void serialize (std::vector< uint8_t > *buffer) const override
 Serializes this SPH system data to the buffer. More...
 
void deserialize (const std::vector< uint8_t > &buffer) override
 Deserializes this SPH system data from the buffer. More...
 
void set (const SphSystemData3 &other)
 Copies from other SPH system data. More...
 
SphSystemData3operator= (const SphSystemData3 &other)
 Copies from other SPH system data. More...
 
- Public Member Functions inherited from jet::ParticleSystemData3
 ParticleSystemData3 ()
 Default constructor. More...
 
 ParticleSystemData3 (size_t numberOfParticles)
 Constructs particle system data with given number of particles. More...
 
 ParticleSystemData3 (const ParticleSystemData3 &other)
 Copy constructor. More...
 
virtual ~ParticleSystemData3 ()
 Destructor. More...
 
void resize (size_t newNumberOfParticles)
 Resizes the number of particles of the container. More...
 
size_t numberOfParticles () const
 Returns the number of particles. More...
 
size_t addScalarData (double initialVal=0.0)
 Adds a scalar data layer and returns its index. More...
 
size_t addVectorData (const Vector3D &initialVal=Vector3D())
 Adds a vector data layer and returns its index. More...
 
double radius () const
 Returns the radius of the particles. More...
 
double mass () const
 Returns the mass of the particles. More...
 
ConstArrayAccessor1< Vector3Dpositions () const
 Returns the position array (immutable). More...
 
ArrayAccessor1< Vector3Dpositions ()
 Returns the position array (mutable). More...
 
ConstArrayAccessor1< Vector3Dvelocities () const
 Returns the velocity array (immutable). More...
 
ArrayAccessor1< Vector3Dvelocities ()
 Returns the velocity array (mutable). More...
 
ConstArrayAccessor1< Vector3Dforces () const
 Returns the force array (immutable). More...
 
ArrayAccessor1< Vector3Dforces ()
 Returns the force array (mutable). More...
 
ConstArrayAccessor1< double > scalarDataAt (size_t idx) const
 Returns custom scalar data layer at given index (immutable). More...
 
ArrayAccessor1< double > scalarDataAt (size_t idx)
 Returns custom scalar data layer at given index (mutable). More...
 
ConstArrayAccessor1< Vector3DvectorDataAt (size_t idx) const
 Returns custom vector data layer at given index (immutable). More...
 
ArrayAccessor1< Vector3DvectorDataAt (size_t idx)
 Returns custom vector data layer at given index (mutable). More...
 
void addParticle (const Vector3D &newPosition, const Vector3D &newVelocity=Vector3D(), const Vector3D &newForce=Vector3D())
 Adds a particle to the data structure. More...
 
void addParticles (const ConstArrayAccessor1< Vector3D > &newPositions, const ConstArrayAccessor1< Vector3D > &newVelocities=ConstArrayAccessor1< Vector3D >(), const ConstArrayAccessor1< Vector3D > &newForces=ConstArrayAccessor1< Vector3D >())
 Adds particles to the data structure. More...
 
const PointNeighborSearcher3PtrneighborSearcher () const
 Returns neighbor searcher. More...
 
void setNeighborSearcher (const PointNeighborSearcher3Ptr &newNeighborSearcher)
 Sets neighbor searcher. More...
 
const std::vector< std::vector< size_t > > & neighborLists () const
 Returns neighbor lists. More...
 
void buildNeighborSearcher (double maxSearchRadius)
 Builds neighbor searcher with given search radius. More...
 
void buildNeighborLists (double maxSearchRadius)
 Builds neighbor lists with given search radius. More...
 
void set (const ParticleSystemData3 &other)
 Copies from other particle system data. More...
 
ParticleSystemData3operator= (const ParticleSystemData3 &other)
 Copies from other particle system data. More...
 
- Public Member Functions inherited from jet::Serializable
 Serializable ()=default
 
virtual ~Serializable ()=default
 

Additional Inherited Members

- Public Types inherited from jet::ParticleSystemData3
typedef Array1< double > ScalarData
 Scalar data chunk. More...
 
typedef Array1< Vector3DVectorData
 Vector data chunk. More...
 
- Protected Member Functions inherited from jet::ParticleSystemData3
void serializeParticleSystemData (flatbuffers::FlatBufferBuilder *builder, flatbuffers::Offset< fbs::ParticleSystemData3 > *fbsParticleSystemData) const
 
void deserializeParticleSystemData (const fbs::ParticleSystemData3 *fbsParticleSystemData)
 

Detailed Description

3-D SPH particle system data.

This class extends ParticleSystemData3 to specialize the data model for SPH. It includes density and pressure array as a default particle attribute, and it also contains SPH utilities such as interpolation operator.

Constructor & Destructor Documentation

◆ SphSystemData3() [1/3]

jet::SphSystemData3::SphSystemData3 ( )

Constructs empty SPH system.

◆ SphSystemData3() [2/3]

jet::SphSystemData3::SphSystemData3 ( size_t  numberOfParticles)
explicit

Constructs SPH system data with given number of particles.

◆ SphSystemData3() [3/3]

jet::SphSystemData3::SphSystemData3 ( const SphSystemData3 other)

Copy constructor.

◆ ~SphSystemData3()

virtual jet::SphSystemData3::~SphSystemData3 ( )
virtual

Destructor.

Member Function Documentation

◆ buildNeighborLists()

void jet::SphSystemData3::buildNeighborLists ( )

Builds neighbor lists with kernel radius.

◆ buildNeighborSearcher()

void jet::SphSystemData3::buildNeighborSearcher ( )

Builds neighbor searcher with kernel radius.

◆ densities() [1/2]

ArrayAccessor1<double> jet::SphSystemData3::densities ( )

Returns the density array accessor (mutable).

◆ densities() [2/2]

ConstArrayAccessor1<double> jet::SphSystemData3::densities ( ) const

Returns the density array accessor (immutable).

◆ deserialize()

void jet::SphSystemData3::deserialize ( const std::vector< uint8_t > &  buffer)
overridevirtual

Deserializes this SPH system data from the buffer.

Reimplemented from jet::ParticleSystemData3.

◆ gradientAt()

Vector3D jet::SphSystemData3::gradientAt ( size_t  i,
const ConstArrayAccessor1< double > &  values 
) const

Returns the gradient of the given values at i-th particle.

◆ interpolate() [1/2]

double jet::SphSystemData3::interpolate ( const Vector3D origin,
const ConstArrayAccessor1< double > &  values 
) const

Returns interpolated value at given origin point.

Returns interpolated scalar data from the given position using standard SPH weighted average. The data array should match the particle layout. For example, density or pressure arrays can be used.

◆ interpolate() [2/2]

Vector3D jet::SphSystemData3::interpolate ( const Vector3D origin,
const ConstArrayAccessor1< Vector3D > &  values 
) const

Returns interpolated vector value at given origin point.

Returns interpolated vector data from the given position using standard SPH weighted average. The data array should match the particle layout. For example, velocity or acceleration arrays can be used.

◆ kernelRadius()

double jet::SphSystemData3::kernelRadius ( ) const

Returns the kernel radius in meters unit.

◆ laplacianAt() [1/2]

double jet::SphSystemData3::laplacianAt ( size_t  i,
const ConstArrayAccessor1< double > &  values 
) const

Returns the laplacian of the given values at i-th particle.

◆ laplacianAt() [2/2]

Vector3D jet::SphSystemData3::laplacianAt ( size_t  i,
const ConstArrayAccessor1< Vector3D > &  values 
) const

Returns the laplacian of the given values at i-th particle.

◆ operator=()

SphSystemData3& jet::SphSystemData3::operator= ( const SphSystemData3 other)

Copies from other SPH system data.

◆ pressures() [1/2]

ArrayAccessor1<double> jet::SphSystemData3::pressures ( )

Returns the pressure array accessor (mutable).

◆ pressures() [2/2]

ConstArrayAccessor1<double> jet::SphSystemData3::pressures ( ) const

Returns the pressure array accessor (immutable).

◆ relativeKernelRadius()

double jet::SphSystemData3::relativeKernelRadius ( ) const

Returns the relative kernel radius.

Returns the relative kernel radius compared to the target particle spacing (i.e. kernel radius / target spacing).

◆ serialize()

void jet::SphSystemData3::serialize ( std::vector< uint8_t > *  buffer) const
overridevirtual

Serializes this SPH system data to the buffer.

Reimplemented from jet::ParticleSystemData3.

◆ set()

void jet::SphSystemData3::set ( const SphSystemData3 other)

Copies from other SPH system data.

◆ setKernelRadius()

void jet::SphSystemData3::setKernelRadius ( double  kernelRadius)

Sets the absolute kernel radius.

Sets the absolute kernel radius compared to the target particle spacing (i.e. relative kernel radius * target spacing). Once this function is called, hash grid and density should be updated using updateHashGrid() and updateDensities).

◆ setMass()

void jet::SphSystemData3::setMass ( double  newMass)
overridevirtual

Sets the mass of a particle.

Setting the mass of a particle will change the target density.

Parameters
[in]newMassThe new mass.

Reimplemented from jet::ParticleSystemData3.

◆ setRadius()

void jet::SphSystemData3::setRadius ( double  newRadius)
overridevirtual

Sets the radius.

Sets the radius of the particle system. The radius will be interpreted as target spacing.

Reimplemented from jet::ParticleSystemData3.

◆ setRelativeKernelRadius()

void jet::SphSystemData3::setRelativeKernelRadius ( double  relativeRadius)

Sets the relative kernel radius.

Sets the relative kernel radius compared to the target particle spacing (i.e. kernel radius / target spacing). Once this function is called, hash grid and density should be updated using updateHashGrid() and updateDensities).

◆ setTargetDensity()

void jet::SphSystemData3::setTargetDensity ( double  targetDensity)

Sets the target density of this particle system.

◆ setTargetSpacing()

void jet::SphSystemData3::setTargetSpacing ( double  spacing)

Sets the target particle spacing in meters.

Once this function is called, hash grid and density should be updated using updateHashGrid() and updateDensities).

◆ sumOfKernelNearby()

double jet::SphSystemData3::sumOfKernelNearby ( const Vector3D position) const

Returns sum of kernel function evaluation for each nearby particle.

◆ targetDensity()

double jet::SphSystemData3::targetDensity ( ) const

Returns the target density of this particle system.

◆ targetSpacing()

double jet::SphSystemData3::targetSpacing ( ) const

Returns the target particle spacing in meters.

◆ updateDensities()

void jet::SphSystemData3::updateDensities ( )

Updates the density array with the latest particle positions.


The documentation for this class was generated from the following file: