[lammps-users] fix wall/gran

Hello everyone,

I am using Feb/2016 LAMMPS and I have a question regarding the use of fix wall/gran. Looking at the 02/2016 docs, the page says for fix wall/gran:

And then they say:
The nature of the wall/particle interactions are determined by which pair_style is used in your input script: hooke, hooke/history, or hertz/history.

How does that line discriminate between the respective pair styles because I can’t explicitly declare which type of pair_style in the syntax for wall/gran unlike the current version of LAMMPS. By that I mean if I have the following syntax:

pair_style gran/hertz/history 8.4248e+10 0 0 0 0.0 0

pair_coeff * *

fix 5 all wall/gran 84248000000.0 0 0 0 0 0 yplane 0 1.99836522550

How does fix 5 know what pair_style to use? Does it automatically use gran/hertz/history for the specific params listed? What if I used gran/hooke for pair_style and wanted pair_style of gran/hertz for the wall? I tried specifying the pair_style the way they do in the 2020 docs and it doesn’t work so I am guessing modifications have been made since then.

Kindly request your help.

Best,
Aved

Hello everyone,

I am using Feb/2016 LAMMPS and I have a question regarding the use of fix wall/gran. Looking at the 02/2016 docs, the page says for fix wall/gran:

And then they say:
The nature of the wall/particle interactions are determined by which pair_style is used in your input script: hooke, hooke/history, or hertz/history.

How does that line discriminate between the respective pair styles because I can’t explicitly declare which type of pair_style in the syntax for wall/gran unlike the current version of LAMMPS. By that I mean if I have the following syntax:

pair_style gran/hertz/history 8.4248e+10 0 0 0 0.0 0

pair_coeff * *

fix 5 all wall/gran 84248000000.0 0 0 0 0 0 yplane 0 1.99836522550

How does fix 5 know what pair_style to use?

it looks up what the name of the current pair style is.

Does it automatically use gran/hertz/history for the specific params listed?

yes.

What if I used gran/hooke for pair_style and wanted pair_style of gran/hertz for the wall?

you would have to modify the fix wall/gran source code.

I tried specifying the pair_style the way they do in the 2020 docs and it doesn’t work

of course not. you have to follow the documentation of the version of LAMMPS that you are doing. unless there is an error in the documentation or the source code, the only available syntax is what the documentation describes.

so I am guessing modifications have been made since then.

yes. quite a few. there are 46 commits to the corresponding C++ source file in the commit history.

axel.

Hi Axel,

Thanks for your prompt reply and my apologies for replying to you individually.

I see your previous comments and that makes sense. I have a follow up question, If I am using pair_style hybrid and say I have two different pair_style’s which one does it assign to gran/wall then?

I am not the best when it comes to software but would it make sense if I recompile the gran/wall from 2020 LAMMPS with the existing 2016 LAMMPS I have, to get the functionality of specifying the potential like in the current version?

Please forgive my rudimentary questions.

Thanks!

Best,
Aved

Hi Axel,

Thanks for your prompt reply and my apologies for replying to you individually.

I see your previous comments and that makes sense. I have a follow up question, If I am using pair_style hybrid and say I have two different pair_style’s which one does it assign to gran/wall then?

no. it will fail with an error: Fix wall/gran is incompatible with Pair style
i am not even sure if the granular pair styles in the 2016 version are fully compatible with using a hybrid pair style in the first place.

I am not the best when it comes to software but would it make sense if I recompile the gran/wall from 2020 LAMMPS with the existing 2016 LAMMPS I have, to get the functionality of specifying the potential like in the current version?

no. the new functionality depends on features not present in the old version of LAMMPS. in general, we don’t recommend using such a thing but just upgrade to the current version of LAMMPS.

axel.