Initialize a large PER-ATOM ARRAY define by FIX PROPERTY/ATOM

Submitted by leaso on Wed, 03/25/2015 - 23:22

Dear LIGGGHTS users and developers,

I have a simple question where I want to initialize a large(100-1000) PER-ATOM ARRAY define by FIX PROPERTY/ATOM.
Since LIGGGHTS expects the size to be defined through the input script, is there any easy way to define the size in the .cpp/.h file instead of:

fix LL all property/atom LL vector yes no no 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0....(100 times)

I get the following error when the size in the input script size does not match the size in the .cpp file.
error: Fix property/atom variable LL has wrong length (length is 18 but length 100 expected) for usage with caller YY (fix_property_atom.cpp:195)

Thanks for any help/tips in advance!

Sincerely,
Liz

ckloss's picture

ckloss | Fri, 04/03/2015 - 09:40

Hi Liz,

currently the only way is via the input schrip - since it was never anticipated that 100-1000 per-particle values should be stored in one fix property/atom.
But fix property/atom.cpp could easily be modified - look at the FixPropertyAtom::parse_args function

Best wishes
Christoph

leaso | Wed, 08/12/2015 - 16:46

Dear LIGGGHTS users and developers,
Thanks for your reply!
I had a related question to fix_property_atom. Is there any way to set the property/atom LL to a value in distribution depending on the position say x,y or z?
For eg. radius of particle(x)= R*x
I could not find any similar input script command.
Or is there any files you could point me to which is similar?
Thanks,
Liz