Fix compile error with copysign function

This commit is contained in:
Stan Moore
2018-10-10 14:19:23 -06:00
parent 7cce002cf9
commit a1266a1a1e
3 changed files with 5 additions and 5 deletions

View File

@ -397,13 +397,13 @@ void ComputeStressMop::compute_pairs()
// at each timestep, must check atoms going through the
// image of the plane that is closest to the box
double pos_temp = pos+copysign(1,domain->prd_half[dir]-pos)*domain->prd[dir];
double pos_temp = pos+copysign(1.0,domain->prd_half[dir]-pos)*domain->prd[dir];
if (fabs(xi[dir]-pos)<fabs(xi[dir]-pos_temp)) pos_temp = pos;
if (((xi[dir]-pos_temp)*(xj[dir]-pos_temp)<0)){
//sgn = copysign(1,vi[dir]-vcm[dir]);
sgn = copysign(1,vi[dir]);
//sgn = copysign(1.0,vi[dir]-vcm[dir]);
sgn = copysign(1.0,vi[dir]);
//approximate crossing velocity by v(t-dt/2) (based on Velocity-Verlet alg.)
double vcross[3];

View File

@ -422,7 +422,7 @@ void ComputeStressMopProfile::compute_pairs()
if (((xi[dir]-pos)*(xj[dir]-pos)*(xi[dir]-pos1)*(xj[dir]-pos1)<0)){
sgn = copysign(1,vi[dir]);
sgn = copysign(1.0,vi[dir]);
//approximate crossing velocity by v(t-dt/2) (based on Velocity-Verlet alg.)
double vcross[3];

View File

@ -24,7 +24,7 @@ static inline void LimitDoubleMagnitude(double &x, const double limit) {
* if |x| exceeds limit, set x to limit with the sign of x
*/
if (fabs(x) > limit) { // limit delVdotDelR to a fraction of speed of sound
x = limit * copysign(1, x);
x = limit * copysign(1.0, x);
}
}