1 function cog = cog_elements_alu3d_hexa(M);
2 %
function cog = cog_elements_alu3d_hexa(M);
4 %
function computing the cog of the elements of a hexaeder alu3d mesh
6 % Bernard Haasdonk 16.3.2006
8 linvind = M.elements(:)+1; % matlab/C-offset
9 X = sum(reshape(M.vertices(1,linvind),8,M.num_elements))/8;
10 Y = sum(reshape(M.vertices(2,linvind),8,M.num_elements))/8;
11 Z = sum(reshape(M.vertices(3,linvind),8,M.num_elements))/8;
15 % TO BE ADJUSTED TO NEW SYNTAX