Molecular Dynamics Simulation  1.0
Public Member Functions | List of all members
ParticleSpawner Class Referenceabstract

Interface for particle spawner classes. More...

#include <ParticleSpawner.h>

Inheritance diagram for ParticleSpawner:
Inheritance graph
Collaboration diagram for ParticleSpawner:
Collaboration graph

Public Member Functions

virtual int spawnParticles (std::vector< Particle > &particles) const =0
 Spawns particles in the given container. More...
 
virtual size_t getEstimatedNumberOfParticles () const =0
 Estimate the number of particles to be spawned. More...
 

Detailed Description

Interface for particle spawner classes.

Definition of an interface for particle spawner classes. This is used to ensure inheriting classes implement the method spawnParticles(ParticleContainer& particle_container) according to our definition.

Definition at line 13 of file ParticleSpawner.h.

Member Function Documentation

◆ getEstimatedNumberOfParticles()

virtual size_t ParticleSpawner::getEstimatedNumberOfParticles ( ) const
pure virtual

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

Implemented in SphereSpawner, SoftBodyCuboidSpawner, and CuboidSpawner.

◆ spawnParticles()

virtual int ParticleSpawner::spawnParticles ( std::vector< Particle > &  particles) const
pure virtual

Spawns particles in the given container.

Parameters
particlesA vector of particles to spawn
Returns
Number of particles spawned Spawns particles in the given container.

Implemented in SphereSpawner, SoftBodyCuboidSpawner, and CuboidSpawner.


The documentation for this class was generated from the following file: