|
MolSim
|
Cuboid class storing meta-data about the given cuboids. More...
#include <Cuboid.h>
Public Member Functions | |
| Cuboid (ParticleContainer &particles, const std::array< double, 3 > &x, const std::array< size_t, 3 > &N, const std::array< double, 3 > &v, double h, double m, int type=TYPE_DEFAULT, double epsilon=EPSILON_DEFAULT, double sigma=SIGMA_DEFAULT, double k=K_DEFAULT, double r_0=R0_DEFAULT, double fzup=FZUP_DEFAULT) | |
| Constructs a new Cuboid object with all the needed meta-data. | |
| std::array< size_t, 3 > & | getN () |
| Gets the dimensions \( N \) of this cuboid. | |
| const std::array< size_t, 3 > & | getN () const |
| Gets the dimensions \( N \) of this cuboid (const). | |
| std::vector< std::array< int, 3 > > & | getSpecialCases () |
| Get the vector containing position indices for particles where the constant upward force should be applied. | |
| const std::vector< std::array< int, 3 > > & | getSpecialCases () const |
| Get the vector containing position indices for particles where the constant upward force should be applied (const). | |
| bool | operator== (const Cuboid &other) const |
| Overload of the equality operator for Cuboid objects. | |
| bool | operator!= (const Cuboid &other) const |
| Overload of the inequality operator for Cuboid objects. | |
| void | initialize (size_t dimensions=2) override |
| Main function of Cuboid class, initializes the particles based on the cuboid meta-data and adds them to the given ParticleContainer. | |
| void | initializeNeighbours () |
| Cuboid function for membranes, adds every particle's neighbours to the particle, based on the index in the ParticleContainer. | |
| bool | specialCase (int x, int y, int z) |
| Determines, whether Particle objects with the given coordinate indices should have a special upward force applied to them, for membrane simulations. | |
| std::string | toString () const |
| Returns a string representation of this Cuboid. | |
Public Member Functions inherited from Cluster | |
| Cluster (ParticleContainer &particles, const std::array< double, 3 > &x, const std::array< double, 3 > &v, double h, double m, int type, double epsilon, double sigma) | |
| Constructs a new Cluster. | |
| virtual | ~Cluster () |
| Destroys the current Cluster. | |
| std::array< double, 3 > & | getX () |
| Gets the position \( x \) of this Cluster. | |
| const std::array< double, 3 > & | getX () const |
| Gets the position \( x \) of this Cluster (const). | |
| double | getH () const |
| Gets the distance \( h \) between the particles of this Cluster. | |
| double | getM () const |
| Gets the mass \( m \) of the particles of this Cluster. | |
| std::array< double, 3 > & | getV () |
| Gets the starting velocity \( v \) of the particles of this Cluster. | |
| const std::array< double, 3 > & | getV () const |
| Gets the starting velocity \( v \) of the particles of this Cluster (const). | |
| double | getMeanVelocity () const |
| Gets the mean velocity for the Maxwell-Boltzmann distribution. | |
| ParticleContainer & | getParticles () |
| Gets the reference to the central ParticleContainer. | |
| const ParticleContainer & | getParticles () const |
| Gets the reference to the central ParticleContainer (const). | |
Private Attributes | |
| std::array< size_t, 3 > | N |
| 3D Dimensions \( N \) of the cuboid. | |
| double | k |
| The stiffness constant \( k \) for membrane simulations. | |
| double | r_0 |
| The average bond length \( r_0 \) for membrane simulations. | |
| double | fzup |
| The constant upward force \( F_{Z-UP} \) for membrane simulations. | |
| std::vector< std::array< int, 3 > > | specialCases |
| Vector containing position indices for particles where the constant upward force should be applied, for membrane simulations. | |
Additional Inherited Members | |
Protected Attributes inherited from Cluster | |
| std::array< double, 3 > | x |
| Starting coordinate \( x \) of the Cluster. | |
| double | h |
| Distance \( h \) between the particles in the Cluster. | |
| double | m |
| Mass \( m \) of the particles in the Cluster. | |
| int | type |
| Type of the particles in the Cluster. | |
| double | epsilon |
| Depth \( \epsilon \) of the potential well of the particles in the Cluster. | |
| double | sigma |
| Distance \( \sigma \) where the Lennard-Jones potential reaches zero of the particles in the Cluster. | |
| std::array< double, 3 > | v |
| Starting velocity \( v \) of the particles in the Cluster (before adding Maxwell-Boltzmann perturbations). | |
| double | mean_velocity |
| Mean velocity for the Maxwell-Boltzmann distribution. | |
| ParticleContainer & | particles |
| Reference to the ParticleContainer object from the Simulation. | |
Cuboid class storing meta-data about the given cuboids.
| Cuboid::Cuboid | ( | ParticleContainer & | particles, |
| const std::array< double, 3 > & | x, | ||
| const std::array< size_t, 3 > & | N, | ||
| const std::array< double, 3 > & | v, | ||
| double | h, | ||
| double | m, | ||
| int | type = TYPE_DEFAULT, |
||
| double | epsilon = EPSILON_DEFAULT, |
||
| double | sigma = SIGMA_DEFAULT, |
||
| double | k = K_DEFAULT, |
||
| double | r_0 = R0_DEFAULT, |
||
| double | fzup = FZUP_DEFAULT |
||
| ) |
Constructs a new Cuboid object with all the needed meta-data.
| particles | A reference to the central ParticleContainer. |
| x | A reference to the array containing data for the cuboid position \( x \). |
| N | A reference to the array containing data for the dimensions \( N \) of the cuboid. |
| v | A reference to the array containing data for the starting speed \( v \) of the particles in the cuboid. |
| h | The distance \( h \) between the particles in the cuboid. |
| m | The mass \( m \) of the particles in the cuboid. |
| type | The type of the particle. 1 if wall, 0 otherwise |
| epsilon | 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. |
| std::array< size_t, 3 > & Cuboid::getN | ( | ) |
Gets the dimensions \( N \) of this cuboid.
| const std::array< size_t, 3 > & Cuboid::getN | ( | ) | const |
Gets the dimensions \( N \) of this cuboid (const).
| std::vector< std::array< int, 3 > > & Cuboid::getSpecialCases | ( | ) |
Get the vector containing position indices for particles where the constant upward force should be applied.
| const std::vector< std::array< int, 3 > > & Cuboid::getSpecialCases | ( | ) | const |
Get the vector containing position indices for particles where the constant upward force should be applied (const).
|
overridevirtual |
Main function of Cuboid class, initializes the particles based on the cuboid meta-data and adds them to the given ParticleContainer.
| dimensions | The number of dimensions for which to perform the simulation. Must be either 1 or 2. |
Implements Cluster.
| void Cuboid::initializeNeighbours | ( | ) |
Cuboid function for membranes, adds every particle's neighbours to the particle, based on the index in the ParticleContainer.
| bool Cuboid::operator!= | ( | const Cuboid & | other | ) | const |
| bool Cuboid::operator== | ( | const Cuboid & | other | ) | const |
| bool Cuboid::specialCase | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) |
Determines, whether Particle objects with the given coordinate indices should have a special upward force applied to them, for membrane simulations.
Note that the parameters are NOT the coordinates themselves; rather, they are indices in the cuboid starting from the origin. This cross-references the entries in specialCases.
| x | The x-index. |
| y | The y-index. |
| z | The z-index. |
| std::string Cuboid::toString | ( | ) | const |
|
private |
The constant upward force \( F_{Z-UP} \) for membrane simulations.
|
private |
The stiffness constant \( k \) for membrane simulations.
|
private |
3D Dimensions \( N \) of the cuboid.
|
private |
The average bond length \( r_0 \) for membrane simulations.
|
private |
Vector containing position indices for particles where the constant upward force should be applied, for membrane simulations.