Abstract
Classical techniques construct approximations from globally kinematically admissible functions, which we define as functions that satisfy the displacement boundary condition beforehand.
Access provided by CONRICYT-eBooks. Download chapter PDF
Keywords
- Displacement Boundary Conditions
- Quadratic Basis Functions
- Global Entry
- Quadratic finite Element Approximation
- Actual Problem Domain
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
3.1 Introduction
Classical techniques construct approximations from globally kinematically admissible functions, which we define as functions that satisfy the displacement boundary condition beforehand. Two main obstacles arise: (1) it may be very difficult to find a kinematically admissible function over the entire domain and (2) if such functions are found they lead to large, strongly coupled and complicated systems of equations. These problems have been overcome by the fact that local approximations (posed over very small partitions of the entire domain) can deliver high-quality solutions and simultaneously lead to systems of equations which have an advantageous mathematical structure amenable to large-scale computation by high-speed computers. These piecewise or “elementwise” approximations have been recognized at least 60 years ago by Courant [1] as being quite advantageous. There have been a variety of such approximation methods to solve equations of mathematical physics. The most popular method of this class is the finite element method (FEM). The central feature of the method is to partition the domain in a systematic manner into an assembly of discrete subdomains or “elements,” and then to approximate the solution of each of these pieces in a manner that couples them to form a global solution valid over the whole domain. The process is designed to keep the resulting algebraic systems as computationally manageable, and memory efficient, as possible.
3.2 Weak Formulation
Consider the following general weak form introduced earlier
3.3 FEM Approximation
We approximate u by
If we choose \(\nu \) with the same approximation functions, but a different linear combination
then we may write
Since the \(\nu \)’s are arbitrary, the \(b_i\) are arbitrary, i.e., \(\forall \nu \Rightarrow \forall b_i\), therefore
where [K] is an \(N\times N\) (“stiffness”) matrix with components \(K_{ij}\) and \(\{R\}\) is an \(N\,\times \,1\) (“load”) vector with components \(R_i\). This is the system of equations that is to be solved. Thus, large N implies large systems of equations and more computational effort. However, with increasing N, we obtain more accurate approximate solutions. We remark that large N does not seem like much of a concern for one-dimensional problems, but is of immense concern for three-dimensional problems.
3.4 Construction of FEM Basis Functions
As mentioned, a primary problem with Galerkin’s method is that it provides no systematic way of constructing approximation functions. The difficulties that arise include (1) ill-conditioned systems due to poor choices of approximation functions and (2) domains with irregular geometries. To circumvent these problems, the FEM defines basis (approximation) functions in a piecewise manner over a subdomain, “the finite elements,” of the entire domain. The basis functions are usually simple polynomials of low degree. The following three criteria are important:
-
The basis functions are smooth enough to be members of \(H^1(\varOmega )\).
-
The basis functions are simple piecewise polynomials, defined element by element.
-
The basis functions form a simple nodal basis where \(\phi _i(x_j)=0\) (\(i\ne j\)) and \(\phi _i(x_i)=1\), furthermore, \(\sum _{i=1}^N\phi _i(x)=1\) for all x and \(\phi _i(x)=0\) outside of the elements that share node i.
A set of candidate functions are defined by
where \(h_i=x_i-x_{i-1}\) and
and \(\phi (x)=0\) otherwise. The derivative of the function is
and
The functions are arranged so that the “apex” of the ith function coincides with the ith node (Fig. 3.1). This framework provides many advantages, for example simple numerical integration.
3.5 Integration and Gaussian Quadrature
Gauss made the crucial observation that one can integrate a polynomial of order 2G-1 exactly with G “sampling” points and appropriate weights. Thus, in order to automate the integration process, one redefines the function F(x) over a normalized unit domain \(-1\le \zeta \le +1\)
where J is the Jacobian of the transformation. Unlike most integration schemes, Gaussian quadrature relaxes the usual restriction that the function sampling locations be evenly spaced. According to the above, we should be able to integrate a cubic (and lower order) term exactly with \(G=2\) points, since \((2G-1)=3\). Therefore
-
For a cubic (\(\zeta ^3\)):
$$\begin{aligned} \int _{-1}^1\zeta ^3 \, d\zeta =0=w_1\zeta _1^3+w_2\zeta _2^3 \end{aligned}$$(3.11) -
For a quadratic (\(\zeta ^2\)):
$$\begin{aligned} \int _{-1}^1\zeta ^2 \, d\zeta =2/3=w_1\zeta _1^2+w_2\zeta _2^2 \end{aligned}$$(3.12) -
For a linear (\(\zeta \)):
$$\begin{aligned} \int _{-1}^1\zeta \, d\zeta =0=w_1\zeta _1+w_2\zeta _2 \end{aligned}$$(3.13) -
For a constant (1):
$$\begin{aligned} \int _{-1}^11 \, d\zeta =2=w_11+w_21=w_1+w_2 \end{aligned}$$(3.14)
There are four variables, \(\zeta _1\), \(\zeta _2\), \(w_1\), \(w_2\), to solve for. The solution that satisfies all of the requirements is \(\zeta _1=\sqrt{1/3}=-\zeta _2\) and \(w_1=w_2=1\). For the general case of G points, we have
and subsequently 2G nonlinear equations for the \(\zeta _i\)’s and \(w_i\)’s. Fortunately, the \(\zeta _i\)’s are the roots to the Gth degree Legendre polynomial, defined via the recursion (Fig. 3.2)
with \(L_o(\zeta )=1\), \(L_1(\zeta )=\zeta \). The roots of the Legendre polynomial are well known and tabulated. Once the roots are determined the remaining equations for the \(w_i\)’s are linear and easy to solve. Fortunately, the roots are precomputed over a normalized unit domain, and one does not need to compute them. The only task is to convert the domain of each element to a standard unit domain (in the next section). A table of Gauss weights can be found in Table 3.1.
3.5.1 An Example
Consider the following integral
This integral is of the form
where we have the following mapping
Applying this transformation, we have
where \(x=0.65\zeta +0.85\). Applying a three-point rule yields (the exact answer is 6.588)
3.6 Global/Local Transformations
One strength of the finite element method is that most of the computations can be done in an element-by-element manner. Accordingly, we define the entries of the stiffness matrix [K] as
and the load vector as
We partition the domain \(\varOmega \) into elements, \(\varOmega _1, \varOmega _2, ..., \varOmega _e,...\varOmega _N\), and can consequently break the calculations (integrals over \(\varOmega \)) into elements (integrals over \(\varOmega _e\)), \(K_{ij}=\sum _e K_{ij}^{e}\), where
and
where \(R_i=\sum _e R_i^e\) and \(\Gamma _{t,e}=\Gamma _{t} \cap \varOmega _e\).
In order to make the calculations systematic we wish to use the generic or master element defined in a local coordinate system \((\zeta )\). Accordingly, we need the following mapping functions, from the master coordinates to the real spatial coordinates, \(M_x(\zeta ) \mapsto x\) (Fig. 3.3)
where the \(\mathcal{X}_{i}\) are the true spatial coordinates of the ith node, and where \(\hat{\phi }(\zeta )\) \(\,\,{\mathop {=}\limits ^\mathrm{def}}\,\,\) \(\phi (x(\zeta ))\). These types of mappings are usually termed “parametric” maps. If the polynomial order of the shape functions is as high as the Galerkin approximation over the element, it is called an “isoparametric” map, lower, then “subparametric” map, higher, then “superparametric”.
3.7 Differential Properties of Shape Functions
The master element shape functions form a nodal bases of linear approximation given by
They have the following properties:
-
For linear elements we have a nodal basis consisting of two nodes, and thus two degrees of freedom.
-
The nodal shape functions can be derived quite easily, by realizing that it is a nodal basis; i.e., they are unity at the corresponding node and zero at all other nodes.
We note that the \(\phi _i\) ’s are never really computed; we actually start with the \(\hat{\phi }_i\) ’s and then map them into the actual problem domain. Therefore in the stiffness matrix and right-hand side element calculations, all terms must be defined in terms of the local coordinates. With this in mind, we introduce some fundamental quantities, such as the finite element mapping deformation gradient
The corresponding one-dimensional determinant is \(|F|=\frac{dx}{d\zeta }\,\,{\mathop {=}\limits ^\mathrm{def}}\,\,J\), which is known as the Jacobian. We will use |F| and J interchangeably throughout this monograph. The differential relations \(\zeta \rightarrow x\) are
The inverse differential relations \(x \rightarrow \zeta \) are
We can now express \(\frac{d}{dx}\) in terms \(\zeta \), via
Finally with quadrature for each element
and
where the \(w_q\) are Gauss weights.
Remarks: It is permitted to have material discontinuities within the finite elements. On the implementation level, the system of equations to be solved is \([K]\{a\}=\{R\}\), where the stiffness matrix is represented by K(I, J), where (I, J) are the global entries. However, one can easily take advantage of the element-by-element structure and store the entries via \(k^e(e,i,j)\), where (e, i, j) are the local (element) entries. For the local storage approach, a global/local index relation must be made to connect the local entry to the global entry when the linear algebraic solution process begins. This is a relatively simple and efficient storage system to encode. The element-by-element strategy has other advantages with regard to element-by-element system solvers. This is trivial in one dimension; however, it can be complicated in three dimensions. This is discussed later.
3.8 Post-Processing
Post-processing for the stress, strain, and energy from the existing displacement solution, i.e., the values of the nodal displacements, the shape functions, are straightforward. Essentially the process is the same as the formation of the weak form in the system. Therefore, for each element
3.9 A Detailed Example
3.9.1 Weak Form
Consider the following problem (Fig. 3.4)
\(u(0)=0\) and \(\frac{du}{dx}(1)=t\), posed over a domain of unit length. The weak form is
Using three elements (four nodes), each of equal size, the following holds:
-
Over element 1 (\(\varOmega _1\)): \(\mathcal{X}_i=\mathcal{X}_1=0\) and \(\mathcal{X}_{i+1}=\mathcal{X}_2=1/3\), \(\phi _1(x)=1-3x\) and \(\phi _2(x)=3x\),
-
Over element 2 (\(\varOmega _2\)): \(\mathcal{X}_i=\mathcal{X}_2=1/3\) and \(\mathcal{X}_{i+1}=\mathcal{X}_3=2/3\), \(\phi _2(x)=2-3x\) and \(\phi _3(x)=-1+3x\),
-
Over element 3 (\(\varOmega _3\)): \(\mathcal{X}_i=\mathcal{X}_3=2/3\) and \(\mathcal{X}_{i+1}=\mathcal{X}_4=1\), \(\phi _3(x)=3-3x\) and \(\phi _4(x)=-2+3x\),
We break the calculations up element by element. All calculations between \(0\le x\le 1/3\) belong to element number 1, while all calculations between \(1/3\le x\le 2/3\) belong to element number 2 and all calculations between \(2/3\le x\le 1\) belong to element number 3.
3.9.2 Formation of the Discrete System
For element number 1, to compute \(K^{e=1}_{ij}\), we study the following term for \(i=1, 2, 3\):
Explicitly, for \(i=1\), we have
where the zero-valued terms vanish because the basis functions are zero over the first finite element domain. The entries such as \(K_{ij}^{e=1}\) multiply the term \(a_j\), which dictate their location within the global stiffness matrix. If we repeat the procedure for \(i=2\), \(j=1,2,3\), we obtain the entries for the global stiffness matrix (\(4\times 4\))
stemming from the placement of the local element stiffness matrix
into the global stiffness matrix. Following a similar procedure for the right-hand side (load)
yields (\(i=1, 2\))
Repeating the procedure for all three of the elements yields
and
Note that the load vector
has a traction contribution from the right endpoint. In summary, the basic process is to (1) compute element by element and (2) to sweep over all basis function contributions over each element.
Remark: We note that all integrals are computed using Gaussian quadrature.
3.9.3 Applying Boundary Conditions
Applying the primal (displacement) boundary conditions requires us to recall that the \(b_i\)’s in the representation of the test functions are not arbitrary at the endpoints, thus the equations associated with those test functions have to be eliminated, and the value of the approximate solution enforced at the displacement boundary condition viaFootnote 1
which is the displacement-specified boundary condition. Thus, we have the following system of equations
3.9.4 Massive Data Storage Reduction
The direct storage of K(I, J) requires \(N\times N\) entries. The element-by-element storage, \(k^{e}(e,i,j)\), requires 4e. The memory requirements for an element-by-element paradigm are much smaller than those for a direct scheme, which store needless zeros. For example, for \(N=10^4\) nodes, the direct storage is \((10^4)^2=10^8\), while the element-by-element storage is \(9999\times 4\), which is essentially 2500 times less than direct storage. Additionally, there is a massive reduction of mathematical operations during the algebraic solution phase, because of the element-by-element structure of FEM system.
3.10 Quadratic Elements
In many cases, if the character of the exact solution is known to be smooth, it is advantageous to use higher-order approximation elements. Generally, if the exact solution to a problem is smooth, for sufficiently fine meshes, if one compares, for the same number of nodes, the solution produced with linear basis functions to the solution produced with quadratic basis functions, the quadratically produced solution is more accurate. Similarly, if the exact solution is rough (nonsmooth), for sufficiently fine meshes, if one compares, for the same number of nodes, the solution produced with linear basis functions to the solution produced with quadratic basis functions, the linearly produced solution is more accurate (Fig. 3.5).
To illustrate how to construct a quadratic finite element approximation, we follow a similar template for linear elements, however, with three nodes instead of two. Consistent with the basic nodal basis construction, the basis function must equal unity on the node it belongs and be zero at the others. Thus, for a generic quadratic element:
-
For node \(\#\) 1: \(\hat{\phi }_1(\zeta )=-\frac{1}{2}(1-\zeta )\zeta \), which yields \(\hat{\phi }_1(-1)=1\), \(\hat{\phi }(0)=0\), \(\hat{\phi }_1(1)=0\),
-
For node \(\#\) 2: \(\hat{\phi }_2(\zeta )=(1+\zeta )(1-\zeta )\), which yields \(\hat{\phi }_2(-1)=0\), \(\hat{\phi }_2(0)=1\), \(\hat{\phi }_2(1)=0\) and
-
For node \(\#\) 3: \(\hat{\phi }_3(\zeta )=\frac{1}{2}(\zeta +1)\zeta \) which yields \(\hat{\phi }_3(-1)=0\), \(\hat{\phi }_3(0)=0\), \(\hat{\phi }_3(1)=1\).
Following the approach for linear elements, the connection between x and \(\zeta \) is
Clearly, the weak form does not change for linear or quadratic approximations. Furthermore, the quadratically generated system has a similar form to the linearly generated system
where N is the number of nodes in 1-D. Let us consider an example with three elements, resulting in 7 nodes. Breaking up the integral into the elements
For element \(\#1\), for \(i=1, 2...N\), we need to compute
yielding
For the right-hand side, for \(i=1, 2...N\), we need to compute
thus
Repeating this for \(i=2, 3...N\), we have
This is then repeated for elements 2 and 3, to yield
One then applies boundary conditions in the same manner as for linear elements.
Remark: A logical question to ask is what is the accuracy of the finite element method? This is addressed in the next chapter.
Notes
- 1.
The traction boundary conditions are automatically accounted for in the weak formulation.
References
Courant, R. (1943). Variational methods for the solution of problems of equilibrium and vibrations. Bulletin of the American Mathematical Society, 49, 1–23.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG
About this chapter
Cite this chapter
Zohdi, T.I. (2018). A Finite Element Implementation in One Dimension. In: A Finite Element Primer for Beginners. Springer, Cham. https://doi.org/10.1007/978-3-319-70428-9_3
Download citation
DOI: https://doi.org/10.1007/978-3-319-70428-9_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-70427-2
Online ISBN: 978-3-319-70428-9
eBook Packages: EngineeringEngineering (R0)