Forcefield Array

Submitted by Bernhard on Thu, 09/28/2017 - 11:47

Hey all,

I have got a 2D-array of different values for a force field depending on the region from another program (matlab) in a txt.file (other files are also easily possible).
I want to add these values via the addforce command to the particles in my simulation.
Depending on the position of each particle, it should give me an unique forcevector.

The problem is, that LIGGGHTS seems to not be able to handle variables from other files. I can't create variable vectors/arrays out of the file I want to load into the script. Also, there seems to be no coupling between the atom style particle vectors and another vector possible.

I would like to let the system operate like this (this is not a real code at all, its just for illustration):
variable xposition atom x
variable zposition atom z
variable force atom 1
variable forcearray[j][k]

variable i loop atoms
variable v_force[$i] equal forcearray[xposition[$i]][zposition[$i]]
fix force1 all addforce 0 0 v_force

regards,
Bernhard