i have a code
#!perl
use strict;
use Getopt::Long;
use MaterialsScript qw(:all);
################ Input ####################
my \$doc = \$Documents{"1010.xtd"}; # xtd file name
#\$doc->CurrentFrame = \$doc->EndFrame; # frame number of xtd file (end frame)
\$doc->CurrentFrame = 1201; # frame number of xtd file (user defined frame number)
\$doc->GenerateLatticeDisplay(["PeriodicDisplayType" => "In-Cell"]); # Display mode
###########################################
my \$std = Documents->New("1010.std");
\$std->ColumnHeading(0) = "Element Symbol";
\$std->ColumnHeading(1) = "Position X (angstrom)";
\$std->ColumnHeading(2) = "Position Y (angstrom)";
\$std->ColumnHeading(3) = "Position Z (angstrom)";
\$std->ColumnHeading(4) = "Velocity X (angstrom/ps = 100m/s)";
\$std->ColumnHeading(5) = "Velocity Y (angstrom/ps = 100m/s)";
\$std->ColumnHeading(6) = "Velocity Z (angstrom/ps = 100m/s)";
\$std->ColumnHeading(7) = "Kinetic E of atom (eV)";
my \$atoms = \$doc->UnitCell->Atoms; #scalar
my \$i = -1;
my \$AvoN = 6.02*10**23;
my \$KJmolToeV = 96.5;
my @atoms; #
foreach my \$atom (@\$atoms) {
my \$vel = \$atom->Velocity;
#my \$atomicnumber = \$atom->AtomicNumber;
if(\$atom->ElementSymbol eq "H"){
\$i = \$i + 1;
print "Element symbol = ", \$atom->ElementSymbol, " Position = ", \$atom->X, \$atom->Y, \$atom->Z, " Velocity =", \$vel->x, \$vel->y, \$vel->z, "\n";
\$std->Cell(\$i,0) = \$atom->ElementSymbol;
\$std->Cell(\$i,1) = \$atom->X;
\$std->Cell(\$i,2) = \$atom->Y;
\$std->Cell(\$i,3) = \$atom->Z;
\$std->Cell(\$i,4) = \$vel->x;
\$std->Cell(\$i,5) = \$vel->y;
\$std->Cell(\$i,6) = \$vel->z;
\$std->Cell(\$i,7) = 0.5*((\$vel->x)**2+(\$vel->y)**2+(\$vel->z)**2)*10**-4;
}
if(\$atom->ElementSymbol eq "H" and 0.5*((\$vel->x)**2+(\$vel->y)**2+(\$vel->z)**2)*10**-4 < 0.0005){
push(@atoms, \$atom);
}
}
\$doc->CreateSet("absorbedH", \@atoms);
this code works well, but just only got atoms velocitiy,
i want to know "H2" 's Net velocity how can i do for?