From 4780d72809c006485f2a6032d38b2d74d2ac58c3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Mon, 22 May 2017 14:42:42 -0400 Subject: [PATCH] use '&&' and '||' instead of 'and' and 'or' operators for consistency --- src/MC/pair_dsmc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index 29ecde2023..d3327eea29 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -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]; -- GitLab