function z=getgriddata(beamelem,grids)
%INPUT function xyz=getgriddata(beamelem,grids)
%Create array z of size num_grids x 1 (1 for z)
%of space coordinates for each grid. 

num_grids=2;

z=zeros(num_grids,1);

for i=1:num_grids,
	z(i)=grids(beamelem.g(i)).grid.z;
end
