diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index 02d52ef1a6..95a4b5d818 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -177,6 +177,8 @@ the clockwise direction for *vshear* > 0 or counter-clockwise for *vshear* < 0. In this case, *vshear* is the tangential velocity of the wall at whatever *radius* has been defined. + +Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the shear friction state of atoms interacting with the diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index d746923ab0..f9840c9d5e 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -71,6 +71,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix wall/gran requires atom style sphere"); create_attribute = 1; + limit_damping = 0; // set interaction style // disable bonded/history option for now @@ -91,7 +92,6 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // wall/particle coefficients int iarg; - if (pairstyle != GRANULAR) { size_history = 3; if (narg < 11) error->all(FLERR,"Illegal fix wall/gran command"); @@ -322,14 +322,14 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : if (normal_model == JKR) size_history += 1; if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) size_history += 1; - } - if (limit_damping and normal_model == JKR) - error->all(FLERR,"Illegal pair_coeff command, " - "cannot limit damping with JRK model"); - if (limit_damping and normal_model == DMT) - error->all(FLERR,"Illegal pair_coeff command, " - "Cannot limit damping with DMT model"); + if (limit_damping and normal_model == JKR) + error->all(FLERR,"Illegal pair_coeff command, " + "cannot limit damping with JRK model"); + if (limit_damping and normal_model == DMT) + error->all(FLERR,"Illegal pair_coeff command, " + "Cannot limit damping with DMT model"); + } // wallstyle args @@ -504,37 +504,39 @@ void FixWallGran::init() if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; - tangential_history_index = 0; - if (roll_history) { - if (tangential_history) roll_history_index = 3; - else roll_history_index = 0; - } - if (twist_history) { - if (tangential_history) { - if (roll_history) twist_history_index = 6; - else twist_history_index = 3; + if(pairstyle == GRANULAR) { + tangential_history_index = 0; + if (roll_history) { + if (tangential_history) roll_history_index = 3; + else roll_history_index = 0; } - else{ - if (roll_history) twist_history_index = 3; - else twist_history_index = 0; + if (twist_history) { + if (tangential_history) { + if (roll_history) twist_history_index = 6; + else twist_history_index = 3; + } + else{ + if (roll_history) twist_history_index = 3; + else twist_history_index = 0; + } + } + if (normal_model == JKR) { + tangential_history_index += 1; + roll_history_index += 1; + twist_history_index += 1; + } + if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || + tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { + roll_history_index += 1; + twist_history_index += 1; + } + + if (damping_model == TSUJI) { + double cor = normal_coeffs[1]; + normal_coeffs[1] = 1.2728-4.2783*cor+11.087*pow(cor,2)-22.348*pow(cor,3)+ + 27.467*pow(cor,4)-18.022*pow(cor,5)+ + 4.8218*pow(cor,6); } - } - if (normal_model == JKR) { - tangential_history_index += 1; - roll_history_index += 1; - twist_history_index += 1; - } - if (tangential_model == TANGENTIAL_MINDLIN_RESCALE || - tangential_model == TANGENTIAL_MINDLIN_RESCALE_FORCE) { - roll_history_index += 1; - twist_history_index += 1; - } - - if (damping_model == TSUJI) { - double cor = normal_coeffs[1]; - normal_coeffs[1] = 1.2728-4.2783*cor+11.087*pow(cor,2)-22.348*pow(cor,3)+ - 27.467*pow(cor,4)-18.022*pow(cor,5)+ - 4.8218*pow(cor,6); } } diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp index e21ec727d6..be2a3c2558 100644 --- a/src/GRANULAR/pair_gran_hertz_history.cpp +++ b/src/GRANULAR/pair_gran_hertz_history.cpp @@ -278,7 +278,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag) void PairGranHertzHistory::settings(int narg, char **arg) { - if (narg != 6) error->all(FLERR,"Illegal pair_style command"); + if (narg != 6 and narg != 7) error->all(FLERR,"Illegal pair_style command"); kn = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0; @@ -296,6 +296,12 @@ void PairGranHertzHistory::settings(int narg, char **arg) xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1) error->all(FLERR,"Illegal pair_style command"); + limit_damping = 0; + if (narg == 7) { + if (strcmp(arg[6], "limit_damping") == 0) limit_damping = 1; + else error->all(FLERR,"Illegal pair_style command"); + } + // convert Kn and Kt from pressure units to force/distance^2 kn /= force->nktv2p; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index ac98a6e27c..653d5c70a1 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -1038,7 +1038,7 @@ void PairGranular::coeff(int narg, char **arg) cutoff_type[i][j] = cutoff_type[j][i] = cutoff_one; - limit_damping[i][j] = ld_flag; + limit_damping[i][j] = limit_damping[j][i] = ld_flag; setflag[i][j] = 1; count++;