Once this initial set of flags has been determined the next step of the algorithm is to decide whether an element flagged for either refinement or derefinement should be refined in h or p. As mentioned previously, it is known that if the solution on an element is smooth it is more efficient, in terms of number of degrees of freedom, to refine in p than in h, and vice versa [164]. For this reason, there have been a number of attempts in the literature to develop algorithms by which one can estimate the local smoothness of the solution over a domain, so that one can identify the regions of the domain which are smooth enough for it to be most efficient to refine in p and likewise the regions where the solution is non-smooth and it is most efficient to refine in h. It should be noted of course, that not all hp-adaptive strategies presented in the literature use a smoothness estimate to determine whether an h or p refinement strategy should be employed. For example, the three fold strategy presented in [166], simply uses the magnitude of the error estimator driving the refinement as an hp-steering criterion i.e. the elements with the largest errors should be refined in h, the elements with an intermediate level of error in p and no refinement should occur on elements with small levels of error. However, as the aim here
is to maximise efficiency, the focus will be on methods based on smoothness estimates.
The simplest strategy in this regard is to use a priori information concerning the location of singularities, which has found use for example in [167]. This unfortunately is not appropriate for the purposes intended here as computing optimal topologies necessarily implies a lack of knowledge a priori about the converged solution. A second strategy proposed by Gui and Babuˇska [168] evaluates the smoothness of a solution on an element by computing the ratio of
two local error estimates for numerical solutions of order pτ and pτ− 1. By comparing this ratio
with what is referred to as the type-parameter, one can then determine whether the refinement should be of p-type indicating sufficient smoothness or vice versa. Houston et al. present two methods of smoothness estimation in their paper, [164]. The first of these is a technique which involves computing the decay rate of the coefficients of a Legendre expansion of the solution. It is known that the value of these Legendre coefficients will decay to zero exponentially if the solution is analytic (i.e. smooth), thus a sufficiently fast decay rate indicates a preference for refinement in p over h, and vice versa. The second method presented in [164] is a technique by which one directly approximates the local Sobolev regularity of the solution using the root test on those same Legendre expansion coefficients. More recently Wihler [169], developed a smoothness indicator based on continuous Sobolev embeddings. In [169], it is shown that the continuity coefficients in the relevant Sobolev inequalities will be seen to tend towards a positive constant as the mesh is refined if the solution is smooth on a given element, and tend towards zero otherwise, which can be used to indicate that one should refine in p or h respectively. A comparison of a number of hp-adaptive strategies including the majority of those described above is performed in [170]. What is found is that whilst different strategies perform best (evaluated in terms of efficiency) for different kinds of problems, the method of Houston involving the computation of the decay rate of the coefficients of a Legendre expansion appears to be the best choice as a general strategy across the range of tested problems.
In this work then, the analyticity test presented in [164] which involves on the estimation of the decay rate of the Legendre expansion coefficients will be the chosen method for estimating the smoothness of a function, and will thus form the first step in the decision of whether an element should be refined in p or h. This will comprise the computeAnalyticityTest function in Algorithm 3, and can be computed as explained below. Firstly, the Legendre expansion of a
function, φh(x), can be written
φh(x) =
∞
X
i=0
ai`i, (6.1)
where ai are the Legendre coefficients and `i the Legendre polynomials. As this is a compu-
tational technique, however, an approximation of (6.1) must be made which can be done by computing a finite Legendre expansion, the maximum order of which will align with the inter-
polation order of the finite element space on the given element i.e. for i = (0, pτ). In order to
estimate the decay rate of the finite Legendre expansion one can then fit a straight line through
a graph of the log of the coefficients, ai, and i, i.e. log |ai| = mi + c. The analyticity, Θτ, then
is a function of the gradient of that line, Θτ = exp(−m). If the function is locally analytic the
whereas if the function is non-analytic the gradient, m, will be small and Θτ → 1. A parame-
ter, analyticityThreshold, can then be introduced by which if, Θτ ≤analyticityThreshold,
the solution is considered smooth enough locally for the element to be refined in p, and for,
Θτ >analyticityThreshold, the element should be refined in h. As smooth functions will tend
to have values close to zero and nonsmooth functions a wider range of values that nevertheless tend towards one, caution is exercised in favour of non-smooth values (and thus h-refinement) and as such, in this work the value of the parameter is set as analyticityThreshold= 0.25. Experimental evidence can be found in works such as [172, 173], which show that such a choice leads to the desired exponential convergence and is therefore a reasonable choice.
There are some special cases such as where a function is odd or even by which the symmetry or antisymmetry of the function will cause patterns of repeating zeros in the Legendre coefficients which can affect the data fitting procedure through the coefficients. To avoid this, a check is made by which if the even numbered coefficients i.e. i = 2, 4, 6... are all less than machine precision, the function can be determined to be odd and if the odd numbered coefficients i.e.
i= 1, 3, 5... are all less than machine precision, the function can be determined to be even. If
either one of these conditions is satisfied a smoothing is applied to the Legendre coefficients by which the repeated zero coefficients are set as equal to the average of their adjacent coefficients,
or in the extreme cases (i.e. the 0th or pth coefficient) set as equal to their adjacent coefficient
(i.e. the 1st or p − 1th coefficients respectively). Similarly, in the case that the order of the
function is less than the local order of approximation on the element, there could be repeated zero coefficients at the end of the series by which the coefficients have already decayed to zero. As such, a condition is enforced by which if the highest order Legendre coefficient is less than machine precision, and the function is not odd or even (based on the criteria defined above), the function is assumed to be analytic.
Furthermore, it should be noted that a Legendre expansion is computed about the centre of the element and in one coordinate direction only. This does mean that one can use this technique to determine separately the analyticity of the function in each coordinate direction and use this information to refine the mesh anisotropically, however, in this case the analyticity is simply estimated in both coordinate directions on a given element and the worst case scenario is used, i.e. the function must be analytic in both coordinate directions to be considered analytic and thus the decision be made to refine in p over h.