Skip to content
Snippets Groups Projects
Commit d8b22173 authored by Armin Damon Riess's avatar Armin Damon Riess
Browse files

correct mass calculation

parent 45889d62
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,9 @@
#include "node.hpp"
#include <vector>
#include <iostream>
Tree::Tree(double* masses, double* positions, double* forces, unsigned nParticles, double size, Vector center) {
masses_ = masses;
positions_ = positions;
forces_ = forces;
nParticles_ = nParticles;
......@@ -24,7 +24,7 @@ Tree::~Tree() {
delete root_;
}
void Tree::calculateForce(unsigned particle) {
void Tree::updateForce(unsigned particle) {
Vector force = root_->calculateForce(particle);
for (unsigned i=0; i < 3; ++i) forces_[3*particle + i] = force[i];
}
......
......@@ -12,8 +12,8 @@ public:
Tree(double* masses, double* positions, double* forces_, unsigned nParticles, double size, Vector center);
// Destructor
~Tree();
// Calculate force on a particle
void calculateForce(unsigned particle);
// Update force on a particle
void updateForce(unsigned particle);
// Update tree
void update();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment