Computational & Technology Resources
an online resource for computational,
engineering & technology publications
Civil-Comp Proceedings
ISSN 1759-3433
CCP: 77
PROCEEDINGS OF THE NINTH INTERNATIONAL CONFERENCE ON CIVIL AND STRUCTURAL ENGINEERING COMPUTING
Edited by: B.H.V. Topping
Paper 20

Automatic Differentiation in Computational Mechanics

P.R.B. Devloo and E.S.R. Santos

College of Civil Engineering, University of Campinas - UNICAMP, Brazil

Full Bibliographic Reference for this paper
P.R.B. Devloo, E.S.R. Santos, "Automatic Differentiation in Computational Mechanics", in B.H.V. Topping, (Editor), "Proceedings of the Ninth International Conference on Civil and Structural Engineering Computing", Civil-Comp Press, Stirlingshire, UK, Paper 20, 2003. doi:10.4203/ccp.77.20
Keywords: automatic differentiation, FAD, PZ, stiffness matrix, finite element method, CFD, Jacobian, hyperelasticity, shape functions, C++.

Summary
Introduction

The development of an hp-adaptive finite element program aided by automatic differentiation techniques represents advantages for the programmer. The implementation of the finite element method requires the implementation of several gradients, for instance:

  • Element interpolation shape functions;
  • The master element mapping Jacobian;
  • Computation of the element tangent (i.e. stiffness) matrix.
The automatic differentiation may also help the programmer while coding any numerical problem whose solution is obtained as the minimization of a potential function. Some examples are:

  • Linear elasticity problems, including plates and shells;
  • Hyperelastic finite element problems, where the definition of a Stiffness Matrix and Load Vector are based on the energy theorem;
Yet another area of application of automatic differentiation is in the area of development of tangent matrices of residual vectors resulting from non-linear computations. In particular, automatic differentiation has been used in the development of implicit solvers applied to CFD problems.

Automatic Differentiation

Automatic differentiation is a technique widely researched. Several packages written in different computational languages are available on internet.

This work intends to apply the automatic differentiation to a finite element environment named PZ [1], which is written in C++. The choice of a speciffic differentiator was based on some aspects:

  • compatibility with the choosen language;
  • run-time performance in comparison to similar differentiation packages;
  • impact on the original code (easiness of use).
In this case, the software library FAD [2] was used. FAD was developed by Pironneau, Di Cesare and Aubert[3].

Hyperelastic finite element problem

The solution of hyperelastic problems can be obtained by the minimization of the total deformation energy. The expression of the energy is a relatively simple expression of the deformation gradient, but due to the nonlinear nature of the formulation closed formulae for the load vector (first derivative) and stiffness matrix (second derivative) are difficult to implement and debug.

This work proposes the use of an automatic differentiator to evaluate the load vector and stiffness matrix components as the first and second derivatives of the energy with respect to the displacement variables. This technique allows an easy way to construct the linear system.

Only some differentiators can compute the second derivatives. This paper uses the template definitons of FAD to nest two differentiator classes.

CFD Problem

The coding of non-linear residuals represents a great effort for the programmer. These residuals also perform some eigenvalue checks, changing the control statements during the evaluation. Therefore it is difficult to code a consistent matrix tangent to the residual when implicit solvers are desired.

Using the automatic differentiation this work shows how one can obtain the consistent tangent matrix while computing the residual function.

Shape functions

hp-Adaptive finite element programs use hierarchical formulations for the computation of the shape functions. These computations involve the multiplication of several sets of shapefunctions and the application of transformation functions. The implementation of the computation of their derivatives is therefore extensive and error prone. This paper will illustrate how the evaluation of shape functions using the FAD classes yields their derivatives in a straightforward manner.

References
1
http://labmec.fec.unicamp.br/~pz
2
http://www.ann.jussieu.fr/~pironnea
3
P. Aubert, N. Di Cesare, and O. Pironnea.
Automatic differentiation in c++ using expression templates and application to a flow control problem.
1999.

purchase the full-text of this paper (price £20)

go to the previous paper
go to the next paper
return to the table of contents
return to the book description
purchase this book (price £123 +P&P)