Education: & Training
Education: & Training
& TRAINING
paper a method for economically generating shape
Automatic generation of functions for a wide variety of problems will be
shape functions for finite discussed.
Recently, attention has turned to automatic gen
element analysis using eration of shape function routines using programs
REDUCE for symbolic manipulation. The idea of algebraic
manipulation of symbols on the computer has been
Christine Barbier,t Philip J . Clark,* around since the early days of computing. Only
Peter Bettess* and Jacqueline A. Bettess† relatively recently, however, have powerful symbolic
*Department of Marine Technology. University manipulation languages become widely available.
of Newcastle-upon-Tyne, Newcastle-upon-Tyne Typical languages now in use are REDUCE 2 ,
NE1 7RU, UK and †Computer Centre, University of MACSYMA 3 , SMP 4 and MuMATH 5 . There is
Durham, Durham DH1 3LE, UK
(Received August 1990) a special interest group in ACM devoted to symbolic
manipulation (SIGSAM 6 ). A few research workers
have realised the enormous potential such languages
ABSTRACT have in the generation of error-free numerical code,
The use of algebraic languages such as REDUCE and in particular finite element software 7-14 . This is
makes possible the automatic generation, from fairly especially true for languages, such as REDUCE,
concise data, of the main families of two and three which can produce Fortran code for the evaluation
dimensional C0 continuous finite element shape of expressions. Most work in the development of
functions, with a high confidence in their correct new finite element formulations is concerned with
ness. This paper gives a tutorial introduction to the the algebra of new algorithms. Most of this work can
REDUCE language and describes how it was used be carried out automatically and with practically
to generate shape function routines. complete freedom from error using the symbolic
manipulation languages.
The pioneering work of Wang et al. 1 2 - 1 4 covers
INTRODUCTION
similar ground to the present work. Wang and his
In finite element analysis, it is well known that the co-workers have developed an interactive system
shape functions are used to interpolate field vari called FINGER (FINite element code GEneratoR).
ables within elements. Most are based on poly This system allows the user to develop Fortran code
nomials. C0 continuous shape functions are those in for isoparametric elements to various levels of
which the field variable is continuous between sophistication. At the lowest level shape functions
adjoining elements but not the derivative of the field are generated which can then be used to construct
variable. The theory for different element shape the finite element strain matrix, the material proper
functions is available in many standard text books, ties matrix (where this depends on non-linear consti
for example Zienkiewicz1. Most of the text books do tutive relations), and the integrand of the system
not, however, give the derivatives of the shape matrix. The final objective of integrating this last
functions, and leave it to the user to expand the item to produce the stiffness matrix can be achieved
polynomials, form the derivatives and simplify the in certain hybrid-mixed formulations 13 but in gen
resulting expressions. Fortran code is available for eral it is not possible because the integrand is
some shape functions, in the NAG library for a rational function of the local element co-ordinates.
example. However, it is not possible to have shape In their early work Wang et al. 12 used a polynomial
function libraries which cover all possibilities. In this approximation of the integrand by assuming that the
0264-1401/90/040349-10$2.00
© 1990 Pineridge Press Ltd. Eng. Comput., 1990, Vol. 7, December 349
Education and Training
where i = 0,...n,ξ is the normalized co-ordinate in Then the one dimensional Lagrange polynomials
the range [— 1, + 1] and the element has n + 1 nodes. are calculated in terms of a generic coordinate VAR1
The shape functions depend upon the cardinal and stored. The REDUCE code corresponding to
ity condition of the Lagrange polynomials, (1) is given by:
FOR I: = 0:N DO
« L(I): = 1;
The formation of the shape functions using
REDUCE is next described for each element con
sidered. The cartesian co-ordinates over the stan
dard square (cube) are ξ, η (and ζ). The barycentric
co-ordinates over the standard triangle (tetrahed
ron) are L1, L2, L3 (and L 4 ). They are called local
co-ordinates (see Figure 1). The shape functions can
be used to map the local co-ordinates to the global
co-ordinates, i.e. the actual co-ordinates of the nodes
in the mesh.
where
Serendipity element
A geometrical interpolation of serendipity ele
ments is given by Zienkiewicz1. For example, the
two dimensional quadratic and cubic quadrilateral
shape functions are defined below. SFnode(i,j)(ξ, η)
takes three different values depending on the posi
part of C (bilinear function) gives one at the corner, to one. The formula for the shape function is:
zero at the other corners and some non-zero values
at the mid-side nodes along the edges. P and Q
modify C so that its value at the mid-side nodes is where
zero.
The calculation in three dimensions is similar. The
mid-side nodes are calculated by multiplying two
linear Lagrange polynomials by a (η + l)th order
Lagrange polynomial. The corner nodes are cal
culated by assigning a trilinear polynomial and then Li(j) denotes the Li barycentric co-ordinate of the
subtracting the sums of weighted parts of the values node at position j in the Li direction. Similarly for
of the shape functions at the mid-side nodes.
REDUCE handles the calculations as described As there can be several nodes in position j in the Li
above. The mid-side node shape functions EH and direction the actual nodes used in (9) are undeter
EV are constructed with suitable order Lagrange mined. However, as all nodes in position j have the
polynomials in ξ and η (and ζ in 3D) directions, same Li co-ordinate the choice of the node is not
using the operator SUB (see Lagrangian element). important as the result will be the same in all cases.
The corners are initially assigned with the bilinear For example, a triangle (123) with 4 nodes along one
(or trilinear in 3D) function using the one dimen edge has the following shape functions (see Figure 3):
sional Lagrange polynomials. The two polynomials ● Node 1 (i, j, k) = (3, 0, 0)
P and Q are calculated and the subtraction is made.
The program is such that, P and Q being initialized SF1 (L1, L2, L3)
to zero, as soon as one shape function for a mid-side = 4th order in L1 * 1st order in L2 * 1st order in L 3
node is calculated its weighted value is added to P
and Q.
Extension to quartic and higher order serendipity
polynomials requires the introduction of mid-face
nodes. Although straight forward in principle it has
not been done here, as such elements are not widely
used.
where
be equal to 1. Equation (13) gives the form of the test Table 1 Performance of REDUCE translated code and direct
FORTRAN code
for a quadrilateral Lagrangian element:
2 dimensions 3 dimensions
Quadratic elements FD NG RT FD NG RT
All times are in μs. RT: Reduce translated. NG: NAG library routines.
FD: Fortran directly written by hand
vided. The Fortran code obtained is optimized and 3 Macsyma-Symbolics Ltd, St. John's Court, Easton St, High
Wycombe, Bucks, HP11 1JX, UK
its performance compares well with other methods 4 SMP-Inference Corporation, 5300 West Central Building, Los
and existing libraries. Work is now going on to Angeles, CA 90045, USA
5 MuMath-Soft Warehouse Inc, 3615, Harding Avenue, Suite 505,
develop similar infinite element mapping functions. Honolulu, Hawaii 96186, USA & C. D. Woofand D. E. Hodinson,
MuMath A Microcomputer Algebra System, Academic Press,
New York (1987)
CODE AVAILABILITY 6 SIGSAM-ACM Special Interest Group on Symbolic and Alge
braic Manipulation, 11 West 42nd St, NY 10036, USA
All the software described above is available from 7 Bettess, P. and Bettess, J. A. Automatic generation of shape
function routines, in Numerical Techniques for Engineering and
Mrs J. A. Bettess (Computer Centre, University of Design (NUMETA '87, Swansea) paper S20, Vol. II, Martinus
Durham, South Road, Durham, DH1 3LE, tel: 091 Nijhoff, Dordrecht (1987)
8 Kidger, D. J. The 14 node brick element, Proc. 2nd A. Robert J.
374 2895) for a modest charge. The complete set of Melosh Medal Paper Competition, Duke University, NC (1990); to
materials consists of: be published in a special issue of Finite Elements in Analysis and
Design
9 Park, K. C. and Flagg, D. L. An operational procedure for the
1. REDUCE source codes. symbolic analysis of the finite element method, Comp. Meth. Appl.
2. Automatically produced FORTRAN 77 Mech. Eng., 42, 37-46 (1984)
10 Nedergaard, H. and Pedersen, P. T. Analysis procedure for space
source codes for all the shape functions de frames with material and geometrical nonlinearities, in Finite
scribed above. Element Method for Nonlinear Problems (Eds P. G. Bergan, K. J.
Bathe and W. Wunderlich) Springer-Verlag, Berlin (1985)
3. User instruction file. 11 Dasgupta, G. A computational scheme to analyze nonlinear
stochastic dynamic system by finite elements, Res Rep. 1UTAM
Symp. Igls, Austria (1987)
ACKNOWLEDGEMENTS 12 Wang, Paul S , Chang, T. Y. P. and Van Hulzen, J. A. Code
generation and optimization for finite element analysis, Proc.
The authors are pleased to acknowledge the support EUROSAM '84, London, pp. 237-247 (July 1984)
13 Wang, Paul S., Tan, H., Saleeb, A. and Chang, T. Y. Code
of the Science and Engineering Research Council, generation for hybrid mixed mode formulation in finite element
through awards GR/E/2099.8 and GR/F/06173. analysis, ACMSYMSAC '86 Conf. Univ. Waterloo, Canada (July
1986)
14 Wang. Paul S. FINGER: a symbolic system for automatic
generation of numerical programs in finite element analysis, J.
REFERENCES Symb. Comput. 2, 305-316 (1986)
15 Hearn, Anthony C. REDUCE User's Manual, RAND Publication
1 Zienkiewicz, O. C. The Finite Element Method, 3rd Edn, McGraw- CP7S (Rev. 7/87) (July 1987)
Hill, London (1977) 16 Gates, Barbara L GENTRAN user's Manual, REDUCE version,
2 REDUCE is available from The RAND Corporation, 1700 Main Information Sciences Department, The RAND Corporation, P.O.
Street, Santa Monica, CA, 90406-2138, USA Box 2138, 1700 Main Street, Santa Monica, CA 90406-2138, USA