diff --git a/src/FLD/pair_brownian.cpp b/src/FLD/pair_brownian.cpp index 1ff6dc2308..eb6454f558 100755 --- a/src/FLD/pair_brownian.cpp +++ b/src/FLD/pair_brownian.cpp @@ -501,12 +501,13 @@ void PairBrownian::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL){ + else if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (flagwall) + error->all(FLERR, + "Cannot use multiple fix wall commands with pair brownian"); flagwall = 1; // Walls exist - if (((FixWall *) modify->fix[i])->xflag ) { - flagwall = 2; // Moving walls exist - wallfix = (FixWall *) modify->fix[i]; - } + wallfix = (FixWall *) modify->fix[i]; + if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/FLD/pair_brownian_poly.cpp b/src/FLD/pair_brownian_poly.cpp index 444ccd7442..7373f15de1 100644 --- a/src/FLD/pair_brownian_poly.cpp +++ b/src/FLD/pair_brownian_poly.cpp @@ -352,6 +352,32 @@ void PairBrownianPoly::init_style() // set the isotropic constants that depend on the volume fraction // vol_T = total volume + // check for fix deform, if exists it must use "remap v" + // If box will change volume, set appropriate flag so that volume + // and v.f. corrections are re-calculated at every step. + // + // If available volume is different from box volume + // due to walls, set volume appropriately; if walls will + // move, set appropriate flag so that volume and v.f. corrections + // are re-calculated at every step. + + flagdeform = flagwall = 0; + for (int i = 0; i < modify->nfix; i++){ + if (strcmp(modify->fix[i]->style,"deform") == 0) + flagdeform = 1; + else if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (flagwall) + error->all(FLERR, + "Cannot use multiple fix wall commands with pair brownian"); + flagwall = 1; // Walls exist + wallfix = (FixWall *) modify->fix[i]; + if (wallfix->xflag) flagwall = 2; // Moving walls exist + } + } + + // set the isotropic constants that depend on the volume fraction + // vol_T = total volume + double vol_T, wallcoord; if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd; else { @@ -378,7 +404,6 @@ void PairBrownianPoly::init_style() (wallhi[2] - walllo[2]); } - // vol_P = volume of particles, assuming mono-dispersity // vol_f = volume fraction diff --git a/src/FLD/pair_lubricate.cpp b/src/FLD/pair_lubricate.cpp index 0c473e470c..bf6fa47d0e 100755 --- a/src/FLD/pair_lubricate.cpp +++ b/src/FLD/pair_lubricate.cpp @@ -206,10 +206,8 @@ void PairLubricate::compute(int eflag, int vflag) } } - // end of R0 adjustment code - for (ii = 0; ii < inum; ii++) { i = ilist[ii]; xtmp = x[i][0]; @@ -595,12 +593,13 @@ void PairLubricate::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL){ + if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (flagwall) + error->all(FLERR, + "Cannot use multiple fix wall commands with pair lubricate"); flagwall = 1; // Walls exist - if (((FixWall *) modify->fix[i])->xflag ) { - flagwall = 2; // Moving walls exist - wallfix = (FixWall *) modify->fix[i]; - } + wallfix = (FixWall *) modify->fix[i]; + if (wallfix->xflag) flagwall = 2; // Moving walls exist } } @@ -616,6 +615,7 @@ void PairLubricate::init_style() wallhi[j] = domain->prd[j]; walllo[j] = 0; } + for (int m = 0; m < wallfix->nwall; m++){ int dim = wallfix->wallwhich[m] / 2; int side = wallfix->wallwhich[m] % 2; diff --git a/src/FLD/pair_lubricate_poly.cpp b/src/FLD/pair_lubricate_poly.cpp index f2aad523e0..d37cc4c005 100644 --- a/src/FLD/pair_lubricate_poly.cpp +++ b/src/FLD/pair_lubricate_poly.cpp @@ -490,6 +490,16 @@ void PairLubricatePoly::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } + if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (flagwall) + error->all(FLERR, + "Cannot use multiple fix wall commands with " + "pair lubricate/poly"); + flagwall = 1; // Walls exist + wallfix = (FixWall *) modify->fix[i]; + if (wallfix->xflag) flagwall = 2; // Moving walls exist + } + if (strstr(modify->fix[i]->style,"wall") != NULL){ flagwall = 1; // Walls exist if (((FixWall *) modify->fix[i])->xflag ) { diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 297f22741c..c5915db2dd 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -182,7 +182,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : } // set xflag if any wall positions are variable - // set vflag if any wall positions are variable + // set vflag if any wall positions or parameters are variable // set wstyle to VARIABLE if either epsilon or sigma is a variable vflag = xflag = 0;