Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Seoul National University Introduction to Finite Element Method Chapter 5 Two-Dimensional Element Calculations Seoul National University Aerospace Structures Laboratory 5.1 Introduction In chapter 4, we considered the variational formulation and finite-element approximation of a class of elliptic boundary-value problems in two dimensions. We now examine the necessary element calculations of 2D problems in greater detail. Our objectives here are twofold: first, to describe a general and systematic method for calculation element matrices; and second, to describe how these techniques can be incorporated into a representative finite-element code for two-dimensional problems. Our treatment of both of these subjects parallels that for the one-dimensional problems considered in chapters 2. Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation 5.2.1 Master element M x xi i ( , ) x x( , ) i 1 Te : M y y ( , ) y yi i ( , ) i 1 Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation Ne Unknowns : u a j j ( x, y ) j 1 Transformation and Solution approximation could be different NE < M : superparametric Transformation NE = M : isoparametric Transformation NE > M : subparametric Transformation Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation The expression of dx, dy in terms of , will be x x dx d d y y dy d d dx x, x, d or d dy y y , , In terms of x, y, d and d are expressed by d 1 y, x, dx , x , y dx d y x dy dy J , , , x , y Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation 5.2.2 Construction of Transformation We now come to the important issue of constructing the element transformations Te . We are guided by the following criteria: 1. Within each element, the functions ( x, y ) and ( x, y ) must be invertible and continuously differentiable (else we could not use the convenient relations(5.2.7) in element calculations) 2.The sequence of mappings {Te }must generate a mesh with no spurious gaps between elements and with no element overlapping another. 3. Each map Te should be easy to construct from the geometric data for the element. 4 . The functions ( x, y ) and ( x, y ) defining the element maps should be easy to manipulate mathematically Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation We know that the coordinate variables s x, y may themse lves be viewed simply as linear functions on e . Hence, the finite element shape functions can be utilized to construct the map Te , M ˆ ( , ), Te : x x j j j 1 M ˆ ( , ) y y j j j 1 ˆ j ˆ j 1 M 1 M yj , xj x J j 1 y J j 1 ˆ j ˆ j 1 M 1 M yj , xj (5.2.10) x J j 1 y J j 1 ˆ j M ˆ j M ˆ j M ˆ j M J x j y j x j y j j 1 j 1 j 1 j 1 Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation * Special analysis in one dimensional case for the appropriate mapping Let look at the 1-D mapping with three points x 0 1 a 2 1 3 1 2 1 (1 ) therefore, 1 if a , 8 2 1 2 1 a (1 2 ) (1 ) 2 1 a 2 a 2 2 1 2 3 (1 ) 1 0 2 1 1, 1 2a 0 2 1, 2a 1 dx 1 (1 2a) 0 d 2 1 4 3 a 4 a 2 3 1 1 3 2 1 x 2 8 2 8 8 3 24 Seoul National University Aerospace Structures Laboratory 5.2 Element Transformation Seoul National University Aerospace Structures Laboratory 5. 3 Finite Element Calculations In 2-D Finite Element formulation, we have (ku v uv)d u v u v b( x, y )u ( x, y )v( x, y ) d k ( x, y ) x x y y Let N N N j 1 j 1 j 1 u j j ( x, y ) j j ( x( , ), y ( , )) j j ( , ) and x x d d dx dx x, x, d or dy y y d y y , , dy d d Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations Recalling the expressions on the element matrix and vector from Chapter 4, e je e je e e i i bi j dxdy k k x x e y y e ij (5.3.1a) f i e f ie dxdy (5.3.1b) Pije pie je ds (5.3.1c) ie ie ds (5.3.1d) e e2 h e2 h 1 e E 1 i, j N e e2 h : boundary We must evaluate these integrals in (5.3.1) by using the concept of the master element. Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations The derivatives in the integration can be written in terms of the coordinates variables ξ and η by j ( x, y ) x j ( , ) x j ( , ) x 1 ( j , y, j , y, ) J M M 1 j , yi i , j , yi i , J i 1 i 1 j ( x, y ) y , , x , , x Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations 5.3.1 Master-Element Calculations We begin by choosing a master element and the appropriate shape functions and will calculate integrals of eq.(5.3.1) in coordinates ξ and η. 1. Element Maps : Element coordinate map Te is Ne ˆ ( , ), Te : x x j j j 1 Ne ˆ ( , ) y y j j (5.3.2) j 1 the element Ωe to which Te maps ̂ is completely determined by specifying the x, y-coordinates (xj, yj) of all the nodal points of Ωe Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations 2. Transformation of Shape Functions Let g be a scalar-valued function of x and y defined on an element Ωe . Then we can convert g to a function ĝ of ξ and η defined on ̂ by setting g ( x, y ) g ( x( , ), y ( , )) gˆ ( , ) where x(ξ , η) and y(ξ , η) are now given by (5.3.2) Similarly, if ĝ (ξ , η) is given on ̂ , then under the transformation of (ξ , η) into (x,y), gˆ ( , ) gˆ ( ( x, y ), ( x, y )) g ( x, y ) Thus, element shape functions je je ( x, y) for Ωe are simply obtained ˆ ( , ) by from j ˆ ( ( x, y), ( x, y)), je j Seoul National University j 1,2, ,N e Aerospace Structures Laboratory 5.3 Finite Element Calculations e The derivatives of j are obtained by the chain rule: ˆ ˆ j j ; x x x je According to (5.3.2), ˆ ( , ) x N e k xk , k 1 ˆ ( , ) y N e k yk , k 1 ˆ ˆ j j y y y je ˆ ( , ) x N e k xk k 1 ˆ ( , ) y N e k yk k 1 (5.3.5) (5.3.6) Thus, using (5.2.7) and (5.3.6), equations (5.3.5) become ˆ Ne ˆ Ne ˆ ˆ j j k k y y k k k 1 k 1 ˆ N e ˆ N e ˆ ˆ je 1 j j k k x x k k y J ( , ) k 1 k 1 je 1 x J ( , ) Seoul National University (5.3.7) Aerospace Structures Laboratory 5.3 Finite Element Calculations 3. Integration Let g and ĝ be the functions defined in (5.3.3). Then it is clear that e g ( x, y )dxdy ˆ gˆ ( , ) J ( , ) dd where, Ne ˆ gˆ ( , ) g x j j ( , ), j 1 ˆ y j j ( , ) j 1 Ne The Gauss quadrature could be used for the integration And ,if Gˆ ( , ) gˆ ( , ) J ( , ) is to be integrated over ̂ , we use the formula e Nl g ( x, y )dxdy ˆ Gˆ ( , )dd Gˆ ( l ,l ) wl Eˆ l 1 Eˆ is the quadrature error. Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations 4. Element Stiffness matrix and Load Vectors The entries keij and fei in the element stiffness matrix and load vector defined by (5.3.1a) and (5.3.1b) can be computed using (5.3.7) and the integration rule (5.3.10) If k=k(x,y), b=b(x,y) and f=f(x,y) are not constant, we may use their interpolants, Ne k h ( x, y ) k j ( x, y ), j 1 e j Ne bh ( x, y ) b j je ( x, y ), (5.3.11) j 1 Ne f h ( x, y ) f j je ( x, y ) j 1 k j k ( x j , y j ), Seoul National University j 1,2, , N e Aerospace Structures Laboratory 5.3 Finite Element Calculations 5. Boundary Integrals The calculation of Peij and γei of (5.3.1c) and (5.3.1d) is carried out by integrating along those sides of the master element that are mapped onto the sides e2 h of Ωe along which natural boundary conditions are prescribed. Let ˆ j denote the restriction of the master-element shape functions ̂ j to side 1 : ˆ (1, ), ˆ j ( ) j j 1,2,, N e (5.3.12) It is clear that except for nodes j falling on the boundary ξ=1, ˆ j 0 . We then have P p ds pˆ ( )ˆi ( )ˆ j ( ) j ( ) d ds ˆ ( )ˆi ( ) j ( ) d e ij e ij e2 h e2 h e i e i 1 e j 1 (5.3.13) 1 1 where j is the Jacobian of the transformation of into the arc-length parameter s in the x, y-plane Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations 1/ 2 x(1, ) 2 y (1, ) 2 ds d x(1, ) y (1, ) j ( ) 2 where 2 1/ 2 (5.3.14) x( , ) and y ( , ) is defined in (5.3.2) The one-dimensional Gaussian quadrature rule is needed for the integration in boundary. Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations 5.3.2 Computational Aspests 1. Choose and Ωˆ and Ψˆ j , j 1,2,, N e and specify th e x, y - coordinate s ( x1 , y1 ), ( x2 , y 2 ), , ( xN , y N ) of nodal points of each element. 2. Specify a set of N l integratio n points ( l ,l ), l 1,2,, N l , and ˆ quadrature weights w for l ˆ , ˆ / , ˆ / at the intergrati on points 3. Calculate the values of j j j ( l ,l ) (see (5.3.4)) . 4. Calculate the values of x x( , ), y y ( , ) of (5.3.2) and their derivative s x / , x / , y / , y / , at the intergrati on points ( l ,l ) (see (5.3.6)) . 5. Calculate the values of the Jacobian J ( , ) and the functions / x, / y, / x, / y at the integratio n points ( l ,l ) (see (5.2.7)). 6. Using (5.3.7) and the results of steps 3, 4, and 5, compute je / x and je / y at each integratio n point ( l ,l ). Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations 7. Calculate the values of k , b, and f (or k h , bh , and f h ) at the integratio n points ( l ,l ). 8. Using the results of steps 3 through 7, calculate the values of the integrands in (5.3.1a), (5.3.1b) at the integratio n points ( l ,l ) and multiply each by wl J ( l ,l ) . 9. Sum the numbers computed in step 8 in accordance with (5.3.10) to obtain kije and f ije A similar sequence of calculations can be performed to yield the boundary integrals Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations We note that the different shape functions for the coordinates mapping and the solution approximation can be used the following mapping to coordinate mapping. In other words, the order of the mapping functions can be higher or lower than the order of the solution approximations as mentioned in the follows. M Te : x x j j ( , ) ; j 1 M y y j j ( , ) (5.3.15) j 1 ˆ , k 1,2,, N N e nodes and shape functions k e then, element maps are classified as follows: M N e : Te is a superparametric map M N e : Te is a isoparametric map (5.3.16) M N e : Te is a suberparametric map Seoul National University Aerospace Structures Laboratory 5.3 Finite Element Calculations Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements The scheme for element calculations in the previous section can be employed for many different kinds of finite elements. The specification of an element type entails a prescription of the master element, the map Te, the shape functions, and the quadrature rules. The information required to prescribe each of these items is given below. 1. Master element : the geometry of the master element ̂ and the definitions of the element coordinate system ( , ) ~ 2. The map Te : the element coordinates ( j , j ) and shape functions j for the nodes, j 1,2, , M that define the map from ̂ to e ~ 3. Interpolation : the element coordinates ( j , j ) and the shape functions j N e for the nodes j 1,2,, N , that determine the approximation uhe u ej je e j 1 4. Quadrature rules : the number N l of integration points, the element coordinates ( l ,l ) and weights wl (l 1,2,, Nl ) Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements 5.4.1 Quadrilateral elements Finite elements with four sides are generally referred to as quadrilateral elements ~ * the shape function i for node i must assume a unit value at node i and vanish at all other nodes of the element and along all sides of the element that do not contain node i 1) 4-node element : Fig.5.7 (a) ~ 1 1, 1 must vanish alongsides and should be(1 at1, 1) 1 ~ therefore the shape function 1 (is, ) (1 )(1 ) 2) 9-node element : Fig.5.7. (b) 4 1 ~ 1 ( , ) ( 2 )( 2 ) 4 1 1 ~ 6 ( , ) (1 )(1 )(1 ) ( 2 )(1 2 ) 2 2 Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements 3) 8-node element (Fig. 5. 8 ) 1 ~ 1 ( , ) (1 )(1 )( 1 ) 4 Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Quadrature rules for quadrilateral elements are usually derived from one-dimensional quadrature formulas by treating the integration over the master element as a double integral. 1 d G ( , ) d d G ( , ) d ˆ 1 1 1 and approximate both the integration with respect to ξ and with respect to η by onedimensional quadrature rules of order N N G ( , ) d d G ( , ) w n wm ˆ m 1 n 1 N (5.4.1) when (m,n) with the single index l with Nl=N2, N N G ( , )wn wm G ( , ) wl m 1 n 1 l 1 N Seoul National University 2 (5.4.2) Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements 5.4.2 Triangular Elements master element; Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements ˆ ( , ) 1 , ˆ ( , ) , ˆ ( ,) 1 2 3 (5.4.3) Coordinate map Te ; 3 ˆ ( , ), x x j j j 1 3 ˆ ( , ) y y j j (5.4.4) j 1 ( x j , y j ) : Coordinate of j - th node j 1,2,3 and then, 1 ( y3 y1 )( x x1 ) ( x3 x1 )( y y1 ) 2 Ae 1 ( y2 y1 )( x x1 ) ( x2 x1 )( y y1 ) 2 Ae (5.4.5) Ae : area of e 2e ( x, y ), 3e ( x, y ), 1 1e ( x, y ) Seoul National University (5.4.6) Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Area Coordinates The expressions , and 1 in (5.4.5) and (5.4.6) may be conveniently interpreted in terms of area ratios. Let ( , ) be the coordinates of an arbitrary point in ̂ and (x,y) the corresponding point in e . Suppose that we construct straight lines joining ( , ) and ( x, y ) to the vertices, and denote by âi and ai the subtriangle areas opposite node i in ̂ and e, respectively. The terms , and 1 in (5.4.6) are easily seen to be ˆ , where  =1/2 is the area of the master element. We define the area ratios aˆi / A the area coordinates on ̂ as i aˆi Aˆ i 1,2,3 (5.4.7) or 1 1 , 2 , 3 Seoul National University (5.4.8) Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Since the transformation Te is linear, the Jacobian J is constant and is the ratio of the areas of e and ̂. This implies that the map distorts areas uniformly. Thus, the meaning of area coordinates is preserved under linear transformations and we have aˆ a i i Aˆ i Ae , i 1,2,3 (5.4.9) The subtriangles and coordinate lines are indicated in Fig. 5.12. It is important to note that this property is not preserved if the map Te is nonlinear. 1. Let the i Coordinate of an arbitrary interior point P be (1 , 2 , 3 ) . The coordinate line i i constant is parallel to the side of the triangle opposite to vertex i : 1 1 is a line parallel to side 2-3, 2 2 is parallel to 1-2, and 3 3 is parallel to 1-2. 2. The coordinate lines i 0 define the boundary of the triangle: 1 0 is the side 2-3 opposite vertex 1, 2 0 is the side 1-3 opposite vertex 2, and 3 0 is the side 1-2 opposite vertex 3. 3. The triangular coordinates of the vertices 1, 2, and 3 are (1,0,0), (0,1,0) and (0,0,1), respectively. Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements High-Degree Shape Functions Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements linear shape function (Fig. 5.13.a) ˆ ( , , ) , i 1 2 3 i i 1,2,3 (5.4.10) quadratic shape function (Fig.5.13.b) 1 (2 1 1), vertex node i 1,2,3 ˆ i ( 1 , 2 , 3 ) 4 j k node i midside j k for i 4,5,6 (5.4.11) cubic Lagrange element (Fig. 5.13.c) 2 1 9 ( )( 2 i i 3 i 3 ), vertex node i, i 1,2,3 27 ( 1 ) first tris ection node (i 4,5,6) side j k ˆ ( , , ) 2 j k j 3 (5.4.12) i 1 2 3 27 1 ( ) second trisectio n node (i 7,8,9) side j k j k k 3 2 27 1 2 3 centroid node i 10 Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Coordinate map Te ; M ˆ ( , , ) x( , ) x( 1 , 2 , 3 ) x j j 1 2 3 j 1 chain rule for calculating derivatives; ˆ ˆ ˆ ˆ i i i 3 1 2 i x 1 x 2 x 3 x Seoul National University (5.4.13) Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Integration The integrals on ̂ in terms of area coordinates; G( , ˆ 1 2 , 3 )d 2 d 3 ( 1 1 2 3 ) by Gauss quadrature rule G( , ˆ 1 Nl 2 , 3 )d 2 d 3 wl G( l ) (5.4.14) l 1 l (( 1 )l , ( 2 )l , ( 3 )l ) wl : quadrature weight N l : order of quadrature formula Seoul National University Aerospace Structures Laboratory 5.4 Two-Dimensional Finite Elements Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.1 Parameter description. Control Parameters COMMON/RCON/TITLE(20), NNODE, NELEM, NMAT, NPOINT, NBC1, NBC2 TITLE = alphanumeric array containing problem title NNODE = number of nodal points in problem NELEM = number of elements in problem NMAT = number of materials in problem NPOINT = number of point loads in problem NBC1 = number of nodes at which essential boundary conditions are prescribed NBC2 = number of element sides along which natural boundary conditions are prescribed Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations Nodal-Point Data COMMON/CNODE/X(2,450),U(450) X = nodal point x- and y- coordinates U = nodal point values of finite element approximation Element Data COMMON/CELEM/NE(100),MAT(100), NODES(9,100) NE = number of nodes in element MAT = material number of element NODES = node numbers of nodes in element Material Data COMMON/CMATL/PROP(3,5) PROP = material properties k,b, and f for up to five materials Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations Boundary-Condition Data COMMON/CBC/NODBC1(70),VBC1(70),NELBC(40),NSIDE(40),VBC(40,2) NODBC1 = node numbers of nodes at which essential boundary conditions are prescribed VBC1 = values of essential boundary conditions u uˆ û NELBC = element numbers of elements on which natural boundary conditions are prescribed NSIDE = side number of element on which natural boundary conditions are prescribed VBC = values of p and (or ̂ ) for natural boundary conditions Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations Matrix Storage COMMON/CMATRX/GK(450,21),GF(450) GK = global stiffness matrix K GF = global load vector F Numerical Quadrature Data COMMON/CINT/XIQ(9,2), XIT(7,2), WQ(9), WT(7) XIQ = XIT = , , coordinates of integration points for square master element coordinates of integration points for triangular master element WQ = integration weights for square element WT = integration weights for triangle element Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.2 Preprocessor routine – Subroutine RNODE N1 = node number of first node along the line. NUM = number of nodes along the line. INC = increment in node number. X1,Y1 = x,y-coordinates of first node. XN,YN = x,y-coordinates of last node. SUBROUTINE RNODE COMMON/CCON/TITLE(20), NNODE COMMON/CNODE/X(2,450) READ.NREC DO 20 IREC=1,NREC READ,N1,NUM,INC,X1,Y1,XN,YN NUM1=NUM-1 XNUM=NUM1 X(1,N1)=X1 X(2,N1)=Y1 Seoul National University IF (NUM.EQ.1) GO TO 20 DX=(XN-X1)/XNUM DY=(YN-Y1)/XNUM DO 10 N=1,NUM1 XN=N IN=N1+N*INC X(1,IN)=X1+XN*DX 10 X(2,IN)=Y1+XN*DY 11 CONTINUE C…PRINT NODAL POINT COORDINATES WRITE(6,101) DO 30 N=1,NNODE 30 WRITE(6,102) N,X(1,N),X(2,N) RETURN 101 FORMAT(35H NODE NO XCOORDINATE Y-COORDINATE) 102 FORMAT(I7,2E16.4) END Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.2 Preprocessor routine – Subroutine RELEM NUM = number of elements in the sequence. INC = increment in nodal numbers from element to element in sequence. NEE = number of nodes in each element. MATE = material property number for the elements. NODE(I) = nodal point numbers of nodes in first element in the sequence. Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations SUBROUTINE RELEM COMMON/CCON/TITLE(20),NNODE,NEL EM COMMON/CELEM/NE(100),MAT(100),NO DES(9,100) DIMENSION NODE(9) C…READ ELEMENT DATA READ.NREC NEL=0 DO 20 IREC=1,NREC READ,NUM,INC,NEE,MATE,(NODE(I),I= 1,NEE) N1=NEL+1 NEL=NEL+NUM IF(NEL.GT.100) GO TO 99 DO 20 N=N1,NEL NINC = (N-1)*INC Seoul National University DO 10 M=1,NEE 10 NODES(M,N) = NODE(M)+NINC NE(N)=NEE 20 MAT(N)=MATE C…PRINT ELEMENT DEFINITIONS WRITE(6,101) DO 30 N=1,NELEM NEN=NE(N) 30 WRITE(6,102) N,NE(N),MAT(N),(NODES(I,N),I=1,NEN) RETURN 99 WRITE(6,103) 101 FORMAT(19H ELEM NO NE MAT, 20X, 12HNODE NUMBERS //) 102 FORMAT(I5,I7,I6,5X,9I5) 103 FORMAT(37H ELEMENT NUMBER EXCEEDS MAXIMUM VALUE) STOP END Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.3 Preprocessor routine – Subroutine RBC Point loads: one record per point load N = the node number of the node at which the point load is applied. V = the value of the point load. Essential boundary conditions u uˆ : each record defines a sequence of nodes with the same boundary condition. N1 = node number of first node in the sequence. NUM = number of nodes in sequence. INC = increment in node number. V = value of û in the essential boundary condition. Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations Natural boundary conditions k (u / n) pu : each record defines a sequence of elements that have the natural boundary condition prescribed along one side. N1 = element number of first element in the sequence. NUM = number of elements in the sequence. INC = increment in element numbers. NS = side number of element along which boundary condition is prescribed P = value of the coefficient p in (4.2.18d) V = value of in (4.2.18d) Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations SUBROUTINE RBC COMMON/CCON/TITLE(20),NNODE,NEL EM,NMAT,NPOINT,NBC1,NBC2 COMMON/CBC/NODBC1(70),VBC1(70),N ELBC(40),NSIDE(41),VBC2(2,40),NPT(10), VPT(10) C…READ POINT LOADS READ,NREC NPOINT=NREC IF(NREC.EQ.0) GO TO 20 DO 10 I=1, NREC READ,N,V NPT(I)=N 10 VPT(I)=V Seoul National University C…READ ESSENTIAL BOUNDARY CONDITION DATA 20 READ,NREC NBC1=0 IF(NREC.EQ.0) GO TO 40 DO 30 J=1, NREC READ,N1,NUM,INC,V DO 30 I=1,NUM NBC1=NBC1+1 N=N1+(I-1)*INC NODBC1(NBC1)=N 50 VBC1(NBC1)=V Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations C…READ NATURAL BOUNDARY CONDITION DATA 40 READ,NREC NBC2=0 IF(NREC.EQ.0) GO TO 60 DO 50 J=1,NREC READ,N1,NUM,INC,NS,P,V DO 50 I=1,NUM NBC2=NBC2+1 N=N1+(I-1)*INC NELBC(NBC2)=N NSIDE(NBC2)=NS VBC2(1,NBC2)=P 50 VBC2(2,NBC2)=V Seoul National University C…PRINT BOUNDARY CONDITION DATA . . (THE REMAINDER OF THIS ROUTINE IS LEFT AS AN EXERCISE) . . . END Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.4 Processor Routines – subroutine ELEM FIGURE 5.17 Flowchart of boundary condition calculations Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations N e (and shape functions) in the element X(I,J) = nodal-point coordinates, x j and y j , j 1, 2, ..., N e NOTE : X (1, J ) x j and X ( 2, J ) y j NL = number N l of integral points N = number of nodal points XI(J,L) = coordinates (in the master-element coordinate system) l and l , l 1, 2, ..., Nl NOTE : l XI (1, L) and l XI (2, L) W(L) = integration weights wl , l 1, 2, ..., N l PSI(I) = values of the shape functions ˆ ( , ), i 1, 2, ... , N l e at an integration point Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations DPSI(I,J) = values of the shape function gradients ˆ l / i 1, 2, ..., N e at an integration point NOTE : ˆ l / = DPSI(l,1) ˆ l / and ˆ l / = DPSI(l,2) DXDS(I,J) = values the entries in the Jacobian matrix J of at an integration point NOTE : x / = DXDS(1,1) x / = DXDS(1,2) y / = DXDS(2,1) y / = DXDS(2,2) DSDX(I,J) = values of the entries of the inverse Jacobian matrix J 1 at an integration point NOTE : / x = DSDX(1,1) / x = DSDX(1,2) / x = DSDX(2,1) / y = DSDX(2,2) XK,XB,XF = values of the coefficients in the differential equation for an element EK = element stiffness array, Seoul National University EF = element load vector array Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations DO 20 K=1,N SUBROUTINE ELEM(X,N,EK,EF,NL,XI,W,MAT) 20 DXDS(I,J)=DXDS(I,J)+DPSI(K,J)*X(I,K) DIMENSION X(2,N),EK(N,N),EF(N),XI(2,NL),W(NL) C…..CALCULATE DSDX...EQUATION (5.2.7) DIMENSION DETJ=DXDS(1,1)*DXDS(2,2)DPSIX(9),DPSIY(9),DXDS(2,2),DSDX(2,2) DXDS(1,2)*DXDS(2,1) DIMENSION PSI(9),DPSI(2,9) IF(DETJ.LE.0) GO TO 99 C…..INITIALIZE ELEMENT ARRAYS DSDX(1,1)=DXDS(2,2)/DETJ DO 10 I=1,N DSDX(2,2)=DXDS(1,1)/DETJ EF(I)=0.0 DSDX(1,2)=-DXDS(1,2)/DETJ DO 10 J=1,N DSDX(2,1)=-DXDS(2,1)/DETJ 10 EK(I,J)=0.0 C…..CALCULATE D(PSI)/DX…EQUATION (5.3.5) CALL GETMAT(XK,XB,XF,MAT) DO 3C I=1,N C…..BEGIN INTEGRATION POINT LOOP DPSIX(I)=DPSI(I,1)*DSDX(1,1)+DPSI(I,2)*DSDX( DO 50 L=1,NL 2,1) CALL SHAPE(XI(1,L),N,PSI,DPSI) 30 DPSIY(I)=DPSI(I,1)*DSDX(1,2)+DPSI(I,2)*DSDX( C…..CALCULATE DXDS…EQUATION (5.3.6) 2,2) DO 20 I=1,2 DO 20 J=1,2 DXDS(I,J)=0.0 Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations C….. ACCUMULATE INTEGRATION POINT VALUE OF INTEGRALS FAC=DETJ*W(L) DO 40 I=1,N EF(I)=EF(I)+XF*PSI(I)*FAC DO 40 J=I,N 40 EK(I,J)=EK(I,J)+FAC*(XK*(DPSIX(I)*DPSIX(J)+DPSIY(I)*DPSIY(J))+XB*PSI(I)*PSI(J)) 50 CONTINUE C..... CALCULATE LOWER SYMMETRIC PART OF EK DO 60 I=1,N DO 60 J=1,I 60 EK(I,J)=EK(J,I) RETURN 99 WRITE(6,110) DETJ,X 110 FORMAT(13H BAD JACOBIAN,E10.3/9E10.3/9E10.3) STOP END Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.4 Processor Routines – subroutine ELEM SUBROUTINE APLYBC COMMON/CCON/TITLE(20),NODE,NELEM,NMAT,NPOINT,NBC1,NBC2 COMMON/CBC/NODBC1(70),VBC1(70),NELBC(40),NSIDE(41),VBC2(2,40),NPT(10),VP T(10) COMMON/CELEM/NE(100),MAT(100),NODES(9,100) COMMON/CMATRX/GK(450,21),GF(450) COMMON/CNODE/X(2,450) DIMENSION NOD(3), XBC(2,3),PE(3,3),GAME(3) C….. APPLY POINT LOADS IF (NPOINT.EQ.0) GO TO 20 DO 10 I=1,NPOINT N=NPT(I) 10 GF(N)=GF(N)+VPT(I) Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations C..... APPLY ESSENTIAL BOUNDARY CONDITIONS 20 IF(NBC1.EQ.0) GO TO 40 BIG=1.E30 DO 30 I=1,NBC1 N=NODBC1(I) GK(1,N)=BIG 30 GF(N)=BIG*VBC1(I) C….. APPLY NATURAL BOUNDARY CONDITIONS 40 IF (NBC2.EQ.0) GO TO 70 DO 60 I=1,NBC2 C….. PICK OUT NODES ON SIDE OF ELEMENT NEL=NELBC(I) NS=NSIDE(I) NC=4 IF(NE(NEL).EQ.6) NC=3 NOD(1)=NS NOD(2)=NS+NC NOD(3)=NS+1 IF(NS.EQ.NC) NOD(3)=1 Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations C…..PICK OUT NODAL COORDINATES DO 50 J=1,3 NJ=NOD(J) NOD(J)=NODES(NJ,NEL) NJ=NOD(J) XBC(1,J)=X(1,NJ) 50 XBC(2,J)=X(2,NJ) C…..CALL BCINT TO CALCULATE BOUNDARY INTEGRALS PE AND GAME CALL BCINT(VBC2(1,I),VBC2(2,I),XBC,PE,GAME) C…..CALL ASSEMB TO ADD PE TO GK AND GAME TO GF CALL ASSMB(PE,GAME,3,NOD,GK,GF,450) 60 CONTINUE 70 RETURN END Seoul National University Aerospace Structures Laboratory 5.5 Coding of two-dimensional finite element calculations 5.5.4 Post Processor u u h , h Print of values of the finite element approximation u h and the flux h k x y the calculation of h follows the scheme for the calculation of ˆ l / x and ˆ l / y but now used for the evaluation of u / x and u / y . There is significant difference in that the values of ui are now known. Thus, u / and u / can be calculated directly as u N e ˆ j uj j 1 Seoul National University and u N e ˆ j uj j 1 Aerospace Structures Laboratory