Commit a1266a1a authored by Stan Moore's avatar Stan Moore
Browse files

Fix compile error with copysign function

parent 7cce002c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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];
+1 −1
Original line number Diff line number Diff line
@@ -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];
+1 −1
Original line number Diff line number Diff line
@@ -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);
        }
}