How to start using LIGGGHTS for Superquadric Simulations?

Submitted by lakshmiIC35134 on Sat, 01/15/2022 - 18:00

I've been trying to use the superquadric example in LIGGGHTS. I get the following errors:

The contact model you specified is not located in any whitelist.
Because of this the model will be run in an unoptimized version (increasing runtime by up to 20%).
In order to optimize this model you have the following options:
(i) Run the genAutoExamplesWhitelist.sh script in your LIGGGHTS(R) source folder to automatically parse the input script
(ii) Add the model combination by hand to your style_contact_model_user.whitelist that can be found in your LIGGGHTS(R) source folder
If you perform one of the steps above LIGGGHTS(R) needs to be recompiled to generate the optimized code.

I went to the 'LIGGGHTS-PUBLIC/src/MAKE' folder in the 'Makefile.auto' file and modified the USE_SUPERQUADRICS? = "OFF" to "ON" and recompiled the code. It did not work.
I even tried opening LIGGGHTS-PUBLIC/src/style_contact_model_user.whitelist and added:

GRAN_MODEL(HOOKE, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_OFF, SURFACE_SUPERQUADRIC)
GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_OFF, SURFACE_SUPERQUADRIC)

GRAN_MODEL(HOOKE, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_CDT, SURFACE_SUPERQUADRIC)
GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_CDT, SURFACE_SUPERQUADRIC)
GRAN_MODEL(HOOKE, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD, SURFACE_SUPERQUADRIC)
GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD, SURFACE_SUPERQUADRIC)
GRAN_MODEL(HOOKE, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD2, SURFACE_SUPERQUADRIC)
GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD2, SURFACE_SUPERQUADRIC)

and recompiled. Did not work. Please help me with this.

mschramm | Sun, 01/16/2022 - 00:03

Hello,
What you posted first is NOT an ERROR. I have never seen a "un-optimized" version be 20% slower than an "optimized" one.

However, to remove the warning from the example, add the following to the file "style_contact_model_user.whitelist" in your src folder.
GRAN_MODEL(HERTZ, TANGENTIAL_HISTORY, COHESION_OFF, ROLLING_EPSD2, SURFACE_SUPERQUADRIC)

Once the file is created, please run
make clean-auto
and
make auto
to rebuild the program.

You can also double check that liggghts accepted your contact model by opening the .h file that is created (style_contact_model.h).

lakshmiIC35134 | Sun, 01/16/2022 - 09:51

I have these files in the src folder:
style_contact_model_autoExamples.whitelist
style_contact_model.h
style_contact_model.whitelist
I don't understand the file name you've asked me to access.

lakshmiIC35134 | Sun, 01/16/2022 - 10:05

I tried adding that line in "style_contact_model.whitelist" folder and ran make auto.
This is the output I got:

WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, WARNING! Style collision detected! Duplicate entry (gran, WARNING! Style collision detected! Duplicate entry (gran, WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
83886208) in style table.
WARNING! Style collision detected! Duplicate entry (gran, 83886208) in style table.
LIGGGHTS (Version LIGGGHTS-PUBLIC 3.8.0, compiled 2022-01-16-14:22:53 by hp, git commit 86544c3f1215bc9744d7929e3eacf53ba086af9e)

atom_style superquadric

atom_modify map array

boundary f f f
newton off
communicate single vel yes
units si

region reg block -0.05 0.05 -0.05 0.05 0.0 0.1 units box
create_box 2 reg
Created orthogonal box = (-0.05 -0.05 0) to (0.05 0.05 0.1)
2 by 2 by 2 MPI processor grid

neighbor 0.002 bin
neigh_modify delay 0

variable dt equal 1e-5
variable nStepsRun equal 1.0/${dt}
variable nStepsRun equal 1.0/1e-05
variable writeOutEvery equal 0.005/${dt}
variable writeOutEvery equal 0.005/1e-05
variable thermofreq equal 0.01/${dt}
variable thermofreq equal 0.01/1e-05

variable cf_ww equal 1.0
variable cf_pw equal 0.5
variable cf_pp equal 0.5

variable cof_ww equal 0.5
variable cof_pw equal 0.5
variable cof_pp equal 0.5

variable corf_ww equal 0.
variable corf_pw equal 0.05
variable corf_pp equal 0.05

#variable coefficientRollingViscousDamping_ww equal 0.0
#variable coefficientRollingViscousDamping_pw equal 0.0
#variable coefficientRollingViscousDamping_pp equal 0.0

variable Yw equal 1e+7
variable Yp equal 1e+7

#Material properties required for new pair styles
fix m1 all property/global youngsModulus peratomtype ${Yw} ${Yp}
fix m1 all property/global youngsModulus peratomtype 10000000 ${Yp}
fix m1 all property/global youngsModulus peratomtype 10000000 10000000
fix m2 all property/global poissonsRatio peratomtype 0.3 0.3
fix m3 all property/global coefficientRestitution peratomtypepair 2 ${cf_ww} ${cf_pw} ${cf_pw} ${cf_pp}
fix m3 all property/global coefficientRestitution peratomtypepair 2 1 ${cf_pw} ${cf_pw} ${cf_pp}
fix m3 all property/global coefficientRestitution peratomtypepair 2 1 0.5 ${cf_pw} ${cf_pp}
fix m3 all property/global coefficientRestitution peratomtypepair 2 1 0.5 0.5 ${cf_pp}
fix m3 all property/global coefficientRestitution peratomtypepair 2 1 0.5 0.5 0.5
fix m4 all property/global coefficientFriction peratomtypepair 2 ${cof_ww} ${cof_pw} ${cof_pw} ${cof_pp}
fix m4 all property/global coefficientFriction peratomtypepair 2 0.5 ${cof_pw} ${cof_pw} ${cof_pp}
fix m4 all property/global coefficientFriction peratomtypepair 2 0.5 0.5 ${cof_pw} ${cof_pp}
fix m4 all property/global coefficientFriction peratomtypepair 2 0.5 0.5 0.5 ${cof_pp}
fix m4 all property/global coefficientFriction peratomtypepair 2 0.5 0.5 0.5 0.5
fix m5 all property/global coefficientRollingFriction peratomtypepair 2 ${corf_ww} ${corf_pw} ${corf_pw} ${corf_pp}
fix m5 all property/global coefficientRollingFriction peratomtypepair 2 0 ${corf_pw} ${corf_pw} ${corf_pp}
fix m5 all property/global coefficientRollingFriction peratomtypepair 2 0 0.05 ${corf_pw} ${corf_pp}
fix m5 all property/global coefficientRollingFriction peratomtypepair 2 0 0.05 0.05 ${corf_pp}
fix m5 all property/global coefficientRollingFriction peratomtypepair 2 0 0.05 0.05 0.05
fix m6 all property/global characteristicVelocity scalar 1.0
fix m7 all property/global coefficientRollingViscousDamping peratomtypepair 2 0.0 0.0 0.0 0.0

#New pair style
pair_style gran model hertz tangential history rolling_friction epsd2 surface superquadric #Hertzian without cohesion
pair_coeff * *
timestep ${dt}
timestep 1e-05

variable totaltime equal step*${dt}
variable totaltime equal step*1e-05

#fix cad all mesh/surface/stress file meshes/simple_chute.stl type 1 wear finnie
#fix inface all mesh/surface file meshes/insertion_face.stl type 1
#fix granwalls all wall/gran model hertz tangential history surface superquadric mesh n_meshes 1 meshes cad

fix xwalls1 all wall/gran model hertz tangential history rolling_friction epsd2 surface superquadric primitive type 1 xplane -0.05
fix xwalls2 all wall/gran model hertz tangential history rolling_friction epsd2 surface superquadric primitive type 1 xplane 0.05
fix ywalls1 all wall/gran model hertz tangential history rolling_friction epsd2 surface superquadric primitive type 1 yplane -0.05
fix ywalls2 all wall/gran model hertz tangential history rolling_friction epsd2 surface superquadric primitive type 1 yplane 0.05
fix zwalls1 all wall/gran model hertz tangential history rolling_friction epsd2 surface superquadric primitive type 1 zplane 0.0
fix zwalls2 all wall/gran model hertz tangential history rolling_friction epsd2 surface superquadric primitive type 1 zplane 0.1

create_atoms 1 single 0.0 0.0 0.01
Created 1 atoms
ERROR on proc 2: Substitution for illegal variable (../input.cpp:505)
`�&V (../input.cpp:505)
ERROR on proc 3: Substitution for illegal variable (../input.cpp:505)
`��A�V (../input.cpp:505)
ERROR on proc 4: Substitution for illegal variable (../input.cpp:505)
p
�V (../input.cpp:505)
ERROR on proc 5: Substitution for illegal variable (../input.cpp:505)
p���U (../input.cpp:505)
ERROR on proc 6: Substitution for illegal variable (../input.cpp:505)
p\�C�U (../input.cpp:505)
ERROR on proc 7: Substitution for illegal variable (../input.cpp:505)
p,�rkU (../input.cpp:505)
set atom 1 type 2 shape 0.002 0.002 0.004 blockiness ${blockiness1} ${blockiness2} density 2500 vz 0.1 quat 1 0 0 ${angle} #omegaz 10
ERROR on proc 0: Substitution for illegal variable (../input.cpp:505)
�SyA�U (../input.cpp:505)
ERROR on proc 1: Substitution for illegal variable (../input.cpp:505)
`�SϭU (../input.cpp:505)
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun has exited due to process rank 7 with PID 336084 on
node hp exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[hp:336076] 7 more processes have sent help message help-mpi-api.txt / mpi-abort
[hp:336076] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

mschramm | Mon, 01/17/2022 - 04:17

The file I am referencing is the file YOU were to create from the warning message.
However the new issue is that you have duplicate entries in the contact model files.
Please remove all but one of the duplicates and clean and recompile.

From the log you posted, it seems that the contact model has been accepted and you simple did not create the needed vars for that input script.
You need to define
blockiness1
blockiness2
and
angle
via the -var command
-var blockiness1 ${value} -var blockiness2 ${value} -var angle ${value}

lakshmiIC35134 | Mon, 01/17/2022 - 12:01

I removed the duplicate entries as you mentioned and recompiled.
I added the required input variables in the file and ran the code. The following error occurred:

ERROR on proc 1: Substitution for illegal variable (../input.cpp:505)
ERROR on proc 0: Substitution for illegal variable (../input.cpp:505)

Kindly let me know how to resolve this error.

mschramm | Mon, 01/17/2022 - 17:21

Hello,
The input scripts states the the user needs to define 3 variables. If your liggghts command is linked to "liggghts" and the input script is named "in.liggghts", then you would want to issue the command

liggghts -var blockiness1 2 -var blockiness2 2 -var angle 0 -in in.liggghts

where the blockiness values dictate the shape of the particle (2 -> sphere, 10-> cube).

lakshmiIC35134 | Tue, 01/18/2022 - 14:54

I tried my best to use the liggghts command. I installed it. I renamed the input file to in.liggghts and gave the command you asked me to. I am getting this error:
LIGGGHTS (Version LIGGGHTS-PUBLIC 3.8.0, compiled 2020-03-23-07:35:01 by root, git commit unknown)

atom_style superquadric
ERROR: Invalid atom style (/build/liggghts-YO7u74/liggghts-3.8.0+repack1/src/atom.cpp:459)

Kindly let me know how to resolve this. Thank you for your patience.

mschramm | Tue, 01/18/2022 - 15:37

Hello,
I worded my last response in that way because I do not know how you installed your liggghts program.
I also don't know what you just did to loose the superquadratic atom_style. I'm assuming that you tried installing liggghts using a app manager.
Treat my last comment simply as a patern that you should have followed using your compiled version of liggghts.

${WhatEverYouCalledYourLiggghtsInstall} -var blockiness1 2 -var blockiness2 2 -var angle 0 -in ${WhatEverYouCalledYourInputFile}

lakshmiIC35134 | Tue, 01/18/2022 - 16:40

Thanks a lot for helping me. It worked!

Narayani | Mon, 01/17/2022 - 07:34

hello , the particle type is superquadric and i need to visualize the dump files generated using the local/gran vtk command in paraview.
the file is getting saved as superq.vtk , however paraview is unable to see it.
also for visualising force chains apart from the contact forced what other parameters can i output?
thanks!
narayani

lakshmiIC35134 | Thu, 01/20/2022 - 08:48

I tried following your steps to veiw the in-built superquadric example using paraview.

But I am not understanding how to do this part:
Sources:

* custom/vtk dump with defined values
dump dmp all custom/vtk 100 post/dump*.superq.vtk id type mass x y z vx vy vz fx fy fz omegax omegay omegaz radius shapex shapey shapez quat1 quat2 quat3 quat4 blockiness1 blockiness2 tqx tqy tqz angmomx angmomy angmomz

Minimal requirements: y z blockiness1 blockiness2 shapex shapey xshapez quat1 quat2 quat3 quat4

* custom dump with defined values
dump dmp all custom 100 post/dump*.superq id type mass x y z vx vy vz fx fy fz omegax omegay omegaz radius shapex shapey shapez quat1 quat2 quat3 quat4 blockiness1 blockiness2 tqx tqy tqz angmomx angmomy angmomz

Minimal requirements: x y z blockiness1 blockiness2 shapex shapey shapez quat1 quat2 quat3 quat4

Convert via lpp tool into vtk afterwards
cd post
lpp dump*.superq

Kindle help.

deepakpawar.2310 | Fri, 01/21/2022 - 05:06

HI

I guess you need to implement following in the code very carefully
(1) Contact model
pair_style gran model hertz tangential history rolling_friction epsd2 surface superquadric #Hertzian without cohesion
(2) Need to change the atom style
atom_style superquadric
(3) NVE Integration as follows
fix integr all nve/superquadric integration_scheme 1
(4) FInaly the dump command
dump dmp all custom/vtk ${writeOutEvery} post/dump*.superq.vtk type mass x y z id vx vy vz fx fy fz omegax omegay omegaz radius shapex shapey shapez quat1 quat2 quat3 quat4 blockiness1
blockiness2 tqx tqy tqz angmomx angmomy angmomz

It may gonna work !

Thank you

Happy learning !!

lakshmiIC35134 | Fri, 01/21/2022 - 09:58

I tried everything you said. But I am ending up with the following error in the paraview:

Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'paraview'

How do I resolve this? Kindly let me know.