Vous êtes sur la page 1sur 12

Applied Mathematics and Computation 219 (2013) 46254636

Contents lists available at SciVerse ScienceDirect

Applied Mathematics and Computation


journal homepage: www.elsevier.com/locate/amc

Application of tensor analysis to the nite element method


C. Hernandez, R.B.B. Ovando-Martinez, M.A. Arjona
Instituto Tecnolgico de La Laguna, Divisin de Estudios de Posgrado e Investigacin, Paseo de las Gemas 52, Residencial La Rosa, 27266 Torren, Coah, Mexico

a r t i c l e

i n f o

Keywords:
Finite element method
Poisson equation
Tensor analysis

a b s t r a c t
This paper presents the application of tensor analysis to the nite element (FE) method. A FE
formulation is presented where the sufx notation and the Einsteins convention are used
instead of the matrix algebra notation. The usage of the proposed notation avoids the drawbacks of matrix algebra and allows the easy implementation of the FE method in a computer
code. The Dirichlet boundary condition is included in the FE formulation through the use of
sufx constraints. Afterwards, the sufx notation is applied to the FE formulation of the
Poisson equation and it is implemented in a C language. Finally, two numerical examples
are solved to illustrate the advantages of using the proposed notation in the FE method.
2012 Elsevier Inc. All rights reserved.

1. Introduction
The nite element (FE) is a numerical method which was introduced by Courant in 1943 and can be used for solving partial
differential equations (PDE) [15]. The FE method has also been successfully applied in the solution of multiphysics problems
[68]. This numerical method assumes a test function of the unknown variable within a discrete domain. The test function can
be linear which is represented by triangular elements [9]. However, some authors have used a high order polynomial approximation in the element representation [10]. The accuracy of the nite element method (FEM) is dependant on the order of the
test functions and the level of the mesh discretization. Nevertheless, a high computation time is needed in a ne discretized
mesh with higher order test functions due the large number of unknown variables. The traditional FE formulations involve
matrix algebra which may be difcult to handle due to the diversity of variables and equations in engineering problems [11].
This paper proposes the usage of the sufx notation and the Einstein summation convention in the FEM. The sufx notation
can handle multiple equations that otherwise must be represented by arrays [12]. The resulting shorthand FE formulation is
more compact, more understandable and easier to program in a computer language than the classical FE matrix formulation.
The introduction of sufxes reduces the number of equations in the mathematical processes without affecting the meaning of
the equations [13]. Some PDEs contain tensors and complex matrix operations due to the large number of resulting discrete
equations [14]. Some examples are found in the NavierStokes and Maxwell equations where the viscous tensor and the presence of anisotropic materials are modeled [4,15]. The developed shorthand FE formulation uses sufxes to reduce the set of
equations (matrix) into a single equation. Afterwards, the common operations used in algebra, differentiation and integration
are applied to the single equation giving the system solution. The improvement attained by applying the notation in the FEM
allows the search of new algorithms and solution strategies for the PDEs [16]. Wherefore, some investigators use tensors in
their research [17]. The mathematical operations using sufxes could represent an obstacle to its usage, nonetheless there is
literature where a brief introduction to tensor theory can be found [18,19].

Corresponding author.
E-mail address: marjona@ieee.org (M.A. Arjona).
0096-3003/$ - see front matter 2012 Elsevier Inc. All rights reserved.
http://dx.doi.org/10.1016/j.amc.2012.10.074

4626

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

The paper rstly presents the use of the tensor notation in the FE method. Afterwards, the solution of the Poisson equation
is presented to illustrate the advantages of the sufx notation. Finally, the shorthand FE formulation of an example is coded
in C programming language.
2. The nite element method
A dependent variable in a PDE is a function of multiple continuous variables in the space and time domains [9]. The PDE is
solved for the dependent variable using traditional mathematical techniques where the boundary conditions are taken into
account. In the FEM, a test function is proposed for the dependent variable without having to solve the PDE [20]. A simple
test function is dened by (1)

/ X i ai

where / is the potential, X represents the shape vector, a is a row vector, and i = 1, 2, 3.
A repeated sufx in (1) involves a summation which is known as the Einsteins summation convention [12,15]. The convention is used to achieve a compact notation. The Einsteins summation convention establishes that,

mi ni m1 n1 m2 n2 m3 n3

where m and n are functions of the sufx i. The shape vector contains the space variables and is dened as (3)

X1 1 X2 x X3 y

while the values for the row vector are given by (4)

a1 a a2 b a3 c

where a, b, and c are unknown constants.


The constants ai are calculated using the FEM and their magnitudes are determined by the physical problem and the
boundary conditions.
Eq. (1) requires a system of i equations to obtain the ai constants. Wherefore, three distinct potentials j are obtained once
the linear variation (1) has been considered in a triangular region for the three nodes in the space as it shown in Fig. 1. The
system of equations can be dened by (5)

/j Gji ai

where j = 1, 2, 3, and

1 x1

y1

1 x3

y3

6
Gji 4 1 x2

7
y2 5

The triangular region is named element while the vertices are known as nodes (see Fig. 1) [1,5]. The nodal potentials /j are
unknown variables, hence the constants ai may be dened as functions of the nodal potentials and they are given by (7)

ai g ij /j

where

Fig. 1. A rst-order nite element.

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

4627

Fig. 2. The shape functions represented by three planes in the space.

2
6
4

x2 y3  x3 y2 x3 y1  x1 y3 x1 y2  x2 y1

g ij G1
ji

y2  y3

y3  y1

y1  y2

x3  x2

x1  x3
2S

x2  x1

3
7
5

and S is the area of an element and it is dened by (9)

x2  x1 y3  y1  x3  x1 y2  y1
2

In this paper, the tensor gij is dened as the geometrical weight tensor because it contains the geometric information of
the nite element.
The potential distribution / throughout the element is attained from (7) and (1); (10) describes the linear variation of the
potential / within the triangular region

/ X i g ij /j

10
ij

The product Xig is a set of three lineal equations known as the shape functions and they are given by (11)

aj X i g ij

11

The shape functions have the following properties,

X i xk ; yk g ij

1 kj
0

kj

12

where Xi (xk, yk) represents a shape vector Xi which is a function of the space variables x and y.
The shape functions are represented by three planes in the space throughout the triangular element and they are shown
in Fig. 2. The potential distribution / within the triangular element is attained with the superposition of the shape functions.
3. Discretization of the Poisson equation
The Poisson equation is a PDE with a wide range of applications in electrostatics, magnetostatic, mechanics and theoretical physics problems [2123]. The Poisson equation is used to predict the distribution of the eld variable in the space. Due
to broad relevance of this PDE, the discretization of the Poisson equation using the sufx notation and the Einstein convention are explained in this section. The sufx notation of the Poisson equation is shown by Eq. (13)

C@ l @ l / f

13

where C is a constant related to the material properties, f is the source term, l = 2, 3, and @ l is a differentiation operator that is
dened by (14)

@l

@
@X l

14

Eq. (13) replaces the classical vector notation of the Poisson equation which is given by (15)

C r2 / f

15

Afterwards, the potential distribution (10) is used in (13) to obtain the discrete form of the Poisson equation that is given
by (16)

C@ l @ l aj /j f

16

In this paper, the Galerkin Residual method represented by the integral Eq. (17) is used to solve the discrete Eq. (16) [5]

Z
X

ak dX

17

4628

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

where X represents a surface (triangular area) and a are the weight functions.
In the Galerkin method, the weight functions a are identical to the shape functions [1]. After applying the Galerkin method to Eq. (16), the expression (18) is obtained

ak @ l @ l aj /j dX

ak fdX

18

where k = 1, 2, 3.
The Eq. (18) represents a set of three equations related to the triangular element. Some mathematical properties might be
applied to (18). The application of the properties (19) and (20) transforms Eq. (18) into (21)

ak @ l @ l aj /j @ l ak @ l aj /j  @ l ak @ l aj /j
Z

@ l ak @ l aj /j dX

19

ak @ l aj /j dC

20

Eq. (20) is analogous to the Gauss Divergence theorem for open surfaces X of closed perimeter C [22,23]

ak @ l aj /j dC  C

@ l ak @ l aj /j dX

ak fdX

21

The rst integral in Eq. (21) represents a Neumann condition imposed over the contour C; wherefore the term @ laj/j is a
known function and the discrete contour integral is given by (22)

ak @ l aj /j dC C@ l aj /j

22

The second integral in (21) is solved throughout the triangular element and the expression (23) is obtained

C

@ l ak @ l aj /j dX C@ l ak @ l aj /j S

23

Nevertheless, a simplied form of Eq. (23) is achieved when (11) and the Einstein summation convention are applied in
the sufx l resulting in (24)

C@ l ak @ l aj /j S CSg lk g lj /j

24

Finally, the solution for the integral that contains the source terms in (21) is given by (25)

ak fdX f

S
3

25

Eqs. (21)(25) are used to obtain the shorthand FE formulation of the Poisson equation that is shown in (26)

Rkj /j Bk
kj

26
lk lj

where R = CSg g and B = (fS/3)  (C@ la /jC/2).


The expression (26) represents three equations for each element; otherwise it would be represented by a large array if
matrix notation is used. The resulting shorthand FE formulation (26) is more compact and understandable than the classical
FE matrix formulation. The process of assembling individual elements to achieve a global system and taking into account the
Dirichlet conditions to (26) is best illustrated with an example. A two element mesh is shown in Fig. 3, where Eq. (26) is
applied and two different arrays Rmn are attained as R1ij and R2kl.

Fig. 3. Finite elements with local and global node numbering.

4629

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636


Table 1
Global assembly and node contributions for the mesh shown in Fig. 3.
Node

R51 5
R81 5
5
R11
1
5
R23
2

8
11
23

8
R52 5
R82 5

R51 8
R81 8
8
R11
1
8
R23
2

R52 8
R82 8

11

23

R51 11
R81 11
11
R11
1

R52

23

R82

23

R23
2

23

Fig. 3 shows two different node numberings for each element. The node numbering at the right mesh is local while the
numbering at the left mesh is known as global. Local numbering goes from 1 to 3 at each element and counterclockwise to
avoid the presence of negative discrete areas. The local array Rij, kl is assembled using the local numbering of each element.
The global array Rmn is assembled by replacing the local node number with its equivalent global node number, i.e., the node 5
of the element 1 has the local number 3 and the same process applies to the rest of the nodes and elements of the mesh. The
global Rmn represents an m  n array that contains the relationship between the elements and nodes of the mesh, i.e. the
assembling of the elements is attained by the nodes 5 and 8. Table 1 shows the global assembly and the node contributions
achieved for the mesh shown in Fig. 3.
The global array Rmn shown in Table 1 is also known as the stiffness matrix. The stiffness matrix is a function of the geometrical weight tensor (8). Table 1 shows the diagonal values that are obtained from the node contribution of each element
and the off-diagonal values that are obtained from the contribution of the neighbor nodes. Similarly, the Dirichlet nodes are
assembled in (26) by imposing the sufx constraints given by Eq. (27)

" n n
dk dj
Rkj

#


dnk dnj Rkj /j Bk dnk dnk  dnj dkj Rkj /n

27

where n is the known global node, k = 1, 2..nodes number, and j = 1, 2..nodes number. The operator d is named Delta Kronecker
operator and it has the properties dened by (28) [12]

dji

1 ij
0 ij

28

and its opposite value is dened by (29)

dj
i

0 ij
1

29

ij

Eq. (27) demonstrates the advantages of the sufx notation and how it allows handling the Dirichlet boundary conditions
clearer and easier than using the matrix formulation.
4. Numerical examples
Two numerical examples are shown in this section to illustrate the application of the shorthand FE formulation of the
Poisson equation. The rst example deals with the sufx manipulation in tensor analysis while in the second example a magnetostatic problem is solved.
4.1. Example I: Sufx manipulation in tensors
This example shows how to deal with the sufx manipulation to obtain the array Rmn and the vector Bm in a global node
assembly [1]. The studied mesh has two elements and four nodes as it is shown in Fig. 4. The rst element represents the
source with f = 1 while the nodes 1 and 3 are known quantities (Dirichlet nodes). In this example, the constant C is chosen
to have the value of one at each element. The local assembling Rkj for the rst element is given by Eq. (30)

 2k 2j

3k 3j
Rkj
1 S g g g g

30

mn

The values g are calculated using tensor (8) for k = 1, 2, 3, and j = 1, 2, 3; whereas the area S is obtained by using (9). The
Rkj and Bk achieved for the rst element are shown in (31)

1:236

6
R1 4 0:7786

0:4571

0:7786

0:4571

7
0:6929 0:0857 5;
0:0857 0:3714

3
2 3 2
0:116
1
0:35
7
6 7 6
B1
4 1 5 4 0:116 5
3
0:116
1

31

4630

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

Fig. 4. FE mesh used for the example I.

Table 2
Global assembly and node contributions for the mesh shown in Fig. 4.
Node

R11

R11 2

R11

1:236

R11

0:7786

R21 2
R12 2
R21 3

0:4571

0:7786

R12 1

1:25

0:4571
R12

0:0143

R11

R12 2
R22 2
R22 3

R21 3
R22 3
R31 3

0:4571
0:8238
0:3667

Fig. 5. Domain used in the shorthand FE model.

Fig. 6. FE mesh used in the example II.

0:4571
R12

0:0143

0:3667
R32

0:8381

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

Fig. 7. Flowchart of the shorthand FE model.

Fig. 8. Magnetic vector potential distribution for the magnetostatic problem.

4631

4632

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

Likewise, the Rkj and Bk calculated for the second element are shown in (32)

0:5571

6
R2 4 0:4571
0:1

0:4571
0:8238
0:3667

0:1

7
0:3667 5;
0:4667

2 3 2 3
0
0
0:525
6 7 6 7
2
B
405 405
3
0
0

32

The assembling process of the individual elements shown in Fig. 4 to obtain a global connection is best illustrated with
the numerical data shown in Table 2.
Whereas the terms in the global array Bm, are: B1 = 0.116, B2 = 0.116, B3 = 0, B4 = 0.116.
The assembling process of the Dirichlet nodes in (27) is illustrated for the second row of the global array Rmn. The second
row in the global array Rmn corresponds to the relationship between node 2 and nodes 1, 3, and 4. Hence the second row
(k = 2) is given by (33)

" n n
d2 dj
R

2j

dn dn
2 j



R2j /j B2 dn2 dn2  dnj d2j R2j /n

33

There are two Dirichlet boundary conditions at nodes 1 (n = 1) and 3 (n = 3). For node 1, the expression (33) is transformed into Eq. (34)

d1j R2j /j B2  d1j d2j R2j /1

34

The left hand side of (34) manipulates the global array Rmn at the elements in the second row and rst column (j = 1). Therefore, the second row of the global array Rmn change its values to: R21 = 0, R22 = 1.25, R23 = 0.4571, and R24 = 0.0143. The right
side of (34) is equivalent to have B2 due /1 = 0 which means that B2 = 0.116. For the node 3, the expression (35) is obtained

d3j R2j /j B2  d3j d2j R2j /3

35
mn

The left side of (35) manipulates the global array R at the elements in the second row and the third column (j = 3).
Wherefore, the second row of the global Rmn becomes: R21 = 0, R22 = 1.25, R23 = 0, and R24 = 0.0143.
The right hand side of expression (35) is re-evaluated due to the R23 and /3 quantities and it gives B2 = 4.455. By applying the same process to the rest of the rows, the nal system is obtained as (36)

60
6
6
40

1:25

0 0:0143 0

32

/1

7
6 7 6
0:0143 7
76 /2 7 6 4:455 7
7
76 7 6
4
5
5
4
10 5
0
/3
0:8381

/4

36

3:541

The solution of (36) gives a result of [/1/2/3/4]T = [0 3.612 10 4.297]T.


The employment of the shorthand FE formulation allows a clearer and easier programming of the Dirichlet boundary conditions than the matrix based formulation. Usually little attention in the FE programming is given to this point and it is assumed that the reader understands how to program the FEM into a computer program [24]. The programming stage is more
difcult to grasp when it does not exist a clear relationship between the matrix formulation and the program syntax and
structure. The next subsection shows the application of the shorthand FE formulation to solve a physical problem.
4.2. Example II: A shorthand FE model for solving a magnetostatic problem
In electromagnetics, the Poisson equation is used to describe the magnetic eld distribution produced by a current density
and/or a constant magnetic ux [2123]. The magnetostatic eld can be obtained by using the relationships (37) in Eq. (13)

9
C 1=l0 lr >
=
f J
>
;
/ Az

37

Therefore the Poisson equation (38) is obtained in sufx notation

l0 lr

@ l @ l Az J

38

where J (A/m2) is the current density, Az is the magnetic vector potential, l0 (Wb/(Am)) is the free-space magnetic permeability and lr the relative magnetic permeability.
Eq. (38) is solved to nd the magnetic vector potential distribution over the problem domain shown in Fig. 5 where an
innitely long square wire with a current density J has been placed in the air. The corresponding FE mesh is seen in Fig. 6
[25,26].
Unlike Example I, Fig. 6 contains a larger number of nite elements (146 elements). However, the solution of this problem
without a computer program would be very difcult. The owchart of the developed FE computer program is shown in Fig. 7.
A brief description of each stage is explained next.

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

4633

Step 1: Input data. Relevant information is input to the program, i.e., the number of nodes, number of elements, region
labels, material properties and boundary conditions.
Step 2: Element global connection. The FE global assembling is achieved with the help of the local and global node numbering. The system is assembled by using (26) with the corrections given by (37) for the magnetic vector potential distribution analysis. Eq. (26) requires a memory allocation to store the data. At this step, it is necessary to take care of the sufx
dynamics. An erroneous sufx numeration will generate an error in the nal global assembly.
Step 3: Boundary conditions. Eq. (27) can be programmed using if-then conditions and for loops. Although the Dirichlet
boundary conditions can be explained with matrix algebra, Eq. (27) represents a more general function that is easier to program than using the matrix notation. As it was demonstrated in the rst numerical example, the Dirichlet boundary conditions modify the global assembling by applying Eq. (27).
Step 4: Solution. The solution of the system can be achieved by solving the set of equations with a direct or iterative solver.
Step 5: Post-processing. Due the computer program gives only numerical results, it is necessary to have a post-processing
stage to plot the magnetic vector potential distribution [27]. The magnetic vector potential distribution for this example is
shown in Fig. 8.
Appendix A presents the C program developed for solving the proposed shorthand FE model dened by (27). The sufx
dynamics and the Delta Kronecker operator were implemented using if-then conditions and for loops in the computer code.
The mesh le used in the C program is shown in the appendix. The mesh le must be named mesh_1.txt and be written with
the following data format: (1) number of nodes, (2) number of elements, (3) x y coordinates, (4) nodes per element, f and C
values, (5) number of boundary condition nodes, and (6) boundary node number and its value.
5. Conclusions
This paper has demonstrated the application of tensor analysis to the nite element method. It was found that the sufx
notation improves the FE formulation. The proposed shorthand FE formulation is more compact and understandable than the
classical FE matrix formulation. The developed shorthand FE formulation allows a clearer and easier programming of the FE
and the Dirichlet conditions compared with the programming derived from the matrix formulation. In addition, the computational programming is simpler due the similarities between the sufx dynamics and the program syntax and structure. To
illustrate the application of this formulation, a C language program was presented.
Acknowledgements
The authors would like to thank to CONACYT, DGEST and Instituto Tecnolgico de La Laguna for their nancial support.
Appendix A
A computer program developed in C programming language is given in this appendix. It illustrates the application of tensor analysis to the solution of the Poisson equation with the FEM.

4634

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

4635

4636

C. Hernandez et al. / Applied Mathematics and Computation 219 (2013) 46254636

References
[1] M. Sadiku, A simple introduction to nite element analysis of electromagnetic problems, IEEE Transactions on Education 32 (1989) 8593.
[2] T. Jangveladze, Z. Kiguradze, B. Neta, Galerkin nite element method for on nonlinear integro-differential model, Applied Mathematics and
Computation 217 (2011) 68836892.
[3] D. Cho, A note on the singular linear system of the generalized nite element methods, Applied Mathematics and Computation 217 (2011) 66916699.
[4] J.P.A. Bastos, N. Sadowski, Electromagnetic Modeling by Finite Element Methods, rst ed., Marcel Dekker, Inc., New York, 2003.
[5] D.S. Burnett, Finite Element Analysis: From Concepts to Applications, rst ed., Addison Wesley Publishing Company, Inc., Massachusetts, 1987.
[6] G. Henneberger, K. Sattler, W. Hadrys, Coupling of magnetic and uid ow problems and its application in induction melting apparatus, IEEE
Transactions on Magnetics 29 (1993) 15891594.
[7] K. Preis, O. Bir, G. Buchgraber, I. Ticar, Thermal electromagnetic coupling in the nite element simulation of power transformers, IEEE Transactions on
Magnetics 42 (2006). 999-102.
[8] J. Driesen, G. Delige, R. Belmans, K. Hameyer, Coupled thermo-magnetic simulation of a foil-winding transformer connected to a non-linear load, IEEE
Transactions on Magnetics 36 (2000) 13811385.
[9] N. Ida, Engineering Electromagnetics, second ed., Springer, 2003.
[10] Jian-Ming Jin, The Finite Element Method in Electromagnetics, second ed., IEEE Computer Society Press, 2002.
[11] O.C. Zienkiewics, R.L. Taylor, The Finite Element Method Vol. 1: The Basis, fth ed., Butterworth Heinemann, Oxford, 2000.
[12] J. Foster, J.D. Nightingale, A Short Course in General Relativity, third ed., Springer, 2006.
[13] P. Comon, Tensors versus matrices usefulness and unexpected properties, in: IEEE/SP 15th Workshop on Statistical Signal Processing, vol. 1, 2009, pp.
782788.
[14] A.D. Napoli, An approach to DC motor modeling and parameter calculation using nite element analysis and tensor mathematics, IEEE Transactions on
Power Apparatus and Systems 102 (1983) 27992804.
[15] O.C. Zienkiewics, R.L. Taylor, The Finite Element Method Vol. 3: Fluid Dynamics, fth ed., Butterworth Heinemann, Oxford, 2000.
[16] R.B.B. Ovando-Martinez, M.A. Arjona, C. Hernandez Flores, A nite-element variable time-stepping algorithm for solving the electromagnetic diffusion
equation, IEEE Transactions on Magnetics 48 (2012) 647650.
[17] S.P. Drake, K. Dogancay, Some applications of tensor algebra to estimation theory, in: Third International Symposium on Wireless Pervasive
Computing, vol. 1, 2008, pp. 106110.
[18] C.W. Misner, K.S. Thorne, J.A. Wheeler, Gravitation, rst ed., W.H. Freeman and Co., 1973.
[19] C.K. Gordon, An introduction to the rudiments of tensor analysis, IEEE Transactions on Education 8 (1965) 94106.
[20] R.W. Lewis, P. Nithiarasu, N.S. Kankanhally, Fundaments of the Finite Element Method for Heat and Fluid Flow, rst ed., Wiley, 2004.
[21] P. Hammond, Applied Electromagnetism, rst ed., Pergamon Press, New York, 1971.
[22] W.H. Hayt, Teora Electromagnetica, fth ed., Mc. Graw Hill, Mxico, 1991.
[23] A.M. Portis, Electromagnetic Fields Source and Media, rst ed., John Wiley & Sons, New York, 1978.
[24] L.M. Smith, D.V. Grifths, Programming the Finite Element Method, second ed., John Wiley & Sons, 1988.
[25] Areva T&D SLIM Electromagnetic Software, User Manual, England, UK, 2008.
[26] COMSOL Users Manual, 2009.
[27] MATLAB Users Manual, 2007.