0% found this document useful (0 votes)
31 views

Function: 'WARNING Integration Failed After 8 Subdivisions!'

This function numerically integrates subdivided elements to calculate singular integrals needed for boundary element analysis. It checks if the element is regular and performs Gauss quadrature if so, otherwise it recursively subdivides the element into two and integrates the sub-elements. The integrals are used to calculate strain and displacement fields due to fundamental solutions for a point load.

Uploaded by

Marcio Jairo
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Function: 'WARNING Integration Failed After 8 Subdivisions!'

This function numerically integrates subdivided elements to calculate singular integrals needed for boundary element analysis. It checks if the element is regular and performs Gauss quadrature if so, otherwise it recursively subdivides the element into two and integrates the sub-elements. The integrals are used to calculate strain and displacement fields due to fundamental solutions for a point load.

Uploaded by

Marcio Jairo
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

%------------------------------------------------------------------------function [sM1,sM2,sM3,sM4] = integrateSubDivision( sdv, sM1, sM2, sM3, sM4,

dL, xp, yp, x1, y1, x2, y2, xe1, ye1, xe2, ye2 )
[dR,xi,yi] = closestDistance(xp,yp,x1,y1,x2,y2);
dLs = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
dLs = dL*dLs/2.0;
isRegular = 1;
if( dR/dLs < 0.97 ) % order 1/r^2 and 0.29 for order 1/r
isRegular = 0;
end
if( 1 == isRegular )
% get the Gauss points for the regular integrations
nGaussPts = 4;
[x,w] = gaussQuadraturePts( nGaussPts );
dN1ds = -0.5;
dN2ds = +0.5;
dxds = dN1ds*xe1 + dN2ds*xe2;
dyds = dN1ds*ye1 + dN2ds*ye2;
J = sqrt( dxds*dxds + dyds*dyds );
nx = dyds/J;
ny = -dxds/J;
% loop over the gauss points for numerical integration
for g=1:nGaussPts
N1 = (1.0-x(g))*0.5;
N2 = (1.0+x(g))*0.5;
Qx = N1*x1 + N2*x2;
Qy = N1*y1 + N2*y2;
csi = 0.0;
if( abs(xe2-xe1) < abs(ye2-ye1) )
csi = ( (ye1+ye2) - 2.0*Qy ) / (ye1-ye2);
else
csi = ( (xe1+xe2) - 2.0*Qx ) / (xe1-xe2);
end
N1e = (1.0-csi)*0.5;
N2e = (1.0+csi)*0.5;
% fundamental solution
T = fundsolT( xp, yp, Qx, Qy, nx, ny );
U = fundsolU( xp, yp, Qx, Qy, nx, ny );
S = fundsolS( xp, yp, Qx, Qy, nx, ny );
D = fundsolD( xp, yp, Qx, Qy, nx, ny );
% shape functions for linear elements
N = zeros(2,4);
N(1,1) = N1e; N(1,3) = N2e;
N(2,2) = N1e; N(2,4) = N2e;
sM1 = sM1 + w(g)/sdv * T * N * J;
sM2 = sM2 + w(g)/sdv * U * N * J;
sM3 = sM3 + w(g)/sdv * S * N * J;
sM4 = sM4 + w(g)/sdv * D * N * J;
end
else
if( sdv > 8 )
disp('WARNING integration failed after 8 subdivisions!');
return;
end
s1Hne = zeros(2,4);
s2Hne = zeros(2,4);
s1Gne = zeros(2,4);

s2Gne = zeros(2,4);
s1Sne = zeros(3,4);
s2Sne = zeros(3,4);
s1Dne = zeros(3,4);
s2Dne = zeros(3,4);
%if ( xi == _x1 && yi == _y1 )
%
xi = 0.5*(x2+x1);
yi = 0.5*(y2+y1);
%end
%if ( xi == _x2 && yi == _y2 )
% xi = 0.5*(_x2+_x1);
% yi = 0.5*(_y2+_y1);
%end
[s1Hne,s1Gne,s1Sne,s1Dne] =
integrateSubDivision(2*sdv,s1Hne,s1Gne,s1Sne,s1Dne,dL,xp,yp,x1,y1,xi,yi,xe1,y
e1,xe2,ye2);
[s2Hne,s2Gne,s2Sne,s2Dne] =
integrateSubDivision(2*sdv,s2Hne,s2Gne,s2Sne,s2Dne,dL,xp,yp,xi,yi,x2,y2,xe1,y
e1,xe2,ye2);
sM1 = s1Hne + s2Hne;
sM2 = s1Gne + s2Gne;
sM3 = s1Sne + s2Sne;
sM4 = s1Dne + s2Dne;
end
return
%-------------------------------------------------------------------------

You might also like