For example consider a two-dimensional problem
formulated in a Cartesian coordinate system . The
boundary values of may well be given with respect to this system of
axes. Thus on a boundary
A straight boundary not parallel with the coordinate axes does not present real difficulty since and will be constants. However in the most general case, where the boundary could be any smooth curve, and will be functions of position. Within the context of finite element analysis the direction cosines will be required on sides of elements.
In general the element
in global coordinates is generated from a parent element by
means of some isoparametric transformation. The most
used transformation is
As an example, consider the triangular elements in Figure 4.2. Figure 4.2(a) shows the elements in the global coordinate system and Figure 4.2(b) shows the parent element. The boundary is approximated by a series of element sides; for each side the outward normal is required.
The construction of these direction cosines is based on two
results (Rutherford, 1962).
Firstly any element side can be presented as part of a set
of equipotential surfaces in the coordinate system.
These are characterised by
The second is a result from coordinate geometry:
If at any point P on the surface , then is perpendicular to the surface, passing through P,where
In the local coordinate system the direction cosines
outward normal to any of the sides are simple to calculate.
As in the global case these are proportional to the components
of , where is the equation of one of the element sides; hence
Only the direction of the normal is given so finally the vector is normalised. The components of this normalised vector will be the direction cosines and . Within the context of a finite element program (Segment 3.2 is the best example) the code to calculate the direction cosines is contained within the boundary integration loop since the normal direction will be required at the Gauss points on the boundary:
CALL MATMUL(LDER, ILDER, JLDER, GEOM, IGEOM, JGEOM, JAC, * IJAC, JJAC, DIMEN, NODEL, DIMEN, ITEST) CALL MATINV(JAC, IJAC, JJAC, JACIN, IJACIN, JJACIN, DIMEN, * DET, ITEST) CALL DCSTRI(JACIN, IJACIN, JJACIN, SIDNUM, COSIN, ICOSIN, * ITEST)The routine DCSTRI uses the current transformation Jacobian and the side number ( SIDNUM) on which the direction cosines are required to make the calculation. The direction cosines are return in COSIN. The code above forms the Jacobian ( JAC) using (2.25) and then inverts it using MATINV. The routines DCSQUA and DCSBRK perform similar operations for rectangular and brick elements.