Molecular Dynamics Simulation
1.0
|
Class to spawn particles of a soft body in a cuboid. Implements the interface ParticleSpawner. More...
#include <SoftBodyCuboidSpawner.h>
Public Member Functions | |
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. More... | |
int | spawnParticles (std::vector< Particle > &particles) const override |
Spawns particles in the given container. More... | |
size_t | getEstimatedNumberOfParticles () const override |
Estimate the number of particles to be spawned. More... | |
Private Attributes | |
const std::array< double, 3 > | lower_left_corner |
Defines the lower left corner where the cuboid will be spawned. More... | |
const std::array< int, 3 > | grid_dimensions |
Defines how big the cuboid will be. Each entry defines the number of particles in the respective direction. More... | |
const double | grid_spacing |
Defines the spacing between neighboring particles in the cuboid. More... | |
const double | mass |
Defines the mass of the particles in the cuboid. More... | |
const int | type |
Defines the type of the particles in the cuboid. More... | |
double | epsilon |
Defines the Lennard-Jones epsilon parameter of the particles in the cuboid. More... | |
double | sigma |
Defines the Lennard-Jones sigma parameter of the particles in the cuboid. More... | |
const double | spring_constant |
Spring constant of the harmonic springs. More... | |
const std::array< double, 3 > | initial_velocity |
Defines the initial velocity of the particles in the cuboid. More... | |
const double | initial_temperature |
Defines the initial temperature of the particles in the cuboid. More... | |
const ThirdDimension | third_dimension |
Defines whether the third dimension is enabled. More... | |
Class to spawn particles of a soft body in a cuboid. Implements the interface ParticleSpawner.
Implementation of the particle spawning in a soft body cuboid. This class is very similar to the CuboidSpawner, but it links neighboring particles with harmonic springs. The HarmonicForce then class calculates the force on the particles.
Definition at line 13 of file SoftBodyCuboidSpawner.h.
SoftBodyCuboidSpawner::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.
lower_left_corner | Lower left corner of the soft body |
grid_dimensions | Grid dimensions |
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 |
spring_constant | Spring constant of the harmonic springs |
initial_temperature | Initial temperature of the particles |
third_dimension | Whether to spawn particles in the third dimension |
Constructor to initialize the cuboid spawner. The velocity of the particles is jittered by a Maxwell-Boltzmann distribution.
Definition at line 10 of file SoftBodyCuboidSpawner.cpp.
|
overridevirtual |
Estimate the number of particles to be spawned.
returns the number of particles to be spawned by this spawner this can be used to reserve enought memory in the particle container
Implements ParticleSpawner.
Definition at line 88 of file SoftBodyCuboidSpawner.cpp.
|
overridevirtual |
Spawns particles in the given container.
particles | A vector of particles to spawn |
Implements ParticleSpawner.
Definition at line 26 of file SoftBodyCuboidSpawner.cpp.
|
private |
Defines the Lennard-Jones epsilon parameter of the particles in the cuboid.
Definition at line 43 of file SoftBodyCuboidSpawner.h.
|
private |
Defines how big the cuboid will be. Each entry defines the number of particles in the respective direction.
Definition at line 23 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the spacing between neighboring particles in the cuboid.
Definition at line 28 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the initial temperature of the particles in the cuboid.
Definition at line 63 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the initial velocity of the particles in the cuboid.
Definition at line 58 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the lower left corner where the cuboid will be spawned.
Definition at line 18 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the mass of the particles in the cuboid.
Definition at line 33 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the Lennard-Jones sigma parameter of the particles in the cuboid.
Definition at line 48 of file SoftBodyCuboidSpawner.h.
|
private |
Spring constant of the harmonic springs.
Definition at line 53 of file SoftBodyCuboidSpawner.h.
|
private |
Defines whether the third dimension is enabled.
Definition at line 68 of file SoftBodyCuboidSpawner.h.
|
private |
Defines the type of the particles in the cuboid.
Definition at line 38 of file SoftBodyCuboidSpawner.h.