Hello
This is much easier to do if you use version 2.10 or the master version of Plumed. For those versions of PLUMED you can use an input like this:
d: DISTANCE ATOMS1=1,2 ATOMS2=3,4 ATOMS3=5,6
c: CUSTOM ARG=d FUNC=x*x PERIODIC=NO
In this input a vector of distances is passed to the CUSTOM action. The function (in this case squaring the eleemnts of the input vector) is applied elementwise to this vector so the output is a vector that contains the squares of the input distances.
As it is a CUSTOM action you can do whatever you want to the input vector.
Notice also that instead of using CUSTOM you can do:
d: DISTANCE ATOMS1=1,2 ATOMS2=3,4 ATOMS3=5,6
c: LESS_THAN ARG=d SWITCH={RATIONAL R_0=0.1}
which will output a vector that contains all the distances transformed by a switching function.
To get the new version of the code use the command:
and then compile and build in the normal way.
I hope this helps
Gareth