Is there a more efficient way to access an output of one fix from another fix

Hello,

I am currently developing a new fix and I would like to access to the average value of a per-atom ouput produced by another fix (fix ave/Atom in particular).

For this purpose I wrote a function that should return this quantity. I found in this mailing list that the compute_scalar() method could do it but it doesn’t seem to work!

Is there a more efficient way to access an output of one fix from another fix ?

here is the function:

void FixDISSOLVE::get_average(char *id_fix, double *&ptr)

{

int ifix;

int ifix = modifyy->find_fix(id_fix);

if(ifix!=-1) ptr2 = modify->fix[ifix]->compute_scalar();

else error->all(FLERR, “Compute charge average require fix average group ave/atom”);

}

Thanks in advance

Brahim

Hello,

I am currently developing a new fix and I would like to access to the average value of a per-atom ouput produced by another fix (fix ave/Atom in particular).

For this purpose I wrote a function that should return this quantity. I found in this mailing list that the compute_scalar() method could do it but it doesn’t seem to work!

how should it? Fix::compute_scalar() computes a global scalar, not a per-atom property.

Is there a more efficient way to access an output of one fix from another fix ?

since you mentioned fix ave/atom, you can look at this fix for an example of how to access per-atom properties of another fix, since this fix allows to compute per-atom time averages of (per-atom) fix properties. just look for code blocks where the FIX enumerator constant is used.

axel.