Loading...
Searching...
No Matches
ParticleSystemData.hpp
Go to the documentation of this file.
Definition Matrix.hpp:30
static std::enable_if_t< M==2, void > Serialize(const ParticleSystemData< 2 > &particles, flatbuffers::FlatBufferBuilder *builder, flatbuffers::Offset< fbs::ParticleSystemData2 > *fbsParticleSystemData)
void AddParticle(const Vector< double, N > &newPosition, const Vector< double, N > &newVelocity=Vector< double, N >(), const Vector< double, N > &newForce=Vector< double, N >())
Adds a particle to the data structure.
void Resize(size_t newNumberOfParticles)
Resizes the number of particles of the container.
void Set(const ParticleSystemData &other)
Copies from other particle system data.
ArrayView1< Vector< double, N > > Forces()
Returns the force array (mutable).
const std::shared_ptr< PointNeighborSearcher< N > > & NeighborSearcher() const
Returns neighbor searcher.
static std::enable_if_t< M==3, void > Serialize(const ParticleSystemData< 3 > &particles, flatbuffers::FlatBufferBuilder *builder, flatbuffers::Offset< fbs::ParticleSystemData3 > *fbsParticleSystemData)
void AddParticles(const ConstArrayView1< Vector< double, N > > &newPositions, const ConstArrayView1< Vector< double, N > > &newVelocities=ConstArrayView1< Vector< double, N > >(), const ConstArrayView1< Vector< double, N > > &newForces=ConstArrayView1< Vector< double, N > >())
Adds particles to the data structure.
ConstArrayView1< Vector< double, N > > Velocities() const
Returns the velocity array (immutable).
ConstArrayView1< Vector< double, N > > Positions() const
Returns the position array (immutable).
ParticleSystemData(const ParticleSystemData &other)
Copy constructor.
void SetNeighborSearcher(const std::shared_ptr< PointNeighborSearcher< N > > &newNeighborSearcher)
Sets neighbor searcher.
ParticleSystemData & operator=(const ParticleSystemData &other)
Copy assignment operator.
static std::enable_if_t< M==3, void > Deserialize(const fbs::ParticleSystemData3 *fbsParticleSystemData, ParticleSystemData< 3 > &particles)
void Deserialize(const std::vector< uint8_t > &buffer) override
Deserializes this particle system data from the buffer.
virtual void SetRadius(double newRadius)
Sets the radius of the particles.
ArrayView1< Vector< double, N > > VectorDataAt(size_t idx)
Returns custom vector data layer at given index (mutable).
virtual void SetMass(double newMass)
Sets the mass of the particles.
size_t AddVectorData(const Vector< double, N > &initialVal=Vector< double, N >{})
Adds a vector data layer and returns its index.
void Serialize(std::vector< uint8_t > *buffer) const override
Serializes this particle system data to the buffer.
ConstArrayView1< double > ScalarDataAt(size_t idx) const
Returns custom scalar data layer at given index (immutable).
const Array1< Array1< size_t > > & NeighborLists() const
Returns neighbor lists.
size_t AddScalarData(double initialVal=0.0)
Adds a scalar data layer and returns its index.
void BuildNeighborSearcher(double maxSearchRadius)
Builds neighbor searcher with given search radius.
ParticleSystemData(ParticleSystemData &&other) noexcept
Move constructor.
static std::enable_if_t< M==2, void > Deserialize(const fbs::ParticleSystemData2 *fbsParticleSystemData, ParticleSystemData< 2 > &particles)
size_t NumberOfParticles() const
Returns the number of particles.
ConstArrayView1< Vector< double, N > > VectorDataAt(size_t idx) const
Returns custom vector data layer at given index (immutable).
ArrayView1< Vector< double, N > > Velocities()
Returns the velocity array (mutable).
ArrayView1< Vector< double, N > > Positions()
Returns the position array (mutable).
ArrayView1< double > ScalarDataAt(size_t idx)
Returns custom scalar data layer at given index (mutable).
ParticleSystemData(size_t numberOfParticles)
Constructs particle system data with given number of particles.
~ParticleSystemData() override=default
Default virtual destructor.
ConstArrayView1< Vector< double, N > > Forces() const
Returns the force array (immutable).
ParticleSystemData & operator=(ParticleSystemData &&other) noexcept
Move assignment operator.
void BuildNeighborLists(double maxSearchRadius)
Builds neighbor lists with given search radius.
Abstract base class for any serializable class.
Definition Serialization.hpp:22
Definition pybind11Utils.hpp:21
std::shared_ptr< ParticleSystemData3 > ParticleSystemData3Ptr
Shared pointer type of ParticleSystemData3.
Definition ParticleSystemData.hpp:284
ParticleSystemData< 2 > ParticleSystemData2
2-D ParticleSystemData type.
Definition ParticleSystemData.hpp:275
ParticleSystemData< 3 > ParticleSystemData3
3-D ParticleSystemData type.
Definition ParticleSystemData.hpp:278
std::shared_ptr< ParticleSystemData2 > ParticleSystemData2Ptr
Shared pointer type of ParticleSystemData2.
Definition ParticleSystemData.hpp:281
1.9.8