summing per atom variables -ERROR

Submitted by khalifa on Fri, 05/24/2019 - 13:18

Hello everbody,

I want to compute and plot the sum of all contacts between atoms over time:

=============================================
compute nconts all contact/atom/gran

run 0
variable totcont equal sum(c_nconts)
variable t equal step*dt

fix out1 all print 10 "$t,${totcont}" file cont.csv title "time,totcont" screen no

run 1000000
=============================================

But I am constantly getting an error

ERROR: Mismatched compute in variable formula (../variable.cpp:3222)

I am not sure why the sum or the use of c_nconts here is not allowed. Any suggestions or ideas?

Thanks in advance