10 #include "../ParticleContainer.h"
61 [[nodiscard]]
size_t size()
const override;
80 std::vector<Particle>::iterator
begin();
89 std::vector<Particle>::iterator
end();
Container to store the particles for simulation using the direct sum algorithm.
Definition: DefaultParticleContainer.h:19
size_t capacity()
Retrieve the capacity of this container.
Definition: DefaultParticleContainer.cpp:24
DefaultParticleContainer()=default
void add(Particle &p) override
Add one particle to this container.
Definition: DefaultParticleContainer.cpp:12
size_t size() const override
Retrieve the size of the data structure.
Definition: DefaultParticleContainer.cpp:20
std::vector< Particle > particles
Definition: DefaultParticleContainer.h:21
void reserve(size_t n)
Used to reserve the capacity of the vector used to storing particles.
Definition: DefaultParticleContainer.cpp:36
Particle & at(size_t i)
Obtain particle at position i.
Definition: DefaultParticleContainer.cpp:16
std::vector< Particle >::iterator end()
Obtain an iterator to the last element of this container.
Definition: DefaultParticleContainer.cpp:32
std::vector< Particle >::iterator begin()
Obtain an iterator to the first particle in this container.
Definition: DefaultParticleContainer.cpp:28
bool contains(Particle &p)
Check, if this particle container contains an particle p' that equals p.
Definition: DefaultParticleContainer.cpp:40
void applyToAllUniquePairsInDomain(const std::function< void(Particle &, Particle &)> &function) override
Iterate over all unique pairs of particles being part of the simulation domain (in this container all...
Definition: DefaultParticleContainer.cpp:59
void applyToEachParticleInDomain(const std::function< void(Particle &)> &function) override
Iterate over all particles that are part of the domain and apply a lambda function to them....
Definition: DefaultParticleContainer.cpp:55
void applyToEachParticle(const std::function< void(Particle &)> &function) override
Iterate over all particles in this container and apply a lambda function to them.
Definition: DefaultParticleContainer.cpp:49
Definition: ParticleContainer.h:11
Definition: Particle.h:16