Hi. I have used LIGGGHTS to prepare a cube of compressed particles. I need to extract the local contact information such as contact normal, tangential force direction, to construct a four-rank tangent modulus for the granular system.
I am aware of the compute pair/gran/local command but the issue is that I can not use the variable to store the local information that needs further processing. So now I am trying to write my own compute to achieve this goal.
Another approach is to dump these data. But I am coupling LIGGGHTS with another code. It is better if I can get the tangent modulus directly without keeping reading a file during the simulation.
I know the neighbor list stored in the NeighList class, which allows me to get the contact list. However, I do not know how to access the contact force, between atom i and atom j, for example. Through compute_pair_gran_local.cpp, I identify PairGran::cpl_add_pair(LCM::SurfacesIntersectData & sidata, LCM::ForceData & i_forces) in pair_gran.cpp. But this function does not seem to be called in the program. I am totally lost. Please help me if possible. Thanks.
mschramm | Fri, 03/04/2022 - 04:38
add compute lookup to the custom file?
Hello,
Would you be able to call the compute directly from the liggghts code like you see in cfd/couple (they create custom fixes but same logic) as computes have the same find function?
This would allow you to get the same information from compute pair/gran/local but inside your cpp file.
Ming | Fri, 03/04/2022 - 22:07
Hi Matt,
Hi Matt,
Thanks for your reply. I am sorry that I could not follow you (I am new to the LIGGGHTS source code).
My pursue is simple: for each contact, I want to obtain the corresponding forces. Do you have any suggestions about getting those?
When you mention cfd/couple, are you referring to the file fix_cfd_coupling.h? Can you elaborate a bit more on your idea of getting the local information?
Thanks for your help.
mschramm | Fri, 03/04/2022 - 22:44
modify->find_compute
Hello,
Like fixes, you are able to create and call computes from inside the liggghts code.
See compute_erotate.cpp line ~70
So you would be able to set a compute in your code for pair/gran/local and access the information directly.
Ming | Sat, 03/05/2022 - 00:23
Hi Matt,
Hi Matt,
I got it. Thanks for the excellent suggestion.
Have a good weekend.