dumping only cohesion force contribution

Submitted by jagan1mohan on Thu, 11/19/2020 - 09:17

Hello team, greetings. I have added the van der Waals forces on the top of normal_model_hooke. I switch this force contribution via a flag "vdw on" in the input script in the pair style. Everything is working fine and I could match results from an article. In the dump, when we use fx fy fz, the output is the sum total of all the forces acting on each of the particles. How can we create a new set of variables say vdwx vdwy vdwz which has only vdw contribution for post-processing? Thank you, Jagan Mohan.

mschramm | Thu, 11/19/2020 - 18:38

Hello,
You would have to add an extra set of variables to the atom class.
You would then add extra variables to the following.
dump_custom.cpp
variable.cpp
This would be enough to output the values to a dump file.
If you want to be complete you would also add it to fix_store_state.cpp

jagan1mohan | Sun, 11/22/2020 - 11:48

Hello Matthew, Thank you for the input on creating a per-atom custom variable. I closely followed your post and made changes/copy-pasted lines related to fx, fy and fz and changed them to vdwx, vdwy and vdwz wherever necessary.

Files changed are
atom.h and atom.cpp
dump_custom.h and dump_custom.cpp
variable.cpp
fix_store_state.h and fix_store_state.cpp

The compilation is successful. One question I have is, where are we telling the LIGGGHTS to pick the van der Waals force value from normal_hooke_model.h? As a reminder, I have added this force on top of hooke model and switches on when I use a flag "Fvdw on" after pair_style gran model hooke tangential history. That is, I created a local variable Fn_vdw which is calculated when if(Fvdw_) is true and it is added to the already existing variable Fn inside this file. Thank you, Jagan Mohan.