about variable

Submitted by g.garate on Wed, 05/01/2013 - 20:03

Hi all,
I've been trying to use the variable command in order to get the position of one particule in every timestep. I haven't been able to store the position of them but I have been able to store other variables like mass, time and number of particles that cross a region.

here is my input script (in this one there is just one particle) , please tell me what is wrong with it.

variable masa1 equal mass(all,reg1)
variable cant1 equal count(all,reg1)
variable masa2 equal mass(all,reg2)
variable cant2 equal count(all,reg2)
variable t equal step*dt #where dt = the timestep size
variable coord atom x[1]

fix out all print 800 &
"$t,${masa1},${cant1},${masa2},${cant2},${x[1]}" &
file out.csv screen no &
title "t,masa1,cant1,masa2,cant2,coord"

I would also like know if it is possible to get the position of all the particules who cross a plane.
Thanks in advance

richti83's picture

richti83 | Wed, 05/01/2013 - 22:33


variable coord atom x[1] #the variable NAME is coord

fix out all print 800 &
"$t,${masa1},${cant1},${masa2},${cant2},${x[1]}" #use the NAME instead !

about the 2nd question: I would solve this in postprozess with paraview: make a clip of type box with the height of your particle diameter and export the result in any format you like.
Otherwise you could try to adept the fix/massflow/surface in c++ or add every particle in a special region to a special group and dump / output only this group ... many possibilities .. pls tell us what you want to achieve !

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

g.garate | Thu, 05/02/2013 - 15:49

Thanks richti83:

About the first question:
You were right, I've made a mistake with the variable name but I still have the same problem.

variable t equal step*dt
variable coord atom x[1]
fix out all print 800 "$t,${coord}" file out.csv screen no title "t,coord"

ERROR on proc 0: Substitution for illegal variable (input.cpp:410)

About the second question:
I've managed to get the position of the particles in paraview making a clip, as you said. But I just can do this in one frame. I want to get the position of the particles who crosses a plane in each timestep in order to study how the flow cross section evolves in time.

Regards

g.garate | Thu, 05/02/2013 - 17:36

As far as the first question is concerned I solved the problem using "equal" instead "atom", but I can't find out how to print a vector yet.