% fig_01_15 % constant shearing displacement discontinuity on 2D line element % Crouch and Starfield (1990) chapter 5 % element centered at origin, parallel to x-axis, from -a <= x <= +a % calculate Cartesian normal stress component in x. clear all, clf reset; % initialize memory and figure dx = 0.001; % displacement discontinuity tangential to element mu = 30000; pr = 0.25; % elastic shear modulus and Poisson's ratio c = 1/(4*pi*(1-pr)); % constant multiplier for stress components a = 1; % line element half length rc = 0.09*a; % radius of dislocation core at element tips x=-2.5*a:.05*a+eps:2.5*a; % x-coords. of grid y=-2.5*a:.05*a:2.5*a; % y-coords. of grid [X,Y] = meshgrid(x,y); % Cartesian grid XMA2 = (X-a).^2; XPA2 = (X+a).^2; Y2 = Y.^2; % common terms % derivatives of stress function FCXY = c*((Y./(XMA2+Y2))-(Y./(XPA2+Y2))); FCXYY = c*(((XMA2-Y2)./(XMA2+Y2).^2)-((XPA2-Y2)./(XPA2+Y2).^2)); SXX = 2*mu*dx*(2*FCXY + Y.*FCXYY); % Cartesian stress component % eliminate values within dislocation core at tips of element R1 = sqrt((X-a).^2+Y.^2); R2 = sqrt((X+a).^2+Y.^2); SXX(find(R1<(rc))) = nan; SXX(find(R2<(rc))) = nan; contourf(X,Y,SXX,25)% plot contour map of stress component sxx title('stress sxx'), xlabel('x'), ylabel('y'), colorbar