Arithmetic operations with computes

Hi all,

Is it possible to do arithmetic operations with computes?

let’s say I want to compute per atom charge and per atom velocity (two separate computes) and then multiply them and get some per atom quantity (some sort of charge flux per atom). later I’m thinking of using it in an ave/correlate fix.

In case there is a better way to calculate charge flux, I’ll appreciate it to let me know.

Thanks,
Siamak

You don’t need computes for that, but can use atom style variables. there you have already access to per-atom charge and velocity components. the challenge is to get this into a 3-vector for fix ave/correlate.

Thank you! I think this answers my question.

Looks like if I write something like:

variable cfx atom vector vx*q, it will give me what I want (in x direction). I’ll try this with some simple models and see how I can calculate what I’m looking for.

Thanks,
Siamak