outputting per-atom values from the code

Submitted by Silias on Fri, 03/09/2012 - 13:23

Hi everybody,

I'm calculating per-atom-values in a fix within the LIGGGHTS-code. Now I'm wondering how is the easiest way for outputting them. Right now they are stored in an array like that:
peratom_prop = (double*)memory->create_1d_double_array(0, nlocal, "peratom_prop");

1.: Outputting the per-atom-vector by the fix, which then could be stored in a variable of the inputskript and which then also could be used within the dump custom command?

2.: directly access this per-atom-vector by the dump-custom-command.

Unfortunately I don't have a clue for both ways how to proceed...

Can you give me a hint?

Thanks very much and kind regards,
Sebastian

ckloss's picture

ckloss | Mon, 03/12/2012 - 15:42

Hi Sebastian,

>>peratom_prop = (double*)memory->create_1d_double_array(0, nlocal, "peratom_prop");
using a per-atom property like this is strongly discouraged, for a couple of reasons (e.g. you can't easily output that stuff, and lots of other issues as well).

Look at the code in fix_scalar_transport_equation.h/cpp, there you see how a property can be registered via a fix property/atom command.
You can then output this property f_[...] in a dump custom command

Cheers, Christoph