MolSim
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Disc Class Reference

Class storing metadata about a Particle disc. More...

#include <Disc.h>

Inheritance diagram for Disc:
Cluster

Public Member Functions

 Disc (ParticleContainer &particles, const std::array< double, 3 > &x, int r, const std::array< double, 3 > &v, double h, double m, int type=TYPE_DEFAULT, double epsilon=EPSILON_DEFAULT, double sigma=SIGMA_DEFAULT)
 Constructs a new Disc object with all the needed metadata.
 
int getR () const
 Gets the radius \( r \) of this disc.
 
bool operator== (const Disc &other) const
 Overload of the equality operator for Cuboid objects.
 
bool operator!= (const Disc &other) const
 Overload of the inequality operator for Disc objects.
 
void initialize (size_t dimensions=2) override
 Main function of Disc class, initializes the particles based on the disc metadata in a grid and adds them to the given ParticleContainer.
 
std::string toString ()
 Returns a string representation of this Disc.
 
- 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.
 
ParticleContainergetParticles ()
 Gets the reference to the central ParticleContainer.
 
const ParticleContainergetParticles () const
 Gets the reference to the central ParticleContainer (const).
 

Private Member Functions

std::vector< std::array< double, 3 > > getCircleCoordinates (double centerX, double centerY, double radius, double distance)
 Helper function to get circle point (Particle) coordinates.
 

Private Attributes

int r
 Radius \( r \) of the disc in terms of number of particles.
 

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.
 
ParticleContainerparticles
 Reference to the ParticleContainer object from the Simulation.
 

Detailed Description

Class storing metadata about a Particle disc.

Constructor & Destructor Documentation

◆ Disc()

Disc::Disc ( ParticleContainer particles,
const std::array< double, 3 > &  x,
int  r,
const std::array< double, 3 > &  v,
double  h,
double  m,
int  type = TYPE_DEFAULT,
double  epsilon = EPSILON_DEFAULT,
double  sigma = SIGMA_DEFAULT 
)

Constructs a new Disc object with all the needed metadata.

Parameters
particlesA reference to the central ParticleContainer.
xA reference to the array containing data for the disc position \( x \).
rThe radius \( r \) of the disc.
vA reference to the array containing data for the starting speed \( v \) of the particles in the disc.
hThe distance \( h \) between the particles in the disc.
mThe mass \( m \) of the particles in the disc.
typeThe type of the particle.
epsilonThe Lennard-Jones parameter \( \epsilon \) of the particle.
sigmaThe Lennard-Jones parameter \( \sigma \) of the particle.

Member Function Documentation

◆ getCircleCoordinates()

std::vector< std::array< double, 3 > > Disc::getCircleCoordinates ( double  centerX,
double  centerY,
double  radius,
double  distance 
)
private

Helper function to get circle point (Particle) coordinates.

Parameters
centerXThe central X coordinate.
centerYThe central Y coordinate.
radiusThe radius of the circle.
distanceThe spacing between each point (Particle).
Returns
A vector containing the coordinate of each point (Particle).

◆ getR()

int Disc::getR ( ) const

Gets the radius \( r \) of this disc.

Returns
The radius of this disc.

◆ initialize()

void Disc::initialize ( size_t  dimensions = 2)
overridevirtual

Main function of Disc class, initializes the particles based on the disc metadata in a grid and adds them to the given ParticleContainer.

Implements Cluster.

◆ operator!=()

bool Disc::operator!= ( const Disc other) const

Overload of the inequality operator for Disc objects.

Parameters
otherA reference to the Disc object to compare the current object with.
Returns
true if both discs' have at least one differing attribute.
false if both discs' data (attributes) contain the same values.

◆ operator==()

bool Disc::operator== ( const Disc other) const

Overload of the equality operator for Cuboid objects.

Parameters
otherA reference to the Disc object to compare the current object with.
Returns
true if both discs' data (attributes) contain the same values.
false if both discs have at least one differing attribute.

◆ toString()

std::string Disc::toString ( )

Returns a string representation of this Disc.

Returns
The formatted Disc data as a std::string.

Member Data Documentation

◆ r

int Disc::r
private

Radius \( r \) of the disc in terms of number of particles.


The documentation for this class was generated from the following file: