Calculation of the electric current

Dear Lammps-users,

I would like to know whether it is possible to calculate the electric current without dumping the velocity vector and performing postprocessing. So far as I understand it is possible to use the command “variable current equal vz*q” to create a vector composed of the product of the particle velocity and the particle charge. In order to obtain the electric current the components of this vector must be summed up. As far as I understand after reading the manual, the compute reduce command and the special function “sum” of the variable command can be used to sum up vector components. However, these vectors must have been calculated by the compute or fix commands. Therefore, I wonder whether there is a way of summing up the components of a vector created by the variable command?

Thank you in advance for an answer,

Sten Sarman

Dear Lammps-users,

I would like to know whether it is possible to calculate the electric
current without dumping the velocity vector and performing postprocessing.
So far as I understand it is possible to use the command "variable current
equal vz*q" to create a vector composed of the product of the particle
velocity and the particle charge. In order to obtain the electric current
the components of this vector must be summed up. As far as I understand
after reading the manual, the compute reduce command and the special
function "sum" of the variable command can be used to sum up vector
components. However, these vectors must have been calculated by the compute
or fix commands. Therefore, I wonder whether there is a way of summing up
the components of a vector created by the variable command?

yes. via compute reduce sum. please have another look at the
documentation. it does allow atom style variables as input.

axel.