Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
ParticleGenerator Class Reference

Class for generating various particle structures. Currently only cuboids are supported. More...

#include <ParticleGenerator.h>

Collaboration diagram for ParticleGenerator:
Collaboration graph

Static Public Member Functions

static void generateCuboid (ParticleContainer &particles, const std::array< double, 3 > &position, unsigned N1, unsigned N2, unsigned N3, double h, double mass, const std::array< double, 3 > &initVelocity, int dimensions, double brownianMotionAverageVelocity, double epsilon=5, double sigma=1, bool fixed=false)
 Generate a cuboid structure. More...
 
static void generateDisc (ParticleContainer &particles, const std::array< double, 3 > &center, const std::array< double, 3 > &initVelocity, int N, double h, double mass, int dimensions, double brownianMotionAverageVelocity, double epsilon=5, double sigma=1, bool fixed=false)
 Generate a 2D disc structure. More...
 
static void generateSphere (ParticleContainer &particles, const std::array< double, 3 > &center, const std::array< double, 3 > &initVelocity, int N, double h, double mass, int dimensions, double brownianMotionAverageVelocity, double epsilon, double sigma, bool fixed=false)
 Generate a 3D sphere structure. More...
 
static void generateMembrane (ParticleContainer &particles, const std::array< double, 3 > &position, unsigned N1, unsigned N2, double h, double mass, const std::array< double, 3 > &initVelocity, bool isMarked(unsigned, unsigned), double epsilon=5, double sigma=1)
 Generate a 2D membrane. More...
 

Static Private Member Functions

static void generateDiscQuadrant (ParticleContainer &particles, const std::array< double, 3 > &corner, const std::array< double, 3 > &initVelocity, double h, double mass, int N, double r, int dimensions, double brownianMotionAverageVelocity, std::array< int, 4 > transformMatrix, double epsilon=5, double sigma=1, bool fixed=false)
 Helper method to generate one of four quadrants of an 2-dimensional disc structure. More...
 

Static Private Attributes

static int id = 1
 

Detailed Description

Class for generating various particle structures. Currently only cuboids are supported.

Member Function Documentation

◆ generateCuboid()

void ParticleGenerator::generateCuboid ( ParticleContainer particles,
const std::array< double, 3 > &  position,
unsigned  N1,
unsigned  N2,
unsigned  N3,
double  h,
double  mass,
const std::array< double, 3 > &  initVelocity,
int  dimensions,
double  brownianMotionAverageVelocity,
double  epsilon = 5,
double  sigma = 1,
bool  fixed = false 
)
static

Generate a cuboid structure.

Parameters
particlesParticle container to which the particle structure is added.
positionThe coordinates of the lower left front-side corner.
N1Number of particles in dimension N1.
N2Number of particles in dimension N2.
N3Number of particles in dimension N3.
hDistance of the particles (mesh width of the grid).
massMass of one particle.
initVelocityInitial velocity of the particles.
dimensionsSpecify in how many dimensions the Brownian Motion is applied. Valid values are 0, 1, 2, 3
brownianMotionAverageVelocityConstant, specifying the average velocity of the Brownian Motion.
epsilonLennard Jones force parameter epsilon.
sigmaLennard Jones force parameter sigma.
fixedFix particles.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateDisc()

void ParticleGenerator::generateDisc ( ParticleContainer particles,
const std::array< double, 3 > &  center,
const std::array< double, 3 > &  initVelocity,
int  N,
double  h,
double  mass,
int  dimensions,
double  brownianMotionAverageVelocity,
double  epsilon = 5,
double  sigma = 1,
bool  fixed = false 
)
static

Generate a 2D disc structure.

Parameters
particlesParticle container to which the particle structure is added.
centerThe coordinates of the center of the disc.
initVelocityInitial velocity of the particles.
NNumber of particles along the radius, including the particle in the center.
hDistance of the particles (mesh width of the grid).
massMass of one particle.
dimensionsSpecify in how many dimensions the Brownian Motion is applied. Valid values are 0, 1, 2, 3
brownianMotionAverageVelocityConstant, specifying the average velocity of the Brownian Motion.
epsilonLennard Jones force parameter epsilon.
sigmaLennard Jones force parameter sigma.
fixedFix particles.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateDiscQuadrant()

void ParticleGenerator::generateDiscQuadrant ( ParticleContainer particles,
const std::array< double, 3 > &  corner,
const std::array< double, 3 > &  initVelocity,
double  h,
double  mass,
int  N,
double  r,
int  dimensions,
double  brownianMotionAverageVelocity,
std::array< int, 4 >  transformMatrix,
double  epsilon = 5,
double  sigma = 1,
bool  fixed = false 
)
staticprivate

Helper method to generate one of four quadrants of an 2-dimensional disc structure.

Parameters
particlesParticle container to which the particle structure is added.
cornerThe coordinates of the corner of the quadrant.
initVelocityInitial velocity of the particles.
hDistance of the particles (mesh width of the grid).
massMass of one particle.
NNumber of particles along the radius, including the particle in the center.
rLength of the radius of the circle
dimensionsSpecify in how many dimensions the Brownian Motion is applied. Valid values are 0, 1, 2, 3
brownianMotionAverageVelocityConstant, specifying the average velocity of the Brownian Motion.
transformMatrixConsists of four parameters: [0]: main axis d1 (0 for x-axis, 1 for y-axis) [1]: support axis d2 (0 for x-axis, 1 for y-axis) [2]: direction along main axis d1 (0 for positive, 1 for negative) [3]: direction along support axis d2 (0 for positive, 1 for negative)
epsilonLennard Jones force parameter epsilon.
sigmaLennard Jones force parameter sigma.
fixedFix particles.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateMembrane()

void ParticleGenerator::generateMembrane ( ParticleContainer particles,
const std::array< double, 3 > &  position,
unsigned  N1,
unsigned  N2,
double  h,
double  mass,
const std::array< double, 3 > &  initVelocity,
bool   isMarkedunsigned, unsigned,
double  epsilon = 5,
double  sigma = 1 
)
static

Generate a 2D membrane.

Parameters
particlesParticle container to which the membrane is added.
positionThe coordinates of the lower left corner.
N1Number of particles along the x-axis.
N2Number of particles along the y-axis.
hDistance between the particles (mesh width of the membrane).
massMass of one particle.
initVelocityInitial velocity of the particles.
isMarkedFunction that determines, if a particle should be marked.
epsilonLennard Jones force parameter epsilon.
sigmaLennard Jones force parameter sigma.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateSphere()

void ParticleGenerator::generateSphere ( ParticleContainer particles,
const std::array< double, 3 > &  center,
const std::array< double, 3 > &  initVelocity,
int  N,
double  h,
double  mass,
int  dimensions,
double  brownianMotionAverageVelocity,
double  epsilon,
double  sigma,
bool  fixed = false 
)
static

Generate a 3D sphere structure.

Parameters
particlesParticle container to which the particle structure is added.
centerThe coordinates of the center of the sphere.
initVelocityInitial velocity of the the particles.
NNumber of particles along the radius, including the particle in the center.
hDistance of the particles (mesh width of the grid).
massMass of one particle.
dimensionsSpecify in how many dimensions the Brownian Motion is applied. Valid values are 0, 1, 2, 3
brownianMotionAverageVelocityConstant, specifying the average velocity of the Brownian Motion.
epsilonLennard Jones force parameter epsilon.
sigmaLennard Jones force parameter sigma.
fixedFix particles.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ id

int ParticleGenerator::id = 1
staticprivate

All particles being part of the same structure will be assigned the same id. This id is incremented by one for each structure that is created.


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