Commit 4780d728 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

use '&&' and '||' instead of 'and' and 'or' operators for consistency

parent 97d3c843
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -93,9 +93,9 @@ void PairDSMC::compute(int eflag, int vflag)
    int ycell = static_cast<int>((x[i][1] - domain->boxlo[1])/celly);
    int zcell = static_cast<int>((x[i][2] - domain->boxlo[2])/cellz);

    if ((xcell < 0) or (xcell > ncellsx-1) or
        (ycell < 0) or (ycell > ncellsy-1) or
        (zcell < 0) or (zcell > ncellsz-1)) continue;
    if ((xcell < 0) || (xcell > ncellsx-1) ||
        (ycell < 0) || (ycell > ncellsy-1) ||
        (zcell < 0) || (zcell > ncellsz-1)) continue;

    int icell = xcell + ycell*ncellsx + zcell*ncellsx*ncellsy;
    itype = type[i];
@@ -146,7 +146,7 @@ void PairDSMC::compute(int eflag, int vflag)
        double num_of_collisions_double = number_of_A * number_of_B *
          weighting * Vs_max * update->dt / vol;

        if ((itype == jtype) and number_of_B)
        if ((itype == jtype) && number_of_B)
          num_of_collisions_double *=
            0.5 * double(number_of_B - 1) / double(number_of_B);

@@ -161,8 +161,8 @@ void PairDSMC::compute(int eflag, int vflag)
        // perform collisions on pairs of particles in icell

        for (int k = 0; k < num_of_collisions; k++) {
          if ((number_of_A < 1) or (number_of_B < 1)) break;
          if ((itype == jtype) and (number_of_A < 2)) break;
          if ((number_of_A < 1) || (number_of_B < 1)) break;
          if ((itype == jtype) && (number_of_A < 2)) break;
          int ith_A = static_cast<int>(random->uniform()*number_of_A);
          int jth_B = static_cast<int>(random->uniform()*number_of_B);
          int i = particle_list[itype][ith_A];