Fix style compute_scalar/array/vector function

Dear All,

I’m trying to write a new fix style similar to fix efiled which works through post_force method. But I’m a little confused with compute_scalar and compute_vector. It seems they are useful only if I want to output some results gotten from the fix. But they are useless for the simulation. Am I correct?

Thanks in advance.

Han

Compute_scalar and compute_vector outputs scalar and vector quantities, respectively. They don’t affect the simulation, if that is what you meant by useless.

Ray

Dear All,

I'm trying to write a new fix style similar to fix efiled which works
through post_force method. But I'm a little confused with compute_scalar and
compute_vector. It seems they are useful only if I want to output some
results gotten from the fix. But they are useless for the simulation. Am I
correct?

those are optional, but for compute_scalar might be useful to have it
output the interaction energy due to your fix, so it can be properly
used during minimization and for tracking energy conservation.

axel.