6 const std::vector<std::shared_ptr<SimpleForceSource>>& simple_force_sources,
7 const std::vector<std::shared_ptr<PairwiseForceSource>>& pairwise_force_sources,
8 const std::vector<std::shared_ptr<TargettedForceSource>>& targetted_force_sources,
double delta_t,
9 double curr_simulation_time)
const {
10 for (
auto& p : *particle_container) {
13 const std::array<double, 3> new_x = p.getX() + delta_t * p.getV() + (delta_t * delta_t / (2 * p.getM())) * p.getF();
23 particle_container->prepareForceCalculation();
24 particle_container->applySimpleForces(simple_force_sources);
25 particle_container->applyPairwiseForces(pairwise_force_sources);
26 particle_container->applyTargettedForces(targetted_force_sources, curr_simulation_time);
29 for (
auto& p : *particle_container) {
31 const std::array<double, 3> new_v = p.getV() + (delta_t / (2 * p.getM())) * (p.getF() + p.getOldF());
void step(std::unique_ptr< ParticleContainer > &particle_container, const std::vector< std::shared_ptr< SimpleForceSource >> &simple_force_sources, const std::vector< std::shared_ptr< PairwiseForceSource >> &pairwise_force_sources, const std::vector< std::shared_ptr< TargettedForceSource >> &targetted_force_sources, double delta_t, double curr_simulation_time) const override
Performs one step with the respective integration method.