% .............................................................
function [weights,locations]=gaussQuadrature2D(option)
% Gauss quadrature for Q4 elements
% option 'complete' (2x2)
% option 'reduced' (1x1)
% locations: Gauss point locations
% weights: Gauss point weights
switch option
case 'complete'
locations=...
[ -0.577350269189626 -0.577350269189626;
0.577350269189626 -0.577350269189626;
0.577350269189626 0.577350269189626;
-0.577350269189626 0.577350269189626];
weights=[ 1;1;1;1];
case 'reduced'
locations=[0 0];
weights=[4];
case '6d'
d(1)=0.932469514203152;
d(2)=-0.932469514203152;
d(3)=0.661209386466256;
d(4)=-0.661209386466256;
d(5)=0.238619186083197;
d(6)=-0.238619186083197;
D(1)=0.171324492379179;
D(2)=0.171324492379179;
D(3)=0.360761573048139;
D(4)=0.360761573048139;
D(5)=0.467913934572691;
D(6)=0.467913934572691;
for l=1:6
for i=1:6
for j=1:6
% locations((i-1)*36+(j-1)*6+l,:)=[d(i),d(j),d(l)];
% weights((i-1)*36+(j-1)*6+l,1)=D(i)*D(j)*D(l);
locations((l-1)*36+(i-1)*6+j,:)=[d(i),d(j),d(l)];
weights((l-1)*36+(i-1)*6+j,1)=D(i)*D(j)*D(l);
end
end
end
end
end % end function gaussQuadrature