Molecular Dynamics Simulation  1.0
SoftBodyCuboidSpawner.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "utils/Enums.h"
5 
14  private:
18  const std::array<double, 3> lower_left_corner;
19 
23  const std::array<int, 3> grid_dimensions;
24 
28  const double grid_spacing;
29 
33  const double mass;
34 
38  const int type;
39 
43  double epsilon;
44 
48  double sigma;
49 
53  const double spring_constant;
54 
58  const std::array<double, 3> initial_velocity;
59 
63  const double initial_temperature;
64 
69 
70  public:
87  SoftBodyCuboidSpawner(const std::array<double, 3>& lower_left_corner, const std::array<int, 3>& grid_dimensions, double grid_spacing,
88  double mass, const std::array<double, 3>& initial_velocity, int type, double epsilon = 1.0, double sigma = 1.2,
90  double initial_temperature = 0.1);
91 
98  int spawnParticles(std::vector<Particle>& particles) const override;
99 
106  [[nodiscard]] size_t getEstimatedNumberOfParticles() const override;
107 };
ThirdDimension
Enum class to define the dimension count of the simulation (2D or 3D). Affects primarily the dimensio...
Definition: Enums.h:7
Interface for particle spawner classes.
Class to spawn particles of a soft body in a cuboid. Implements the interface ParticleSpawner.
double sigma
Defines the Lennard-Jones sigma parameter of the particles in the cuboid.
const double initial_temperature
Defines the initial temperature of the particles in the cuboid.
const std::array< double, 3 > lower_left_corner
Defines the lower left corner where the cuboid will be spawned.
double epsilon
Defines the Lennard-Jones epsilon parameter of the particles in the cuboid.
size_t getEstimatedNumberOfParticles() const override
Estimate the number of particles to be spawned.
const int type
Defines the type of the particles in the cuboid.
const std::array< double, 3 > initial_velocity
Defines the initial velocity of the particles in the cuboid.
const ThirdDimension third_dimension
Defines whether the third dimension is enabled.
const double mass
Defines the mass of the particles in the cuboid.
const double grid_spacing
Defines the spacing between neighboring particles in the cuboid.
SoftBodyCuboidSpawner(const std::array< double, 3 > &lower_left_corner, const std::array< int, 3 > &grid_dimensions, double grid_spacing, double mass, const std::array< double, 3 > &initial_velocity, int type, double epsilon=1.0, double sigma=1.2, double spring_constant=300, ThirdDimension third_dimension=ThirdDimension::ENABLED, double initial_temperature=0.1)
Constructor.
int spawnParticles(std::vector< Particle > &particles) const override
Spawns particles in the given container.
const double spring_constant
Spring constant of the harmonic springs.
const std::array< int, 3 > grid_dimensions
Defines how big the cuboid will be. Each entry defines the number of particles in the respective dire...