Hi colleagues,
I am facing a problem about outputing the magnitude and average of contact force, but failed.
To obtain the contact force, I use command:
compute fc all pair/gran/local pos id force (the 10-12th values are the contact forces on x,y,z directions)
Then I use:
variable avefc atom sqrt(c_fc[10]^2+c_fc[11]^2+c_fc[12]^2)
to calculate the magnitude of contact force.
To obtain the average of the contact force, I use command:
compute meanCF all reduce ave v_avefc
varaible vmeancf equal c_meanCF
fix outp all print 1000 "${vmeancf}" screen no title "vmeancf" file force.txt (to output the average of contact force)
However, it reports the Error: "mismatched compute in variable formula."
How could I get the magnitude and average of the contact force? Any clues are appreciated!
Best,
Rachel
Daniel Queteschiner | Fri, 01/18/2019 - 09:39
contact data vs atom data
compute pair/gran/local
is computing per-contact data, a variable of typeatom
is expecting per-atom data. Hence the sizes don't match.I suggest to print the contact data to a file (e.g. using
dump local
) and use matlab, octave, ... to postprocess it afterwards.