|
MolSim
|
Class for encapsulating multiple Particle objects.. More...
#include <ParticleContainer.h>
Classes | |
| class | PairIterator |
| Custom pair iterator for iterating through all possible pairs of Particle objects. More... | |
Public Member Functions | |
| ContainerType::iterator | begin () |
| Standard library iterator function for marking the beginning of the iteration process. | |
| ContainerType::iterator | end () |
| Standard library iterator function for marking the end of the iteration process. | |
| ContainerType::const_iterator | begin () const |
| Standard library iterator function for marking the beginning of the iteration process of a const ParticleContainer. | |
| ContainerType::const_iterator | end () const |
| Standard library iterator function for marking the end of the iteration process of a const ParticleContainer. | |
| Particle & | operator[] (size_t index) |
| Override of the [] operator. | |
| const Particle & | operator[] (size_t index) const |
| Override of the [] operator (const). | |
| PairIterator | beginPairs () |
| Function marking the beginning of the pair iteration process. | |
| PairIterator | endPairs () |
| Function marking the end of the pair iteration process. | |
| ParticleContainer () | |
| Constructs a ParticleContainer with an empty default-initialized ContainerType. | |
| ParticleContainer (size_t num_particles) | |
| Constructs a ParticleContainer with an empty ContainerType and reserves space for num_particle Particle entries. | |
| virtual | ~ParticleContainer () |
| Destroys the ParticleContainer object. | |
| void | addParticle (const Particle &particle) |
| Adds an already existing Particle to the container. | |
| void | addParticle (const std::array< double, 3 > &x, const std::array< double, 3 > &v, double m, int type=TYPE_DEFAULT, double eps=EPSILON_DEFAULT, double sigma=SIGMA_DEFAULT, double k=K_DEFAULT, double r_0=R0_DEFAULT, double fzup=FZUP_DEFAULT) |
| Creates and adds a new particle to the container. | |
| void | addParticle (const std::array< double, 3 > &x, const std::array< double, 3 > &v, const std::array< double, 3 > &f, const std::array< double, 3 > &old_f, double m, int type, double eps, double sigma, double k, double r_0, double fzup, int cellIndex) |
| Creates and adds a new complete particle to the container. | |
| void | reserve (size_t capacity) |
| Reserves a certain amount of spaces inside the Particle vector. | |
| Particle & | get (size_t index) |
| Gets a Particle by index. Performs bounds checking and terminates on invalid index. | |
| const Particle & | get (size_t index) const |
| Gets a const Particle by index. Performs bounds checking and terminates on invalid index. | |
| int | getSpecialForceLimit () const |
| Gets the number of iterations after which the special upward force will no longer be applied. | |
| void | setSpecialForceLimit (int limit) |
| Sets the number of iterations after which the special upward force will no longer be applied. | |
| void | decrementSpecialForceLimit () |
| Decrements the number of iterations after which the special upward force will no longer be applied by one. | |
| size_t | size () const |
| Returns the size of the container. | |
| size_t | activeSize () const |
| Returns the amount of active particles in the container. | |
| size_t | nonWallSize () const |
| Returns the amount of active, mobile, non-wall particles in the container. | |
| bool | isEmpty () const |
| Checks if the container is empty. | |
| ContainerType & | getParticles () |
| Gets a reference to the inner Particle container. | |
| bool | operator== (const ParticleContainer &other) const |
| Overload of the equality operator. Checks if two ParticleContainers have the same Particle objects. | |
| bool | operator!= (const ParticleContainer &other) const |
| Overload of the inequality operator. Checks if two ParticleContainers have the at least one differing Particle object or different sizes. | |
| std::string | toString () const |
| Returns a string representation of this container. | |
Private Types | |
| using | ContainerType = std::vector< Particle > |
| The chosen data type for storing Particle objects dynamically and contiguously is a std::vector. | |
Private Attributes | |
| ContainerType | m_particles |
| A ContainerType storing multiple Particle objects, forming the base of this class. | |
| int | m_specialForceLimit |
| The number of iterations after which the special upward force will no longer be applied, for membrane simulations. | |
Class for encapsulating multiple Particle objects..
|
private |
The chosen data type for storing Particle objects dynamically and contiguously is a std::vector.
| ParticleContainer::ParticleContainer | ( | ) |
Constructs a ParticleContainer with an empty default-initialized ContainerType.
|
explicit |
Constructs a ParticleContainer with an empty ContainerType and reserves space for num_particle Particle entries.
| num_particles | The amount of space to be reserved in the empty ContainerType. |
|
virtual |
Destroys the ParticleContainer object.
| size_t ParticleContainer::activeSize | ( | ) | const |
Returns the amount of active particles in the container.
| void ParticleContainer::addParticle | ( | const Particle & | particle | ) |
| void ParticleContainer::addParticle | ( | const std::array< double, 3 > & | x, |
| const std::array< double, 3 > & | v, | ||
| const std::array< double, 3 > & | f, | ||
| const std::array< double, 3 > & | old_f, | ||
| double | m, | ||
| int | type, | ||
| double | eps, | ||
| double | sigma, | ||
| double | k, | ||
| double | r_0, | ||
| double | fzup, | ||
| int | cellIndex | ||
| ) |
Creates and adds a new complete particle to the container.
| x | A reference to the array containing data for the position \( x \). |
| v | A reference to the array containing data for the velocity \( v \). |
| f | A reference to the array containing data for the force \( F \) effective on this particle. |
| old_f | A reference to the array containing data for the old force \( F \) effective on this particle. |
| m | The mass \( m \) of the particle. |
| type | The type of the particle. |
| eps | The Lennard-Jones parameter \( \epsilon \) of the particle. |
| sigma | The Lennard-Jones parameter \( \sigma \) of the particle. |
| k | The stiffness constant \( k \), used for membrane simulations. |
| r_0 | The average bond length \( r_0 \), used for membrane simulations. |
| fzup | The constant upward force \( F_{Z-UP} \), used for membrane simulations. |
| cellIndex | The index of this particle inside a cell. For use with the linked cell method. |
| void ParticleContainer::addParticle | ( | const std::array< double, 3 > & | x, |
| const std::array< double, 3 > & | v, | ||
| double | m, | ||
| int | type = TYPE_DEFAULT, |
||
| double | eps = EPSILON_DEFAULT, |
||
| double | sigma = SIGMA_DEFAULT, |
||
| double | k = K_DEFAULT, |
||
| double | r_0 = R0_DEFAULT, |
||
| double | fzup = FZUP_DEFAULT |
||
| ) |
Creates and adds a new particle to the container.
| x | The position of the new particle. |
| v | The velocity of the new particle. |
| m | The mass of the new particle. |
| type | The type of the new particle. |
| eps | The Lennard-Jones parameter \( \epsilon \) of the particle. |
| sigma | The Lennard-Jones parameter \( \sigma \) of the particle. |
| k | The stiffness constant \( k \), used for membrane simulations. |
| r_0 | The average bond length \( r_0 \), used for membrane simulations. |
| fzup | The constant upward force \( F_{Z-UP} \), used for membrane simulations. |
| ContainerType::iterator ParticleContainer::begin | ( | ) |
Standard library iterator function for marking the beginning of the iteration process.
| ContainerType::const_iterator ParticleContainer::begin | ( | ) | const |
Standard library iterator function for marking the beginning of the iteration process of a const ParticleContainer.
| PairIterator ParticleContainer::beginPairs | ( | ) |
Function marking the beginning of the pair iteration process.
| void ParticleContainer::decrementSpecialForceLimit | ( | ) |
Decrements the number of iterations after which the special upward force will no longer be applied by one.
| ContainerType::iterator ParticleContainer::end | ( | ) |
Standard library iterator function for marking the end of the iteration process.
| ContainerType::const_iterator ParticleContainer::end | ( | ) | const |
Standard library iterator function for marking the end of the iteration process of a const ParticleContainer.
| PairIterator ParticleContainer::endPairs | ( | ) |
Function marking the end of the pair iteration process.
| Particle & ParticleContainer::get | ( | size_t | index | ) |
| const Particle & ParticleContainer::get | ( | size_t | index | ) | const |
| ContainerType & ParticleContainer::getParticles | ( | ) |
Gets a reference to the inner Particle container.
| int ParticleContainer::getSpecialForceLimit | ( | ) | const |
Gets the number of iterations after which the special upward force will no longer be applied.
| bool ParticleContainer::isEmpty | ( | ) | const |
| size_t ParticleContainer::nonWallSize | ( | ) | const |
Returns the amount of active, mobile, non-wall particles in the container.
| bool ParticleContainer::operator!= | ( | const ParticleContainer & | other | ) | const |
Overload of the inequality operator. Checks if two ParticleContainers have the at least one differing Particle object or different sizes.
| other | The ParticleContainer to compare the current one with. |
| bool ParticleContainer::operator== | ( | const ParticleContainer & | other | ) | const |
Overload of the equality operator. Checks if two ParticleContainers have the same Particle objects.
| other | The ParticleContainer to compare the current one with. |
| Particle & ParticleContainer::operator[] | ( | size_t | index | ) |
| const Particle & ParticleContainer::operator[] | ( | size_t | index | ) | const |
| void ParticleContainer::reserve | ( | size_t | capacity | ) |
Reserves a certain amount of spaces inside the Particle vector.
| capacity | The amount of contiguous spaces to reserve in m_particles. |
| void ParticleContainer::setSpecialForceLimit | ( | int | limit | ) |
Sets the number of iterations after which the special upward force will no longer be applied.
| limit | The number of iterations after which the special upward force will no longer be applied. |
| size_t ParticleContainer::size | ( | ) | const |
Returns the size of the container.
| std::string ParticleContainer::toString | ( | ) | const |
Returns a string representation of this container.
|
private |
A ContainerType storing multiple Particle objects, forming the base of this class.
|
private |
The number of iterations after which the special upward force will no longer be applied, for membrane simulations.