# On optimal node and polynomial degree distribution in one-dimensional \(hp\)-FEM

## Authors

- First Online:

- Received:
- Accepted:

DOI: 10.1007/s00607-012-0232-x

- Cite this article as:
- Chleboun, J. & Solin, P. Computing (2013) 95: 75. doi:10.1007/s00607-012-0232-x

- 139 Views

## Abstract

We are concerned with the task of constructing an optimal higher-order finite element mesh under a constraint on the total number of degrees of freedom. The motivation for this work is to obtain a truly optimal higher-order finite element mesh that can be used to compare the quality of automatic adaptive algorithms. Minimized is the approximation error in a global norm. Optimization variables include the number of elements, positions of nodes, and polynomial degrees of elements. Optimization methods and software that we use are described, and numerical results are presented.

### Keywords

\(hp\)-FEMOptimal meshOptimal polynomial degreeBoundary value problem### Mathematics Subject Classification (2000)

65K9965L6065L1065L50## 1 Introduction

Even a novice in a common \(h\) version of the finite element method (FEM) is well aware of the importance of a good mesh regardless of the vagueness of such an attribute. Although criteria ranging from pure geometry to numerical efficiency can be involved, it is most common to describe a mesh as good if the corresponding FE solution is a close approximation to the exact solution. In other words, if the error, that is, the difference between the exact and the approximate solution measured by a relevant norm, is small. This approach makes possible to define an optimal mesh as the mesh that leads to minimum error. To correctly define the optimization problem, one has to prevent an unbounded increase of the number of mesh nodes by fixing it. Then, the optimal position of the fixed number of mesh nodes is sought after.

In practice, one can hardly spend effort searching for the optimal mesh because the exact solution is not known and, even if it were known, the optimization process is computationally demanding. If the goal is reduced and finding a good mesh instead of the optimal mesh is sufficient, a great number of adaptive methods are available that construct a mesh, or, more exactly, a sequence of meshes that exhibit a fast convergence rate of the FE solutions.

Up to now, the degree of FE basis functions (polynomials) has not been mentioned. It is obvious that allowing higher degree polynomials makes the FE space richer and, consequently, improves the accuracy of the FE solution. If, however, the polynomial degree is constant over all elements, it might be unnecessarily high in some parts of the domain of the solution, the resulting system of algebraic equations might be unnecessarily large and its solving unnecessarily demanding with respect to the gain in accuracy of the approximate solution.

These considerations had lead to the genesis of the \(hp\)-FEM. In this method, higher order polynomials are used where appropriate whereas low order polynomials elsewhere, and, moreover, the mesh is step by step optimized, too. For a given boundary value problem (BVP), the optimality of FE spaces is no longer dependent on the underlying mesh only, but the distribution of polynomial degrees over the elements is also crucial.

In solving a BVP, the analyst’s goal is obvious: be economical with the degrees of freedom (DOFs) of the FE space, that is, strive for such a FE space that has a low dimension and approximates the exact solution sufficiently accurately. Given a fixed number of DOFs, an optimal, with respect to the error minimization, FE space can be sought after. This is the subject of this paper.

Again, as in the \(h\)-FEM, though an optimal \(hp\)-FE space is not the goal of computation in practice, adaptive methods can work towards optimality and deliver \(hp\)-FE spaces that result in an exponential rate of convergence with respect to the used DOFs; see [1, 3, 4, 6, 8, 9], for instance.

The liberty of choosing different polynomial degrees on different parts of the mesh opens new horizons for error reduction but, on the other hand, places new demands on algorithms of adaptive FEMs. Indeed, if a source-area of error is localized, a difficult question arises what combination of a polynomial order change and mesh change will most reduce the error.

The following strategy has been generally accepted: locally fine mesh and low degree polynomials are preferred in areas where the exact solution is not sufficiently smooth or exhibits a singularity; locally rough mesh and high degree polynomials are used in areas where the solution is smooth. Adaptive strategies based on smoothness evaluation or error estimation can be found in the literature from which we choose only [2, 5, 7, 9, 10], the works that pay special attention to problems in one space dimension.

Unlike the above references, this paper does not propose at least partly universal \(hp\) adaptive algorithm. Instead, optimal \(hp\)-FE spaces are found numerically for a particular boundary value problem with a known solution. The goal is twofold. First, the importance of the polynomial degree distribution is studied on respective optimal meshes. Second, the found optimal FE spaces can serve as benchmarks for \(hp\) adaptive algorithms in 1D or, in special cases, even 2D boundary value problems.

The paper is organized as follows. In Sect. 2, a BVP and optimization problems are defined. Computational issues are briefly introduced in Sect. 3. Computational results constitute Sect. 4 and are discussed in Sect. 5.

## 2 Problem setting

### 2.1 Model boundary value problem

### 2.2 Approximate BVP

To obtain a FE solution to (4), we first introduce \(hp\)-FE spaces.

Figure 1 (bottom) shows the basis functions of \(V^{\fancyscript{T}_h,p}\) where the mesh is uniform, \(p=(1,4,1,3)\), and \(\dim V^{\fancyscript{T}_h,p}=10\). Indeed, we can identify five piecewise linear basis functions (two of them vanishing outside the first and the last mesh subinterval, respectively), two quadratic and two cubic polynomials, and one quartic polynomial with the support in \(I_2\). Constant functions lie in the linear hull of the piecewise linear functions.

Vectors \(p\) will also be called \(p\)-distributions in this paper.

### 2.3 Inner optimization problem

As already indicated in Sect. 1, we will strive for an optimal \(hp\)-FE space that produces a minimum of \(\varPsi (u_{h,p})\). The first step towards this goal is to optimize the FE mesh.

To this end and to prevent a mesh degeneration, we define \(\fancyscript{M}_{\text{ ad}}^p\), the set of admissible meshes relevant for a given degree distribution \(p\). A mesh is called admissible if the length of \(I_k\), where \(k=1,\ldots ,m\), is greater than or equal to \(\epsilon \), a small positive parameter (say \(10^{-4}\), for example).

*inner optimization problem*: Find \(\fancyscript{T}_\text{ opt}^p\in \fancyscript{M}_{\text{ ad}}^p\) such that

*Remark 1*

As it is known from the FEM algorithms, problem (6) leads to a system of linear algebraic equations represented by a matrix \(K\) and a right-hand side column vector \(r\). Both \(K\) and \(r\) are continuously dependent on the position of mesh nodes, so is the approximate solution \(u_{h,p}\). Since \(\varPsi \) is continuous with respect to \(u_{h,p}\), problem (9) can be interpreted as a minimization of a continuous function of several variables (positions of mesh nodes) over a compact set. As a consequence, at least one solution exists.

### 2.4 Outer optimization problem

The ultimate goal is to minimize the error with respect to \(N\), a given number of DOFs (the dimension of \(V^{\fancyscript{T}_h,p}\)) that we have at our disposal. Generally, we can use DOFs either in lowering the polynomial degrees and adding nodes to a current mesh or in increasing the polynomial degrees and deleting nodes from the current mesh.

To formulate the idea in mathematical terms, we begin with defining \(\fancyscript{P}_N\), the set of all polynomial distributions \(p\) such that the corresponding spaces \(V^{\fancyscript{T}_h,p}\) have the dimension equal to \(N\). Let us recall that \(p\) uniquely determines both the number of mesh nodes of \(\fancyscript{T}_h\) and \(\dim V^{\fancyscript{T}_h,p}\).

*outer optimization problem*: For a fixed \(N\), find \(\widehat{p}\in \fancyscript{P}_N\) such that

## 3 Computational issues

The cardinality of \(\fancyscript{P}_N\) increases with \(N\), the total number of DOFs

\(N\) | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
---|---|---|---|---|---|---|---|---|---|---|---|---|

\(\left| \fancyscript{P}_N \right|\) | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1,023 | 2,045 | 4,088 | 8,172 |

Problem (11) allows for parallelization because it can be divided up to \(\left| \fancyscript{P}_N \right|\) independently solvable problems (9).

To solve (9), where \(p\) is fixed, MATLAB\(^{\textregistered }\) Optimization Toolbox\(^\text{ TM}\) function fmincon was employed. This routine is designed to find a (local) minimum of a constrained multivariable function. To increase the chance to find a global minimum, several fmincon runs were performed from different starting points, i.e., from meshes with a fixed number of nodes but with different initial positions of the nodes. The routine uses the gradient of the objective function \(\varPsi \). Although it would be possible to infer a sensitivity-analysis-based algorithm for gradient calculation, the gradient was calculated approximately via numerical differentiation. Frequent calls for \(\varPsi (u_{h,p})\) were met by calling an ABVP solver and a routine evaluating \(\varPsi (u_{h,p})\); both programmed in the MATLAB\(^{\textregistered }\) environment.

Windows HPC Server 2008 R2 was employed for solving the outer optimization problem (11) in parallel on a cluster of multi-core personal computers. Although up to 200 cores shared the burden of computation, solving (11) proved to be a time consuming task whose completion took days if \(N\) exceeded 13.

Since the exact solution (5) is an odd function, the optimal \(hp\)-FEM setting should exhibit some symmetry or mirroring that can be used to check, at least partly, the correctness of calculated results; see the next section. Function (5) is monotone on \([-1,1]\), rather rapidly increasing near \(0\) and slowly increasing near points \(-1\) and \(1\).

Obtaining the solution of problem (11) is not the final step of the analysis. We are concerned with several questions as: If \(p\ne \widehat{p}\), what is the difference between \(\varPsi (\widehat{u}_{p}) - \varPsi (\widehat{u}_{\widehat{p}})\)? Is the difference significant? For a fixed \(p\), is the optimal mesh reachable from a uniform initial mesh by a descent method? How much can \(\varPsi ({u}_{p})\) be reduced by the mesh optimization?

## 4 Computational results

Case 16 represents \(p=(5)\), that is, a fifth order polynomial defined on \([-1,1]\) without any inner node; no mesh optimization is possible.

The minimum errors in cases 1 (piecewise linear functions), 3, 4, and 10 are almost equal if assessed from the viewpoint of practical computation.

Figure 2 (bottom) shows the ratio between the minimum and initial value of \(\varPsi \).

The latter was observed far more frequently. If \(N=13\), for example, then, in 36 cases, the minimum obtained from an optimized uniform mesh was noticeable less than the minimum obtained by repeated random mesh optimization. The opposite was true in 954 cases. In the other 1,055 cases, the difference did not exceed 1% and the minima were considered computationally equal. For \(N=15\), the respective numbers were 149 and 4,387 (if the tolerated difference is equal to 1%) or \(122\) and \(4,090\) (tolerated difference 5%).

Since \(\left| \fancyscript{P}_N \right|\) increases rapidly with growing \(N\), we have to abandon detailed graphs and content ourselves with summarizing graphs where individual \(p\)-distributions are not exactly identifiable.

To give some indication of the correspondence between the position on the horizontal axis and the polynomial degrees that form \(p\in \fancyscript{P}_{12}\), let us say that degree 3 together with 1 and 2 appear between positions \(145\) and \(504\) inclusive. Polynomials of the fourth order occupy positions \(505\)–\(773\) inclusive. Polynomials of the fifth order are placed between \(774\) and \(912\) inclusive. Sixth order polynomials stand between \(913\) and \(976\) inclusive. Next, there are \(28\) polynomials of the seventh order, \(12\)\(p\)-distributions containing degree \(8\), five \(p\)-distributions containing degree \(9\), and only two \(p\)-distributions of the tenth order, that is, \(p=(1,10)\) and \(p=(10,1)\).

The mesh optimization reduces both the error \(\varPsi \) and its sensitivity to a proper \(p\)-distribution. Indeed, a substantial number of \(p\)-distributions can result in a comparable error; see Figs. 4 (bottom) and 5 (bottom).

## 5 Conclusions

Solving the outer optimization problem (11) is an excessively demanding task. Although our algorithms might be improved to be more efficient and the entire code rewritten in C/C++ or FORTRAN to run faster, one can hardly expect a speed up by a factor greater than 100. This corresponds to 6–7 more DOFs as one added DOF almost doubles the cardinality of \(\fancyscript{P}_N\) (see Table 1) as well as, for some \(p\in \fancyscript{P}_N\), increases the number of mesh nodes and, consequently, the number of generated random meshes.

Massive parallelization would certainly allow for more DOFs because problem (11) is completely parallelizable and problems (9) can be solved fully independently. But the gain would be limited, too. Indeed, by assuming that 200,000 cores are loaded instead of 200, we get a speed up factor 1,000 that represents at most 10 DOFs.

We are well aware that it is inadmissible to make general conclusions about the \(hp\)-FEM on the basis of solving one boundary value problem whose exact solution is, in addition, *smooth*. This implies that the following thoughts are limited to our particular BVP and their generalization has to be taken with reservations.

It seems to be a good strategy to pay more attention to mesh optimization than to polynomial degree optimization. Although the latter must not be neglected, Figs. 4–7 suggest that for many non-optimal degree distributions an optimized mesh can substantially reduce the error. However, it is necessary to note that, in mesh adaptation algorithms, meshes are usually optimized by halving selected subintervals. A question arises whether this approach leads to meshes that are close to the optimal meshes. Figure 8 indicates that the mesh optimality is not a sensitive issue if \(p\) is optimal or almost optimal. We can conclude that a coupling of a reasonable mesh adaptation algorithm and a satisfactory (though not optimal) \(p\) adaptation algorithm will result in a fast convergence rate as expected in the \(hp\)-FEM.

## Acknowledgments

The first author is grateful to Dr. Richard (Dick) Haas for many fruitful discussions.