Go to the documentation of this file.
7 #ifndef INCLUDE_JET_SPH_SYSTEM_DATA2_H_
8 #define INCLUDE_JET_SPH_SYSTEM_DATA2_H_
190 void serialize(std::vector<uint8_t>* buffer)
const override;
206 double _targetSpacing = 0.1;
210 double _kernelRadiusOverTargetSpacing = 1.8;
213 double _kernelRadius;
228 #endif // INCLUDE_JET_SPH_SYSTEM_DATA2_H_
Vector2D interpolate(const Vector2D &origin, const ConstArrayAccessor1< Vector2D > &values) const
Returns interpolated vector value at given origin point.
double targetDensity() const
Returns the target density of this particle system.
1-D read-only array accessor class.
Definition: array_accessor1.h:184
ConstArrayAccessor1< double > pressures() const
Returns the pressure array accessor (immutable).
void setRadius(double newRadius) override
Sets the radius.
void serialize(std::vector< uint8_t > *buffer) const override
Serializes this SPH system data to the buffer.
double kernelRadius() const
Returns the kernel radius in meters unit.
double interpolate(const Vector2D &origin, const ConstArrayAccessor1< double > &values) const
Returns interpolated value at given origin point.
void buildNeighborLists()
Builds neighbor lists with kernel radius.
virtual ~SphSystemData2()
Destructor.
void deserialize(const std::vector< uint8_t > &buffer) override
Deserializes this SPH system data from the buffer.
double laplacianAt(size_t i, const ConstArrayAccessor1< double > &values) const
2-D SPH particle system data.
Definition: sph_system_data2.h:23
ConstArrayAccessor1< double > densities() const
Returns the density array accessor (immutable).
ArrayAccessor1< double > pressures()
Returns the pressure array accessor (mutable).
void updateDensities()
Updates the density array with the latest particle positions.
Definition: advection_solver2.h:18
void setTargetSpacing(double spacing)
Sets the target particle spacing in meters.
ArrayAccessor1< double > densities()
Returns the density array accessor (mutable).
size_t numberOfParticles() const
Returns the number of particles.
SphSystemData2(size_t numberOfParticles)
Constructs SPH system data with given number of particles.
2-D vector class.
Definition: vector2.h:24
Vector2D gradientAt(size_t i, const ConstArrayAccessor1< double > &values) const
void setRelativeKernelRadius(double relativeRadius)
Sets the relative kernel radius.
void set(const SphSystemData2 &other)
Copies from other SPH system data.
SphSystemData2(const SphSystemData2 &other)
Copy constructor.
std::shared_ptr< SphSystemData2 > SphSystemData2Ptr
Shared pointer for the SphSystemData2 type.
Definition: sph_system_data2.h:224
void setKernelRadius(double kernelRadius)
Sets the absolute kernel radius.
double relativeKernelRadius() const
Returns the relative kernel radius.
double targetSpacing() const
Returns the target particle spacing in meters.
void setTargetDensity(double targetDensity)
Sets the target density of this particle system.
constexpr double kWaterDensity
Water density.
Definition: constants.h:304
double sumOfKernelNearby(const Vector2D &position) const
Returns sum of kernel function evaluation for each nearby particle.
void setMass(double newMass) override
Sets the mass of a particle.
SphSystemData2 & operator=(const SphSystemData2 &other)
Copies from other SPH system data.
Vector2D laplacianAt(size_t i, const ConstArrayAccessor1< Vector2D > &values) const
SphSystemData2()
Constructs empty SPH system.
1-D array accessor class.
Definition: array_accessor1.h:27
void buildNeighborSearcher()
Builds neighbor searcher with kernel radius.
2-D particle system data.
Definition: particle_system_data2.h:45