8 const std::array<double, 3>& initial_velocity,
int type,
double epsilon,
double sigma,
LockState lock_state,
11 sphere_radius(sphere_radius),
12 grid_spacing(grid_spacing),
17 lock_state(lock_state),
18 initial_velocity(initial_velocity),
19 initial_temperature(initial_temperature),
20 third_dimension(third_dimension) {}
24 int num_particles_spawned = 0;
36 const auto position =
center + displacement;
40 particles.push_back(std::move(particle));
41 num_particles_spawned++;
46 return num_particles_spawned;
ThirdDimension
Enum class to define the dimension count of the simulation (2D or 3D). Affects primarily the dimensio...
LockState
Enum class to define the lockstate of particles. Locked particles are not allowed to move.
Class to represent a particle.
const std::array< double, 3 > center
Defines the center of the sphere.
const double grid_spacing
Defines the spacing between neighboring particles in the sphere.
const double initial_temperature
Defines the initial temperature of the particles in the sphere.
const double espilon
Defines the Lennard-Jones epsilon parameter of the particles in the sphere.
const std::array< double, 3 > initial_velocity
Defines the initial velocity of the particles in the sphere.
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.
const int sphere_radius
Defines the radius of the sphere.
const LockState lock_state
Defines whether the particles in the sphere are locked.
const double mass
Defines the mass of the particles in the sphere.
const ThirdDimension third_dimension
Defines whether to use the third dimension.
const int type
Defines the type of the particles in the sphere.
const double sigma
Defines the Lennard-Jones sigma parameter of the particles in the sphere.
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.
static void setParticleTemperature(double new_temperature, Particle &particle, ThirdDimension third_dimension)
Set the temperature of a particle. This method adds a random velocity to the particle according to th...
auto L2Norm(const Container &c)