next up previous contents
Next: 4.1.5 Neumann Boundary Condition Up: 4.1 Two-Dimensional Scalar Finite Previous: 4.1.3 Introduction of Triangle   Contents

4.1.4 Assembling

The assembling of the matrix $ [K]$ and the right hand side vector $ \{d\}$ from (4.20) is demonstrated in the discretized domain $ \mathcal{A}$ from Fig. <4.4>. The entire domain is discretized and consists of the triangular elements $ \mathcal{A}_1$ to $ \mathcal{A}_{10}$ . The Dirichlet boundary $ \mathcal{C}_D$ is given by the curve elements $ \mathcal{C}_1$ , $ \mathcal{C}_3$ , $ \mathcal{C}_6$ , $ \mathcal{C}_7$ and $ \mathcal{C}_8$ . The Neumann boundary $ \mathcal{C}_N$ contains the curve elements $ \mathcal{C}_2$ , $ \mathcal{C}_4$ and $ \mathcal{C}_5$ . In the entire domain $ \mathcal{A}$ the nodes are numbered globally. In Fig. <4.4> the global node numbers are enclosed in circles. Since each element has three nodes, a local (element) number can be assigned to a node additionally to the global number. To map the local node number to the global one the so called connectivity array is used:

\begin{displaymath}\begin{array}{c\vert ccc} \mathrm{element} & \mathrm{Node} 1...
...8 & 8 & 1 & 10  9 & 3 & 9 & 10  10 & 10 & 9 & 7 \end{array}\end{displaymath}    

Figure 4.4: Node and element numbering in a discretized domain $ \mathcal{A}$ .
\includegraphics[width=14cm]{figures/scalarfem2d/discretized.eps}

Considering (4.40) the global shape function $ \lambda_i$ is given by the union of all element (or local) shape functions, which are $ 1$ for the global node $ i$ . From the local property (4.40) the global criterion follows

$\displaystyle \lambda_i(\vec{r}_j) = \delta_{ij} = \left\{ \begin{array}{lc} 1 & i = j  0 & i \neq j \end{array} \right.,$ (4.46)

where $ \vec{r}_j$ is the position vector of the node $ j$ . For example, the global trial function $ \lambda_1$ and $ \lambda_{10}$ (Fig. <4.4>) are given by

\begin{displaymath}\begin{split}\lambda_{1} & = \lambda_3^{e=\mathcal{A}_1} +  ...
...^{e=\mathcal{A}_7} +  \lambda_3^{e=\mathcal{A}_8}. \end{split}\end{displaymath}    

The plus operators must be treated as union operators, because the element form functions must not overlap. Taking into account the continuity of the solution across the element edges, it can be seen, that the coefficients $ c_j,  j\in[1;n]$ comply with the values of the field approximation $ \tilde{\varphi}(\vec{r}_j)$ (in the global node $ j$ ). The notation $ \lambda_j^{e=\mathcal{A}_i}$ means the $ j$ -th local (element) function $ \lambda_j$ in the $ i$ -th triangular element $ \mathcal{A}_i$ . The subscript index of the element form function (superscript expression $ e = \mathcal{A}_i$ ) complies with the local node number in the $ i$ -th element. The corresponding global node number is taken from the connectivity array and is equal to the global trial function number. The global trial function $ \lambda_i$ is non-zero only in the elements which are attached to the node with global number $ i$ . As a consequence $ \lambda_i$ is non-zero in a very narrow area. With these considerations the matrix entry $ K_{ij}$ can be build piece wise in the elements sharing the global $ i$ -th and $ j$ -th nodes from the corresponding element form functions. For example the matrix element $ K_{1,10}$ is given by

$\displaystyle K_{1,10} = \int_{\mathcal{A}}\vec{\nabla}\lambda_1\cdot\utilde{\e...
...bla}\lambda_2^e\cdot\utilde{\epsilon}\cdot\vec{\nabla}\lambda_3^e \mathrm{d}A.$ (4.47)

Analogously the remaining matrix entries are built. Most of the matrix entries correspond to global nodes, which do not belong to common elements and are zero for this reason. For instance, $ K_{10,5}$ is such an entry. Thus $ \left[K\right]$ is a sparse matrix.

Assembling $ \left[K\right]$ like in (4.47) needs information of the neighbor nodes and the corresponding common elements. This information is contained in the connectivity array, unfortunately it cannot be obtained directly. Thus the assembling is performed in a different, reverse way. If the assembling of $ [K]$ is performed as in (4.47), it can be seen that all possible variations of the element form functions

$\displaystyle K_{ij}^e = \int_{\mathcal{A}^e}\vec{\nabla}\lambda_i^e\cdot\utilde{\epsilon}\cdot\vec{\nabla}\lambda_j^e \mathrm{d}A,   i\in[1;3], j\in[1;3]$ (4.48)

in all elements can be found as a summand in an expression for a matrix entry $ K_{ij}$ . The assembling proceeds element by element. For each element all possible variations (4.48) are calculated and added to the corresponding global matrix entry $ K_{ij}$ . Instead of $ e{=}\mathcal{A}_i$ now the superscript index $ e$ is used, since by the element wise assembling the current element number is known implicitly. Thus the superscript index $ e$ refers to the current element and notes that the indexes $ i$ and $ j$ are element (local) indexes. Otherwise, if no superscript index $ e$ is written, $ i$ and $ j$ are global indexes. The local indexes are transformed to the corresponding global ones by the connectivity array. The global matrix $ [K]$ is built from the element matrices $ [K]^e$ on a very efficient way. Thus the finite element formulation for a given problem is mostly solved by giving the general expressions for the entries of the element matrices [48,49].

Let the permittivity $ \utilde{\epsilon}$ be scalar ( $ \utilde{\epsilon} \rightarrow \epsilon$ ) and element wise constant for the further calculations. Thus using (4.41), the element matrix for the current problem is given by

\begin{displaymath}\begin{split}K_{11}^e & = \int_{\mathcal{A}_e}\epsilon \vec{...
...rac{\epsilon}{4F_e} \vec{r}_{12}\cdot\vec{r}_{12}. \end{split}\end{displaymath} (4.49)

The Dirichlet boundary is considered by the coefficients $ c_j$ for $ j\in[n{+}1;m]$ , which are easily obtained from (4.23) taking (4.46) into account

$\displaystyle c_j = v({\vec{r}_j}).$    

The contributions of the Dirichlet boundary to the right hand side vector $ \{d\}$ are assembled mutually with the global matrix $ [K]$ using (4.24). The region $ \mathcal{A}$ is proceeded element by element. For each element the element matrix (4.49) is calculated, the local indexes $ i$ and $ j$ of the element matrix entry $ K_{ij}^e$ are converted to the corresponding global indexes $ i$ and $ j$ of the global matrix entry $ K_{ij}$ by the connectivity array. The superscript $ e$ provides the distinction between $ i$ and $ j$ used as local or global nodes. By the global index $ j$ it is recognized, if $ K_{ij}^e$ is added to $ K_{ij}$ as a contribution to the matrix on the left side or if $ K_{ij}^e$ is multiplied by the known Dirichlet coefficient $ c_j$ and added to $ d_i$ , to the right hand side vector.


next up previous contents
Next: 4.1.5 Neumann Boundary Condition Up: 4.1 Two-Dimensional Scalar Finite Previous: 4.1.3 Introduction of Triangle   Contents

A. Nentchev: Numerical Analysis and Simulation in Microelectronics by Vector Finite Elements