45 void reserve(
size_t n)
override;
54 [[nodiscard]] std::size_t
size()
const override;
63 [[nodiscard]] std::size_t
capacity()
const;
100 [[nodiscard]] std::vector<Particle>::iterator
begin()
override;
108 [[nodiscard]] std::vector<Particle>::iterator
end()
override;
117 [[nodiscard]] std::vector<Particle>::const_iterator
begin()
const override;
126 [[nodiscard]] std::vector<Particle>::const_iterator
end()
const override;
132 [[nodiscard]]
const std::vector<Particle>&
getParticles()
const override;
146 void applySimpleForces(
const std::vector<std::shared_ptr<SimpleForceSource>>& simple_force_sources)
override;
156 void applyPairwiseForces(
const std::vector<std::shared_ptr<PairwiseForceSource>>& pairwise_force_sources)
override;
166 void applyTargettedForces(
const std::vector<std::shared_ptr<TargettedForceSource>>& targetted_force_sources,
167 double curr_simulation_time)
override;
Wrapper class for a set of particles.
Particle & operator[](int i) override
Returns a particle.
std::size_t capacity() const
Returns the capacity of the container.
std::vector< Particle >::iterator begin() override
Returns an iterator to the first particle.
void applyTargettedForces(const std::vector< std::shared_ptr< TargettedForceSource >> &targetted_force_sources, double curr_simulation_time) override
Applies the given targetted force sources to the particles.
std::vector< Particle >::iterator end() override
Returns an end iterator for this container.
DirectSumContainer()=default
Default constructor.
void reserve(size_t n) override
Reserves memory for particles.
void applySimpleForces(const std::vector< std::shared_ptr< SimpleForceSource >> &simple_force_sources) override
Applies the given simple force sources to the particles.
std::vector< Particle > particles
Internal data structure for the particles.
void addParticle(const Particle &p) override
Adds a particle to the container.
void applyPairwiseForces(const std::vector< std::shared_ptr< PairwiseForceSource >> &pairwise_force_sources) override
Applies the given force sources to the particles.
void prepareForceCalculation() override
Prepares everything for the force calculations (must be called before applySimpleForces and applyPair...
std::size_t size() const override
Returns the amount of particles.
const std::vector< Particle > & getParticles() const override
Returns a vector of all particles in the container.
Interface for particle containers.
Class to represent a particle.