Molecular Dynamics Simulation  1.0
SphereSpawner.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "utils/Enums.h"
5 
16  private:
20  const std::array<double, 3> center;
21 
25  const int sphere_radius;
26 
30  const double grid_spacing;
31 
35  const double mass;
36 
40  const int type;
41 
45  const double espilon;
46 
50  const double sigma;
51 
56 
60  const std::array<double, 3> initial_velocity;
61 
65  const double initial_temperature;
66 
71 
72  public:
89  SphereSpawner(const std::array<double, 3>& center, int sphere_radius, double grid_spacing, double mass,
90  const std::array<double, 3>& initial_velocity, int type, double epsilon = 1.0, double sigma = 1.2,
92  double initial_temperature = 0.1);
93 
100  int spawnParticles(std::vector<Particle>& particles) const override;
101 
108  [[nodiscard]] size_t getEstimatedNumberOfParticles() const override;
109 };
ThirdDimension
Enum class to define the dimension count of the simulation (2D or 3D). Affects primarily the dimensio...
Definition: Enums.h:7
LockState
Enum class to define the lockstate of particles. Locked particles are not allowed to move.
Definition: Enums.h:12
Interface for particle spawner classes.
Class to spawn particles in a Sphere. Implements the interface ParticleSpawner.
Definition: SphereSpawner.h:15
const std::array< double, 3 > center
Defines the center of the sphere.
Definition: SphereSpawner.h:20
const double grid_spacing
Defines the spacing between neighboring particles in the sphere.
Definition: SphereSpawner.h:30
const double initial_temperature
Defines the initial temperature of the particles in the sphere.
Definition: SphereSpawner.h:65
const double espilon
Defines the Lennard-Jones epsilon parameter of the particles in the sphere.
Definition: SphereSpawner.h:45
const std::array< double, 3 > initial_velocity
Defines the initial velocity of the particles in the sphere.
Definition: SphereSpawner.h:60
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.
const int sphere_radius
Defines the radius of the sphere.
Definition: SphereSpawner.h:25
const LockState lock_state
Defines whether the particles in the sphere are locked.
Definition: SphereSpawner.h:55
const double mass
Defines the mass of the particles in the sphere.
Definition: SphereSpawner.h:35
const ThirdDimension third_dimension
Defines whether to use the third dimension.
Definition: SphereSpawner.h:70
const int type
Defines the type of the particles in the sphere.
Definition: SphereSpawner.h:40
const double sigma
Defines the Lennard-Jones sigma parameter of the particles in the sphere.
Definition: SphereSpawner.h:50
size_t getEstimatedNumberOfParticles() const override
Returns the number of particles to be spawned.
int spawnParticles(std::vector< Particle > &particles) const override
Spawns particles in the given container.