0% found this document useful (0 votes)
32 views5 pages

Introduction To The FE Method in Geosciences: Numerical Integration

This document introduces numerical integration using Gauss-Legendre quadrature. It discusses how numerical integration can be used to solve integrals that arise in the finite element method on distorted elements. Gauss-Legendre quadrature approximates integrals using a weighted sum of function values at specified integration points. For 1D integrals it uses 2 points by default, and the weights and points can be extended to 2D integrals using a product rule. An example integration of a 1D function is provided to demonstrate the method.

Uploaded by

RMRE UET
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

Introduction To The FE Method in Geosciences: Numerical Integration

This document introduces numerical integration using Gauss-Legendre quadrature. It discusses how numerical integration can be used to solve integrals that arise in the finite element method on distorted elements. Gauss-Legendre quadrature approximates integrals using a weighted sum of function values at specified integration points. For 1D integrals it uses 2 points by default, and the weights and points can be extended to 2D integrals using a product rule. An example integration of a 1D function is provided to demonstrate the method.

Uploaded by

RMRE UET
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Introduction to the FE method in

geosciences
Lecture 3.1:
Numerical integration

IntroFEM 03 – Numerical Integration 1

Motivation
→ Deformable Grid

IntroFEM 03 – Numerical Integration 2

1

Motivation
→ Lecture 1: FEM Introduction 1D
  Integral form of system of equations

  How do we solve these integrals


on a distorted element?
  NUMERICALLY !!!
IntroFEM 03 – Numerical Integration 3

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

  So, it does not solve the problem of the distorted


elements, yet.
  A coordinate transformation from the distorted element to
the idealized element is needed in addition.
See next lecture.

IntroFEM 03 – Numerical Integration 4

2

Gauss-Legendre-Quadrature
→ For 1D
  Formula

  Integration points and


weights

n xn wn
1 0 2
  The function f only
2 1 needs to be known at
3 the integration points.

IntroFEM 03 – Numerical Integration 5

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:

IntroFEM 03 – Numerical Integration 6

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

  Integration points are similar to


the 1D case. Weights can be
defined as a multiplicative
combination of the 1D case
  eg.

IntroFEM 03 – Numerical Integration 7

% DATA FOR NUMERICAL INTEGRATION


Ngl = [3 3]; % 2x2 Gauss-Legendre quadrature
POINT = zeros(length(Ngl),prod(Ngl));
Weight = zeros(prod(Ngl),1);
Point(1) = -0.774596669241483;
Point(2) = 0.0;
Point(3) = -Point(1);
Weight_(1) = 0.555555555555556;
Weight_(2) = 0.888888888888889;
Weight_(3) = Weight_(1);
intp = 0;
for intx=1:Ngl(1)
for inty=1:Ngl(2)
intp = intp+1;
POINT(:,intp) = [Point(intx) Point(inty)]';
Weight(intp) = Weight_(intx)*Weight_(inty);
end
end

IntroFEM 03 – Numerical Integration 8

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

% Compute kinematic/strain matrix


ii =([1:no_node_perel]-1)*no_dof+1; % working indexes arrays
B(1,ii ) = DHDX(1,:);
B(2,ii+1) = DHDX(2,:);
B(3,ii ) = DHDX(2,:);
B(3,ii+1) = DHDX(1,:);

% 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

% LOCAL STIFFNESS MATRIX


K = K +( B'*D*B )*wtx*detjacob; % element stiffness matrix

% 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 ===================================

IntroFEM 03 – Numerical Integration 9

You might also like