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

softening now a single scalar for every particle

parent 3096b9f9
No related branches found
No related tags found
No related merge requests found
...@@ -29,9 +29,8 @@ nBodySim::nBodySim(std::string datafile) { ...@@ -29,9 +29,8 @@ nBodySim::nBodySim(std::string datafile) {
} }
} }
softening_ = new double[nParticles_];
for (unsigned i=0; i < nParticles_; ++i) { for (unsigned i=0; i < nParticles_; ++i) {
file >> softening_[i]; file >> softening_;
} }
potential_ = new double[nParticles_]; potential_ = new double[nParticles_];
...@@ -52,7 +51,6 @@ nBodySim::~nBodySim() { ...@@ -52,7 +51,6 @@ nBodySim::~nBodySim() {
delete[] masses_; delete[] masses_;
delete[] positions_; delete[] positions_;
delete[] velocities_; delete[] velocities_;
delete[] softening_;
delete[] potential_; delete[] potential_;
delete[] forces_; delete[] forces_;
} }
...@@ -223,7 +221,7 @@ void nBodySim::saveState2file(unsigned step, std::string filename) const { ...@@ -223,7 +221,7 @@ void nBodySim::saveState2file(unsigned step, std::string filename) const {
} }
// save softening // save softening
for (unsigned i=0; i < nParticles_; ++i) { for (unsigned i=0; i < nParticles_; ++i) {
file << softening_[i] << std::endl; file << softening_ << std::endl;
} }
// save potential // save potential
for (unsigned i=0; i < nParticles_; ++i) { for (unsigned i=0; i < nParticles_; ++i) {
......
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
double* masses_; double* masses_;
double* positions_; double* positions_;
double* velocities_; double* velocities_;
double* softening_; double softening_;
double* potential_; double* potential_;
double* forces_; double* forces_;
double meanInterparticleDistance_; double meanInterparticleDistance_;
......
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