# 2.10 Norm and residues

## 2.10.1 Norm corresponding to D.S. B

Comparing the exact solution with the calculated solution consists of computing, at each node:

• the difference
• the relative difference
• the percentage

where is the exact solution and is the calculated solution, and printing, for each degree of freedom:

• the error norm
• the relative error norm
• the relative error norm
• the maximum error

by indicating in addition the number and coordinates of the node where the maximum occurs.

Preprocessor NORMXX compares the calculated solution with the exact solution for those cases where the solution to a problem is known analytically. It calls module NORME:

```      SUBROUTINE NORME (M,XM,DM,NFMAIL,NIMAIL,NFCOOR,NICOOR,NFB,NIB,
+   NFBS,NIBS,INDICB,NSM,FONINT,SOLEX,DSOLEX)
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C    AIM  : IPRINT THE EXACT SOLUTION, THE CALCULATED SOLUTION,
C    ---    THE ABSOLUTE AND RELATIVE DIFFERENCES BETWEEN THEM,
C           THE L1,L2 ERRORS AND MAX
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```

where

• M, XM and DM designates the super array,
• NFMAIL, NIMAIL are the file number and level of structure MAIL,
• NFCOOR, NICOOR are the file number and level of structure COOR,
• NFB, NIB are the file number and level of structure B,
• NFBS, NIBS are the file number and level of structure B on exit,
• INDICB is the save option:
1 : the error is stored in NFBS (used in this case), 0 if not,
• NSM is the number of the load case to consider (between 1 and NDSM),
• FONINT is a logical set to .TRUE. if functions SOLEX or DSOLEX are input as interpreted functions, and set to .FALSE. if they are input in the classical manner,
• SOLEX, DSOLEX are the functions used to input the exact solution (in single or double precision).

Depending on the value of FONINT, functions SOLEX or DSOLEX must be written using the following format:

```      FUNCTION SOLEX(I,X,Y,Z)

DOUBLE PRECISION FUNCTION DSOLEX(I,X,Y,Z)
```

where I is the degree of freedom number of the node with coordinates X, Y and Z.

## 2.10.2 Norm corresponding to D.S. TAE

Preprocessor NORMXX compares the calculated stresses with the exact solution for those cases where the stresses of elasticity problem is known analytically, using the same method of computation as for a D.S. B as seen above. It calls module NORTAE:

```      SUBROUTINE NORTAE(M,XM,DM,NFTAE,NITAE,NFTAES,NITAES,INDICB,
+                  FONINT,SOLEX,DSOLEX,NSM,NC1)
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C    AIM  : PRINT THE EXACT SOLUTION THE CALCULATED SOLUTION,
C    ---    THE ABSOLUTE AND RELATIVE DIFFERENCES BETWEEN THEM,
C           THE L1,L2 ERRORS AND MAX FOR A SOLUTION GIVEN BY TAES
C ..................................................................
```

where

• M, XM and DM designates the super array,
• NFTAE, NITAE are the file number and level of structure TAE,
• NFTAES, NITAES are the file number and level of structure TAES on exit,
• INDICB is the save option:
1 : the error is stored in NFTAES (used in this case), 0 if not,
• NSM is the number of the load case to consider (between 1 and NDSM),
• FONINT is a logical set to .TRUE. if functions SOLEX or DSOLEX are input as interpreted functions, and set to .FALSE. if they are input in the classical manner,
• SOLEX, DSOLEX are the functions used to input the exact solution (in single or double precision).

Depending on the value of FONINT, functions SOLEX or DSOLEX must be written using the following format:

```      FUNCTION SOLEX(I,X,Y,Z)

DOUBLE PRECISION FUNCTION DSOLEX(I,X,Y,Z)
```

where I is the component number of the stresses treated, and X, Y and Z are the coordinates of the computational point of this stress.

## 2.10.3 Energy norm corresponding to D.S. B

Preprocessor NORMXX calculates the energy norm between the exact solution and the solution obtained when solving the problem, for those cases where the solution to a problem is known analytically.

It calls module ENERGI:

```

SUBROUTINE ENERGI (M,XM,DM,NFMAIL,NIMAIL,NFCOOR,NICOOR,NFB,NIB,
+   NFTAE,NITAE,NSM,FONINT,SOLEX,DSOLEX)
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C    AIM  : CALCULATE THE ENERGY ERROR NORM
C    ---    |A ( U-UH ; U-UH )|
C ..................................................................
```

where

• M, XM and DM designates the super array,
• NFMAIL, NIMAIL are the file number and level of structure MAIL,
• NFCOOR, NICOOR are the file number and level of structure COOR,
• NFB, NIB are the file number and level of structure B,
• NFTAE, NITAE are the file number and level of structure TAE,
• NSM is the number of the load case to consider (between 1 and NDSM),
• FONINT is a logical set to .TRUE. if functions SOLEX or DSOLEX are input as interpreted functions, and set to .FALSE. if they are input in the classical manner,
• SOLEX, DSOLEX are the functions used to input the exact solution (in single or double precision).

Depending on the value of FONINT, functions SOLEX or DSOLEX must be written using the following format:

```      FUNCTION SOLEX(I,X,Y,Z)

DOUBLE PRECISION FUNCTION DSOLEX(I,X,Y,Z)
```

where I is the number of the degree of freedom of the node with coordinates X, Y et Z.

## 2.10.4 Solution error for D.S. B

Module ERREUR calculates the solution error for a linear system from the solution of this system and the element matrices and right-hand-side vectors. For clamped degrees of freedom, the result of this computation indicates the reaction.

```      SUBROUTINE ERREUR(M,NFTAE,NITAE,NFB,NIB,NFNDL1,NINDL1,NFBER,
+                  NIBER,NTBER,NOT1,NOT2)
C  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C  AIM : COMPUTE THE ERROR VECTOR.
C  ---
C  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```

where

• M is the super array,
• NFTAE, NITAE are the file number and level of structure TAE of element arrays,
• NFB, NIB are the file number and level of structure B, the computed solution,
• NFNDL1, NINDL1 are the file number and level of the eventual structure NDL1,
• NFBER, NIBER and NTBER are the file number, level and the number of arrays to associate with the output structure, B, the solution error,
• NOT1 is the number of the element array containing the stiffness matrices,
• NOT2 is the number of the element array containing the right-hand-side vectors.

If NTBER is non-zero, the associated descriptive arrays must be input (see above).

Next: 3 Manipulation of structures and miscellaneous Up: 2 Manipulation of solutions Prev: 2.9 Extrema of a D.S. B Contents