Is it possible to add two computes together to construct a new compute?

Is it possible to add two computes together to construct a new compute like this?

compute 1 all cA/atom
compute 2 all cB/atom # 1 and 2 have the same shape
compute 3 all equal 1+2 # ??????????

Thanks!

 

Background: I’m trying to calculate the thermo conductivity with Green-Kubo formulation. Ideally I want to do something like this:

compute  myKE all ke/atom
compute  myPE all pe/atom
compute  myStress all centroid/stress/atom NULL virial
compute  flux all heat/flux myKE myPE myStress

But currently centroid/stress/atom does not support calculating kspace contributions, presumably because of the concerns presented in Revised implementation of a new atomic stress definition for correct computation of heat flux with many-body interactions by donatas-surblys · Pull Request #1704 · lammps/lammps · GitHub. I believe that two issues are irrelevant for my specific purpose (I only care about total heat flux and do not use tip4p styles), so I’d like to go forward anyway. Since the kspace contribution for virial is same for centroid/stress/atom and stress/atom, I want to write like this:

compute  myKE all ke/atom
compute  myPE all pe/atom
compute  myStressP1 all stress/atom NULL kspace
# there are no dihedral/improper/constraints in my system 
compute  myStressP2 all centroid/stress/atom NULL pair bond angle
compute  myStress equal myStressP1+myStressP2 # ????????
compute  flux all heat/flux myKE myPE myStress

However, I cannot find a way to add myStressP1 and myStressP2 together.

You can add compute outputs together by using suitable variables. In your specific case, however, that would be a pointless enterprise. The error from combining the two computes the way you want to do will be just as large, if not larger, than from using compute stress/atom for everything.

If you insist on using compute centroid/stress/atom, you have to make the suggested changes to the source code, recompile LAMMPS, AND do a careful validation of the results.