Skip to content
Snippets Groups Projects
Commit d7dd81d8 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

the original masses member variable is not really necessary

parent e19dda45
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,6 @@ SimulationPtr Simulation::Load(const String& filename, MMSettingsPtr settings){ ...@@ -47,8 +47,6 @@ SimulationPtr Simulation::Load(const String& filename, MMSettingsPtr settings){
TopologyPtr top_p(new Topology); TopologyPtr top_p(new Topology);
ds >> *top_p; ds >> *top_p;
sim_ptr->original_masses_ = top_p->GetMasses();
sim_ptr->top_ = top_p; sim_ptr->top_ = top_p;
sim_ptr->system_ = SystemCreator::Create(sim_ptr->top_,settings, sim_ptr->system_ = SystemCreator::Create(sim_ptr->top_,settings,
...@@ -114,7 +112,6 @@ void Simulation::Init(const TopologyPtr top, ...@@ -114,7 +112,6 @@ void Simulation::Init(const TopologyPtr top,
} }
system_ = SystemCreator::Create(top_,settings,system_force_mapper_); system_ = SystemCreator::Create(top_,settings,system_force_mapper_);
ost::mol::EntityHandle ent = top_->GetEntity(); ost::mol::EntityHandle ent = top_->GetEntity();
original_masses_ = top_->GetMasses();
//setting up the context, which combines the system with an integrator //setting up the context, which combines the system with an integrator
//to proceed in time, but first we have to load the proper platform //to proceed in time, but first we have to load the proper platform
...@@ -487,8 +484,9 @@ void Simulation::AddPositionConstraints(const std::vector<uint>& index){ ...@@ -487,8 +484,9 @@ void Simulation::AddPositionConstraints(const std::vector<uint>& index){
} }
void Simulation::ResetPositionConstraints(){ void Simulation::ResetPositionConstraints(){
for(uint i = 0; i < original_masses_.size(); ++i){ std::vector<Real> original_masses = top_->GetMasses();
system_->setParticleMass(i,original_masses_[i]); for(uint i = 0; i < original_masses.size(); ++i){
system_->setParticleMass(i,original_masses[i]);
} }
top_->ResetPositionConstraints(); top_->ResetPositionConstraints();
context_->reinitialize(); context_->reinitialize();
......
...@@ -134,7 +134,6 @@ private: ...@@ -134,7 +134,6 @@ private:
std::vector<MMObserverPtr> observers_; std::vector<MMObserverPtr> observers_;
std::vector<int> time_to_notify_; std::vector<int> time_to_notify_;
std::map<FuncType,uint> system_force_mapper_; std::map<FuncType,uint> system_force_mapper_;
std::vector<Real> original_masses_;
}; };
}}} //ns }}} //ns
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment