Commit a21b94ad by Francois Gygi

synchronize positions and velocities


git-svn-id: http://qboxcode.org/svn/qb/trunk@989 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 0535f829
......@@ -42,6 +42,7 @@ void MDIonicStepper::compute_r(double e0, const vector<vector< double> >& f0)
constraints_.enforce_r(r0_,rp_);
rm_ = r0_;
r0_ = rp_;
atoms_.sync_positions(r0_);
atoms_.set_positions(r0_);
}
......@@ -120,9 +121,8 @@ void MDIonicStepper::compute_v(double e0, const vector<vector< double> >& f0)
}
}
}
atoms_.sync_velocities(v0_);
atoms_.set_velocities(v0_);
atoms_.sync();
atoms_.get_velocities(v0_);
}
else if ( thermostat_ == "LOWE" )
{
......@@ -196,9 +196,8 @@ void MDIonicStepper::compute_v(double e0, const vector<vector< double> >& f0)
}
}
}
atoms_.sync_velocities(v0_);
atoms_.set_velocities(v0_);
atoms_.sync();
atoms_.get_velocities(v0_);
//cout << " npairs: " << npairs << endl;
}
else if ( thermostat_ == "BDP" )
......@@ -247,13 +246,13 @@ void MDIonicStepper::compute_v(double e0, const vector<vector< double> >& f0)
if ( !s_.ctxt_.onpe0() )
s_.ctxt_.dbcast_recv(1,1,&ekin_stepper_,1,0,0);
atoms_.sync_velocities(v0_);
atoms_.set_velocities(v0_);
atoms_.sync();
atoms_.get_velocities(v0_);
}
constraints_.enforce_v(r0_,v0_);
// recompute ekin as velocities may be affected by constraints
compute_ekin();
atoms_.sync_velocities(v0_);
atoms_.set_velocities(v0_);
}
......
......@@ -35,5 +35,6 @@ void SDIonicStepper::compute_r(double e0, const vector<vector< double> >& f0)
constraints_.enforce_r(r0_,rp_);
rm_ = r0_;
r0_ = rp_;
atoms_.sync_positions(r0_);
atoms_.set_positions(r0_);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment