Molecular Dynamics Simulation
1.0
|
Class to spawn particles in a Sphere. Implements the interface ParticleSpawner. More...
#include <SphereSpawner.h>
Public Member Functions | |
SphereSpawner (const std::array< double, 3 > ¢er, int sphere_radius, double grid_spacing, double mass, const std::array< double, 3 > &initial_velocity, int type, double epsilon=1.0, double sigma=1.2, LockState lock_state=LockState::UNLOCKED, ThirdDimension third_dimension=ThirdDimension::ENABLED, double initial_temperature=0.1) | |
Constructor. More... | |
int | spawnParticles (std::vector< Particle > &particles) const override |
Spawns particles in the given container. More... | |
size_t | getEstimatedNumberOfParticles () const override |
Returns the number of particles to be spawned. More... | |
Private Attributes | |
const std::array< double, 3 > | center |
Defines the center of the sphere. More... | |
const int | sphere_radius |
Defines the radius of the sphere. More... | |
const double | grid_spacing |
Defines the spacing between neighboring particles in the sphere. More... | |
const double | mass |
Defines the mass of the particles in the sphere. More... | |
const int | type |
Defines the type of the particles in the sphere. More... | |
const double | espilon |
Defines the Lennard-Jones epsilon parameter of the particles in the sphere. More... | |
const double | sigma |
Defines the Lennard-Jones sigma parameter of the particles in the sphere. More... | |
const LockState | lock_state |
Defines whether the particles in the sphere are locked. More... | |
const std::array< double, 3 > | initial_velocity |
Defines the initial velocity of the particles in the sphere. More... | |
const double | initial_temperature |
Defines the initial temperature of the particles in the sphere. More... | |
const ThirdDimension | third_dimension |
Defines whether to use the third dimension. More... | |
Class to spawn particles in a Sphere. Implements the interface ParticleSpawner.
Implementation of the particle spawning in a cuboid. It is possible to specify the center of the sphere, the radius of the sphere, the spacing between neighboring particles, the mass of the particles, the initial velocity of the particles and the type of the particles.
The radius is given in terms of number of particles along the radius.
Definition at line 15 of file SphereSpawner.h.
SphereSpawner::SphereSpawner | ( | const std::array< double, 3 > & | center, |
int | sphere_radius, | ||
double | grid_spacing, | ||
double | mass, | ||
const std::array< double, 3 > & | initial_velocity, | ||
int | type, | ||
double | epsilon = 1.0 , |
||
double | sigma = 1.2 , |
||
LockState | lock_state = LockState::UNLOCKED , |
||
ThirdDimension | third_dimension = ThirdDimension::ENABLED , |
||
double | initial_temperature = 0.1 |
||
) |
Constructor.
center | Center of the sphere |
sphere_radius | Radius of the sphere [number of particles along the radius] |
grid_spacing | Spacing between neighboring particles |
mass | Mass of the particles |
initial_velocity | Initial velocity of the particles, the velocity is then jittered by a Maxwell-Boltzmann distribution |
type | Type of the particles in the cuboid |
epsilon | Lennard-Jones epsilon parameter of the particles in the cuboid |
sigma | Lennard-Jones sigma parameter of the particles in the cuboid |
lock_state | Whether the particles in the cuboid are locked |
third_dimension | Number of dimensions of the sphere |
initial_temperature | Inital temperature of the particles |
Constructor to initialize the cuboid spawner. The velocity of the particles is jittered by a Maxwell-Boltzmann distribution.
Definition at line 7 of file SphereSpawner.cpp.
|
overridevirtual |
Returns the number of particles to be spawned.
Returns the number of particles to be spawned.
Implements ParticleSpawner.
Definition at line 49 of file SphereSpawner.cpp.
|
overridevirtual |
Spawns particles in the given container.
particles | A vector of particles to spawn |
Implements ParticleSpawner.
Definition at line 22 of file SphereSpawner.cpp.
|
private |
Defines the center of the sphere.
Definition at line 20 of file SphereSpawner.h.
|
private |
Defines the Lennard-Jones epsilon parameter of the particles in the sphere.
Definition at line 45 of file SphereSpawner.h.
|
private |
Defines the spacing between neighboring particles in the sphere.
Definition at line 30 of file SphereSpawner.h.
|
private |
Defines the initial temperature of the particles in the sphere.
Definition at line 65 of file SphereSpawner.h.
|
private |
Defines the initial velocity of the particles in the sphere.
Definition at line 60 of file SphereSpawner.h.
|
private |
Defines whether the particles in the sphere are locked.
Definition at line 55 of file SphereSpawner.h.
|
private |
Defines the mass of the particles in the sphere.
Definition at line 35 of file SphereSpawner.h.
|
private |
Defines the Lennard-Jones sigma parameter of the particles in the sphere.
Definition at line 50 of file SphereSpawner.h.
|
private |
Defines the radius of the sphere.
Definition at line 25 of file SphereSpawner.h.
|
private |
Defines whether to use the third dimension.
Definition at line 70 of file SphereSpawner.h.
|
private |
Defines the type of the particles in the sphere.
Definition at line 40 of file SphereSpawner.h.