% This function writes the positions of the particles out in a xyz file format.
function velocity_xyz(t, N, partiden, m, pn, velFile);

% t        = Current time
% N        = Number of particles
% partiden = Array of particle type (C or S)
% m        = Mass of one particle
% pn       = Momentum of the particle (vector)
% velFile  = Velocity out file pointer

% Writes the particle velocity to a .xyz file for visualization with Charm.
fprintf(velFile, '%d\n%d\n', N, t);
for i = 1:N
  fprintf(velFile, '%c\t %g\t %g\t %g\n', partiden(1,i), pn(i,1)/m(1,i), pn(i,2)/m(1,i), pn(i,3)/m(1,i));
end;
fprintf(velFile, '\n');

