GCMC Simulation
A C++ and Python-based Monte Carlo simulation framework for interacting particles.
Loading...
Searching...
No Matches
SimulationBox Class Reference

Manages the 2D simulation box, including periodic boundary conditions. More...

#include <initial.h>

Public Member Functions

 SimulationBox (double Lx, double Ly)
 Constructs a SimulationBox with the given dimensions.
 
void applyPBC (Particle &p) const
 Applies periodic boundary conditions to a particle.
 
double minimumImageDistance (const Particle &p1, const Particle &p2) const
 Calculates the minimum image distance between two particles considering PBC.
 
double minimumImageDistanceSquared (const Particle &p1, const Particle &p2) const
 Calculates the minimum image distance squared between two particles considering PBC.
 
double getLx () const
 Gets the length of the simulation box in the x-direction.
 
double getLy () const
 Gets the length of the simulation box in the y-direction.
 
double getV () const
 Gets the simulation box volume.
 

Detailed Description

Manages the 2D simulation box, including periodic boundary conditions.

Constructor & Destructor Documentation

◆ SimulationBox()

SimulationBox::SimulationBox ( double Lx,
double Ly )

Constructs a SimulationBox with the given dimensions.

Parameters
LxLength of the simulation box in the x-direction.
LyLength of the simulation box in the y-direction.

Member Function Documentation

◆ applyPBC()

void SimulationBox::applyPBC ( Particle & p) const

Applies periodic boundary conditions to a particle.

Parameters
pThe particle to which PBC will be applied.

◆ getLx()

double SimulationBox::getLx ( ) const

Gets the length of the simulation box in the x-direction.

Returns
The length in the x-direction.

◆ getLy()

double SimulationBox::getLy ( ) const

Gets the length of the simulation box in the y-direction.

Returns
The length in the y-direction.

◆ getV()

double SimulationBox::getV ( ) const

Gets the simulation box volume.

Returns
The simulation box volume.

◆ minimumImageDistance()

double SimulationBox::minimumImageDistance ( const Particle & p1,
const Particle & p2 ) const

Calculates the minimum image distance between two particles considering PBC.

Parameters
p1The first particle.
p2The second particle.
Returns
The shortest distance between p1 and p2 under periodic boundary conditions.

◆ minimumImageDistanceSquared()

double SimulationBox::minimumImageDistanceSquared ( const Particle & p1,
const Particle & p2 ) const

Calculates the minimum image distance squared between two particles considering PBC.

Parameters
p1The first particle.
p2The second particle.
Returns
The shortest distance squared between p1 and p2 under periodic boundary conditions.

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