Introduction To The FE Method in Geosciences: Numerical Integration
Introduction To The FE Method in Geosciences: Numerical Integration
geosciences
Lecture 3.1:
Numerical integration
Motivation
→ Deformable Grid
1
Motivation
→ Lecture 1: FEM Introduction 1D
Integral form of system of equations
Gauss-Legendre-Quadrature
→ General comments
Numerical integration with Gauss-Legendre-Quadrature
only works on an idealized Element
For x = -1 to 1 in 1D
For x = -1 to 1 and y = -1 to 1 in 2D
2
Gauss-Legendre-Quadrature
→ For 1D
Formula
n xn wn
1 0 2
The function f only
2 1 needs to be known at
3 the integration points.
Gauss-Legendre-Quadrature
→ Example
Integrate by hand and “numerically” with 3
integration points: n xn wn
3 − 3 ,0, 3 5 ,8 ,5
5 5 9 9 9
By hand:
Numerically:
3
Gauss-Legendre-Quadrature
→ For 2D
Formula
∫ ∫ f (ξ ,η ) d ξdη = ∑ ∑ f (ξ ,η ) w w = ∑ f (ξ ,η ) w
1 1 nξ nη nip
i j i j n n n
−1 −1 i=1 j=1 n=1
4
for intp=1:no_intpoi % ============================ INT.PTS. LOOP ======================================
wtx = Weight(intp); % weight
% Get parameters to perform coordinate transformation from natural to global element coordinates
DHDS = DHDS_A(:,:,intp)';
jacob = DHDS*COORD; % compute Jacobian
detjacob = det(jacob); % determinant of Jacobian
invjacob = inv(jacob); % inverse of Jacobian matrix
DHDX = invjacob*DHDS; % derivatives w.r.t. real coordinates
% STRAIN RATES
STRAIN_RATES(:,intp,iel) = B*A_old(Index);
E = MATPROP(1,Phase(iel));
nu = MATPROP(2,Phase(iel));
prefac = E/((1+nu)*(1-2*nu));
D = prefac * [ 1-nu nu 0; nu 1-nu 0; 0 0 (1-2*nu)/2];
% STRESS UPDATE
STRESSES(:,intp,iel) = STRESSES_OLD(:,intp,iel) + D*B*A_old(Index);
% CORRDINATES
STRESS_GCOORD(1,intp,iel) = H(:,intp)'*COORD_OLD(:,1); % X-coordinate
STRESS_GCOORD(2,intp,iel) = H(:,intp)'*COORD_OLD(:,2); % Y-coordinate
% RHS VECTOR
F_v(Index_v_local) = F_v(Index_v_local) - ( B'* (STRESSES_OLD(:,intp,iel)) )*wtx*detjacob;
F_v(Index_v_local(ii+1)) = F_v(Index_v_local(ii+1))-( MATPROP(3,Phase(iel))*gravity *H(:,intp))*wtx*detjacob;
end % ============================================= END OF INT.PTS. LOOP ===================================