SPH
|
Object holding information about single particle. More...
#include <Particle.h>
Classes | |
struct | ParamData |
Stored info about a material parameter. More... | |
class | ParamIterator |
class | ParamSequence |
Helper for enumerating all stored parameters. More... | |
struct | QuantityData |
Stored info about a quantity. More... | |
class | QuantityIterator |
Iterator used to enumerate all stored quantities. More... | |
class | QuantitySequence |
Helper for enumerating all stored quantities. More... | |
Public Member Functions | |
Particle ()=default | |
Default constructor, defined only for convenient usage in containers, etc. More... | |
Particle (const Size idx) | |
Constructs object given its index in parent storage, containing no particle data. More... | |
Particle (const Storage &storage, const Size idx) | |
Constructs the object from storage, storing values of all quantities for given particle. More... | |
Particle (const QuantityId id, const Dynamic &value, const Size idx) | |
Constructs a particle with information about a single quantity value. More... | |
Particle (const Particle &other) | |
Particle (Particle &&other) | |
Particle & | operator= (const Particle &other) |
Particle & | operator= (Particle &&other) |
Particle & | addValue (const QuantityId id, const Dynamic &value) |
Adds another quantity value or updates the value of quantity previously stored. More... | |
Particle & | addDt (const QuantityId id, const Dynamic &value) |
Adds another quantity derivative or updates the derivative of quantity previously stored. More... | |
Particle & | addD2t (const QuantityId id, const Dynamic &value) |
Adds another quantity 2nd derivative or updates the 2nd derivative of quantity previously stored. More... | |
Particle & | addParameter (const BodySettingsId id, const Dynamic &value) |
Adds another material parameter or updates the one stored previously. More... | |
INLINE Size | getIndex () const |
Returns the index of particle in the parent storage. More... | |
Dynamic | getValue (const QuantityId id) const |
Retrieves a quantity value of the particle. More... | |
Dynamic | getDt (const QuantityId id) const |
Retrieves a quantity derivative of the particle. More... | |
Dynamic | getD2t (const QuantityId id) const |
Retrieves a quantity 2nd derivative of the particle. More... | |
Dynamic | getParameter (const BodySettingsId id) const |
Retrieves a material parameter of the particle. More... | |
QuantitySequence | getQuantities () const |
Returns a range for enumerating all stored quantities. More... | |
ParamSequence | getParameters () const |
Returns a range for enumerating all stored parameters. More... | |
Friends | |
struct | ParticleVisitor |
Object holding information about single particle.
Particle can store all or some quantities of given particle. Unlike in Storage, the Particle does not hold information about orders of the stored quantities, and it is possible to store derivatives of quantities without having quantity values stored as well.
Definition at line 17 of file Particle.h.
|
default |
Default constructor, defined only for convenient usage in containers, etc.
Particle has to be initialized using copy/move operator.
|
inlineexplicit |
Constructs the object from storage, storing values of all quantities for given particle.
storage | Storage containing the particle |
idx | Index of the particle |
Definition at line 30 of file Particle.cpp.
Particle::Particle | ( | const QuantityId | id, |
const Dynamic & | value, | ||
const Size | idx | ||
) |
Constructs a particle with information about a single quantity value.
Other quantity data can be added using functions addValue, addDt and addD2t.
id | Quantity ID of the quantity value |
value | Quantity value. Cannot be used to add derivatives. |
idx | Index of particle; although this constructor is not necessarily bound to a particle storage, this represents index to storage associated with the particle. |
Definition at line 40 of file Particle.cpp.
Particle::Particle | ( | const Particle & | other | ) |
Definition at line 46 of file Particle.cpp.
Particle::Particle | ( | Particle && | other | ) |
Definition at line 50 of file Particle.cpp.
Particle & Particle::addD2t | ( | const QuantityId | id, |
const Dynamic & | value | ||
) |
Adds another quantity 2nd derivative or updates the 2nd derivative of quantity previously stored.
id | Quantity ID of the quantity value |
value | New 2nd derivative of given quantity |
Definition at line 84 of file Particle.cpp.
Particle & Particle::addDt | ( | const QuantityId | id, |
const Dynamic & | value | ||
) |
Adds another quantity derivative or updates the derivative of quantity previously stored.
id | Quantity ID of the quantity value |
value | New derivative of given quantity |
Definition at line 76 of file Particle.cpp.
Particle & Particle::addParameter | ( | const BodySettingsId | id, |
const Dynamic & | value | ||
) |
Adds another material parameter or updates the one stored previously.
id | ID of the material parameter |
value | Value of the material parameter |
Definition at line 92 of file Particle.cpp.
Particle & Particle::addValue | ( | const QuantityId | id, |
const Dynamic & | value | ||
) |
Adds another quantity value or updates the value of quantity previously stored.
id | Quantity ID of the quantity value |
value | New value of given quantity |
Definition at line 68 of file Particle.cpp.
Dynamic Particle::getD2t | ( | const QuantityId | id | ) | const |
Retrieves a quantity 2nd derivative of the particle.
If the particle doesn't hold 2nd derivative of quantity with given ID, returns unitialized (empty) value.
Definition at line 113 of file Particle.cpp.
Dynamic Particle::getDt | ( | const QuantityId | id | ) | const |
Retrieves a quantity derivative of the particle.
If the particle doesn't hold derivative of quantity with given ID, returns unitialized (empty) value.
Definition at line 107 of file Particle.cpp.
Returns the index of particle in the parent storage.
Definition at line 97 of file Particle.h.
Dynamic Particle::getParameter | ( | const BodySettingsId | id | ) | const |
Retrieves a material parameter of the particle.
If the particle doesn't hold the parameter with given ID, returns unitialized (empty) value.
Definition at line 119 of file Particle.cpp.
Particle::ParamSequence Particle::getParameters | ( | ) | const |
Returns a range for enumerating all stored parameters.
Definition at line 201 of file Particle.cpp.
Particle::QuantitySequence Particle::getQuantities | ( | ) | const |
Returns a range for enumerating all stored quantities.
Definition at line 167 of file Particle.cpp.
Dynamic Particle::getValue | ( | const QuantityId | id | ) | const |
Retrieves a quantity value of the particle.
If the particle doesn't hold value of quantity with given ID, returns unitialized (empty) value.
Definition at line 101 of file Particle.cpp.
Definition at line 54 of file Particle.cpp.
Definition at line 61 of file Particle.cpp.
|
friend |
Definition at line 18 of file Particle.h.