INTERPOLATION 267 Table 13.2. Particle-mesh interpolation timings ON=F,OFF=V ON=F Particle-tracing time (s) 257.0 17.6 MFLOP-rate recorded 1.11 20.82 Total running time (s) 290.0 21.45 Timings (µs/particle/step) 51.4 3.52 At the beginning, the particles were placed uniformly across the mesh, following a square lattice of nppdi×nppdi particles. Figure 13.24 shows a typical sequence of 20 steps for npart=5×5 particles. In an effort to obtain an accurate timing the following set of parameters was used: - npart=10,000: this large set of particles minimizes the overhead associated with subroutine calls; - ntime=500: this large number of timesteps minimizes the start-up overheads. The particles were moved a distance of dista=0.05 every timestep. On the mesh used, at most six elements had to be tested for each particle to locate the new host element. However, in most cases only five elements required testing. The average number of remaining particles after each search pass, i.e. those that have not yet found their host elements, is shown in the histogram given by Figure 13.25. To obtain timings, two runs were performed on a Cray-XMP with and without automatic vectorization. The Cray-XMP allowed the required gather/scatter operations to be run in hardware. The timings obtained are listed in Table 13.2 below. The resultsdemonstratea 14-foldspeedup when using the automaticvectorization.Factors like these enable new dimensions of reality in simulations, making it possible to study new phenomena previously thought untractable. 14 ADAPTIVE MESH REFINEMENT The development of self-adaptive mesh refinement techniques in computational fluid dynamics (CFD), computational structural dynamics (CSD), computational electromagnet- ics (CEM) and other fields of computational mechanics is motivated by a number of factors. (a) With mesh adaptation, the numerical solution to a specific problem, given the basic accuracy of the solver and the desired accuracy, should be achieved with the fewest degrees of freedom. This, in most cases, translates into the least amount of work for a given accuracy. Work in this context should be understood as meaning not only CPU, but also memory and man-hour requirements. (b) For some classes of problems, the savings in CPU and memory requirements exceed a factor of 100 (see Baum and Löhner (1989)). This is equivalent to two generations of supercomputing. For these problems, adaptive mesh refinement has acted as an enabling technology, allowing the simulation of previously intractable problems. (c) Mesh adaptation avoids time delays incurred by trial and error in choosing a grid that is suitable for the problem at hand. Although this may seem unimportant for repetitive steady-state calculations, it is of the utmost importance for transient problems with travelling discontinuities (shocks, plastic fronts, etc.). In this way, adaptation adds a new dimension of user-friendliness to computational mechanics. Given these very strong motivating reasons, the last two decades have seen a tremendous surge of activity in this area. It is interesting to note that mesh adaptation in CFD, CSD and CEM appeared in the early 1980s. In fact, the first conferences dedicated solely to this subject took place around 1984 (Babuska et al. (1983, 1986)). As with most of this book, the present chapter focuses primarily on unstructured, i.e. unordered, grids, such as those commonly encountered in finite element applications. However, parallel developments in the area of structured grids (finite difference and finite volume techniques) are mentioned where appropriate. Any adaptive refinement scheme is composed of three main ingredients: - an optimal-mesh criterion; - an error indicator; and - an algorithm or strategy to refine and coarsen the mesh. They give answers to the questions: - How should the optimal mesh be defined? Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition. Rainald Löhner © 2008 John Wiley & Sons, Ltd. ISBN: 978-0-470-51907-3 270 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES - Where is refinement/coarsening required? and - How should the refinement/coarsening be accomplished? The topic of adaptation being now two decades old, it is not surprising that a variety of answers have been proposed by several authors for each of these questions. In the following, the most successful ones are discussed in more depth. 14.1. Optimal-mesh criteria Before designing an adaptive mesh procedure, the analyst should have a clear idea of what is to be achieved. Reduction of manual and computational work is the obvious answer, but in order to be more definite one needs a quantitative assessment of the optimality of the adaptive mesh procedure. This leads to the immediate question: What should the optimal mesh be like? The answer to this crucial question is seldomly clear, as engineers do not always know aprioriwhat constitutes a sufficiently accurate answer to the problem at hand. For example, if all that is required is the lift of an airfoil (an integrated, global quantity), there is in most cases no need for an extremely accurate solution away from the surface. A number of researchers have followed guidelines with a more rigorous mathematical foundation, which are outlined below. (a) Equidistribution of error. The aim is to attain a grid in which the error is uniformly distributed in space. One can show that such a mesh has the smallest number of degrees of freedom (i.e. the smallest number of elements). Simply stated, h → min, ∀x ∈. (14.1) Conceptually, one can derive this criterion from the observation that for an initial mesh the error will havean irregular distribution as shown inFigure 14.1(a).If the numberof degrees of freedom is keptthe same,the distributionof element size and shape is all that may be changed. Given that the error varies with element size, smaller elements are required in regions of large errors, whereas larger elements may be employed in regions of small errors. After repositioning of points, the error distribution in space will become more regular, as shown in Figure 14.1(b). One can also see that the general aim stated in (14.1) will be achieved when the error is constant in the domain. This mesh optimality criterion is used most often in conjunction with steady-state problems. (b) Local absolute error tolerances. In many applications, the required error tolerances may not be the same at all locations. Moreover, instead of using the general minimization stated in (14.1), one may desire to enforce absolute local bounds in certain regions of the domain: h <c 1 , ∀x ∈ sub . (14.2) Mesh refinement or coarsening will then take place if the local error indicator exceeds or falls below given refinement or coarsening tolerances: h >c r ⇒ refine, h <c c ⇒ coarsen. The calculation of skin-friction coefficients of airfoils is a possible application for such a mesh optimality criterion. The mesh optimality criterion based on local absolute error tolerance is most often used for transient problems. ADAPTIVE MESH REFINEMENT 271 error x error x (a) (b) Figure 14.1. Equidistribution of error: (a) before adaptation; (b) after adaptation 14.2. Error indicators/estimators Consider the task of trying to determine whether the solution obtained on the present mesh with the flow solver used (or any other field solver) is accurate. Intuitively, a number of criteria immediately come to mind: variations of key variables within elements, entropy levels, higher-order derivatives of the solutions, etc. All of them make the fundamental assumption that the solution on the present mesh is already in some form close to the exact solution. This assumption is reasonable for parabolic and elliptic problems, where, due to global minimization principles, local deficiencies in the mesh only have a local effect. For hyperbolic problems, the assumption u h ≈ u may be completely erroneous. Consider an airfoil at high angle of attack. A coarse initial mesh may completely miss local separation bubbles at the leading edge that lead to massive separation in the back portion of the airfoil. Although the local error in the separation region may be very small (after all, the solution there is relatively smooth for a RANS simulation), the global error in the field would be very large due to different physical behaviour. Any local error indicator presently in use could miss these features for bifurcation point regions, performing adaptation at the wrong places. On the other hand, the assumption u h ≈ u is a very reasonable one for most initial grids and stable physics. As a matter of fact, it is not so difficult to attain, given that the nature of most engineering applications is such that: (a) developments are evolutionary, rather than revolutionary, i.e. a similar problem has been solved before (the airfoil being the extreme example); and (b) the controllability requirement of reliable products implies operation in a stable regime of the physics. 272 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 14.2.1. ERROR INDICATORS COMMONLY USED The most common error indicators presently used in production codes may be grouped into the following categories. 14.2.1.1. Jumps in indicator variables This simplest error indicator is obtained by evaluating the jump (i.e. the absolute difference) of some indicator variable like the Mach number, density or entropy within an element or along an edge. This error indicator implicitly makes the assumption h el = c 1 h|∇u|, (14.3) i.e. first-order accuracy for the underlying scheme. Error indicators of this form have been used in industrial applications (Palmerio and Dervieux (1986), Dannenhoffer and Baron (1986), Kallinderis and Baron (1987), Mavriplis (1990b, 1991a), Aftosmis and Kroll (1991), DeZeeuw and Powell (1993)),even if the underlyingnumerical discretization was higher than first order. 14.2.1.2. Interpolation theory Making the assumption that the solution is smooth, one may approximate the error in the elements by a derivativeone order higher than the element shape function. For one dimension this would result in a local error indicator (i.e. at the element level) of the form h el = c 1 h p ∂ p u ∂x p , (14.4) where p −1 is the polynomialdegree of the shapefunctions and the pth derivative is obtained by some recovery procedure. The total error in the computational domain is then given by h = c 2 h p ∂ p u ∂x p d. (14.5) This error indicator gives superior results for smooth regions. On the other hand, at discontinuities the local value of h el will stay the same no matter how fine the mesh is made. As a simple example, consider a shock across a fixed number of elements in one dimension. Assuming a grid of constant size h, the resulting error indicator at points will be of the form |u i−1 − 2u i + u i+1 |. Observe that the element size has disappeared, i.e. no matter how fine the mesh is made, the error indicator values close to the discontinuity will remain unchanged. Furthermore, note that the global error will indeed decrease, but only as O(h). 14.2.1.3. Comparison of derivatives Again making the assumption that the solution is smooth, one may compare significant derivatives using schemes of different order. As an example, consider the following three ADAPTIVE MESH REFINEMENT 273 approximations to a second derivative: u ,xx | 4 1 = 1 h 2 (u i−1 − 2u i + u i+1 ) − 1 12 h 2 u ,I V , (14.6a) u ,xx | 4 2 = 1 4h 2 (u i−2 − 2u i + u i+2 ) − 1 12 4h 2 u ,I V , (14.6b) u ,xx | 6 = 1 12h 2 (−u i−2 + 16u i−1 − 30u i + 16u i+1 − u i+2 ) + 1 90 h 4 u ,VI . (14.6c) The assumption of smoothness in u would allow a good estimate of the error in the second derivativesfrom the differenceof thesethree expressions(Schönaueret al. (1981)).Moreover, comparing (14.6a) to (14.6b,c) can give an indication as to whether it is more efficient to h-refine the mesh (reduction of h), or to increase the order of accuracy for the stencil (p- refinement).For unstructuredgrids, one may recoverthese derivativeswith so-called recovery procedures (see Chapter 5). 14.2.1.4. Residuals of PDEs on adjacent grids Assume we have a node-centred scheme to discretize the PDEs at hand. At steady state, the residuals at the nodes will vanish. On the other hand, if the residuals are evaluated at the element level, non-vanishing residuals are observed in the regions that require further refinement. This error indicator has been used extensively by Palmerio et al. (1985), and has a close link to so-called output-based indicators (see below). Another possibility is to check locally the effect of higher-order shape functions introduced at the element level or at element boundaries (Baehman et al. (1992)). These so-called p-refinement indicators have been used extensively for computational structural mechanics applications (Zienkiewicz et al. (1983), Babuska et al. (1983), Dunavant and Szabo (1983)). 14.2.1.5. Energy norms Assume incompressible creeping flow. For this viscous-dominated flow the solution consists of a velocity field v with zero divergence that minimizes the dissipation energy functional J(v) = µ(v i ,j + v j ,i ) : (v i ,j + v j ,i )d= σ : d. (14.7) Here v denotes the velocity field, σ the viscous stress tensor and the strain rate tensor. The dissipation energy of the error e =v −v h satisfies the relation J(e) = (σ h − σ) :( h − ) d. (14.8) The unknown exact stresses and strain rates σ, can be recovered at nodes through a least- squares projection. The final estimator, using recovered stresses σ r and strain rates r ,then becomes J(e) = (σ h − σ r ) :( h − r )d. (14.9) 274 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES This error estimator, although derived for creeping flows, has also been shown to be useful for flows with moderate Reynolds number (Hétu and Pelletier (1992)). One can also see that this error indicator is closely related to the Zienkiewicz–Zhuerror indicator (Zhu and Zienkiewicz (1987), Zienkiewicz et al. (1988), Ainsworth et al. (1989), Wu et al. (1990)). 14.2.1.6. Energy of spatial modes For higher-order methods, such as spectral element methods, a very elegant way to measure errors and convergence is to separate the energy contents associated with the different shape functions. The decrease of energy contained in the higher-order shape functions gives a reliable measure of convergence (Mavriplis 1990a, 1992). At the same time, this way of measuring errors provides an immediate strategy as to when to perform h-refinement (slow decrease of energy content with increasingshape-functionpolynomial) or p-refinement (rapid decrease of energy content with increasing shape-function polynomial). 14.2.1.7. Output-based error estimators For many applications, the user is interested in a few global quantities. Typical examples are lift, drag and moments for aerodynamic problems. The idea is then to refine the grid only in those regions that affect these so-called outputs. This type of error estimator has received increased attention in recent years (Pierce and Giles (2000), Becker and Rannacher (2001), Rannacher (2001), Giles and Süli (2002), Süli and Houston (2002), Venditti and Darmofal (2002, 2003)). Assume a given numerical solution u h with a numerical solution error δu so that the exact solution is given by u =u h + δu. (14.10) Furthermore, consider a desired output function I(u) (e.g. the drag of a wing) and physical constraints (e.g. the Navier–Stokes equations) R(u) =0. (14.11) Performing a Taylor series expansion we have, for the desired output function and the constraints, I(u) =I(u h + δu) =I(u h ) + I ,u | u h δu +hot, (14.12) R(u) =R(u h + δu) = R(u h ) + R ,u | u h δu +hot (14.13) where ‘hot’ stands for ‘higher-order terms’. However, the current solution already satisfies R(u h ) =0, which implies R(u) ≈R ,u | u h δu, (14.14) δu ≈[R ,u | u h ] −1 R(u), (14.15) δI = I ,u | u h δu ≈I ,u | u h [R ,u | u h ] −1 R(u) = T R(u) (14.16) where denotes the adjoint variables, i.e. the solution of the system [R ,u | u h ] T =[I ,u | u h ] T . (14.17) ADAPTIVE MESH REFINEMENT 275 Given that numerical errors are also present for h , one can assume that, as before for u, = h + δ, (14.18) implying δI =[ h ] T R(u) +[δ] T R(u). (14.19) The last term is of higher order, resulting in I(u) ≈I(u h ) +[ h ] T R(u). (14.20) This last equation may be interpreted in two ways: first as a way to improve the computed values of I(u); and secondly as a way to estimate where to refine the mesh. Note that the residual R(u) (which may be used as an error indicator by itself) is multiplied by the adjoint . The adjoint thus ‘weighs’ the influence or importance of a given residual in space with respect to the desired output function I(u). 14.2.1.8. Other error indicators/estimators In a field that is developingso rapidly, it is not surprising thata variety ofother error indicators and estimators have been proposed. The more theoretically inclined reader may wish to consult Strouboulis and Oden (1990), Strouboulis and Haque (1992a,b) and Johnsson and Hansbo (1992). 14.2.2. PROBLEMS WITH MULTIPLE SCALES All of these error indicators have been used in practice to guide mesh adaptation procedures. They all work well for their respective area of application. However, they cannot be considered as generally applicable for problems with multiple intensity and/or length scales. None of them are dimensionless, implying that strong features (e.g. strong shocks) produce large error indicator values, whereas weak features (such as secondary shocks, contact discontinuities, shear layers) produce small ones. Thus, in the end, only the strong features of the flow would be refined, losing the weak ones. A number of ways have been proposed to circumvent this shortcoming. 14.2.2.1. Stopping criteria The most common way to alleviate the problems encountered with multiple intensity/length scales is to introduce a stopping criterion for refinement. This can be a minimum element size or, for the case of h-refinement, a maximum level of subdivision. After the discretization is fine enough to activate the stopping criterion, the remainder of the added degrees of freedom are introduced in regions with weaker features. 14.2.2.2. Two-pass strategy A second option, proposed by Aftosmis and Kroll (1991), Aftosmis (1992), is to separate the disparate intensity or length scales in two (or possibly several) passes over the mesh. In the first pass, the strong features of the flow are considered, and appropriate action is taken. 276 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES A second pass is performed for the elements not marked in the first pass, identifying weak features of the flow, and appropriate action is taken. This procedure has worked well for viscous flows with shocks, and can be combined with any of the error indicators described above. 14.2.2.3. Non-dimensional error indicators An error indicator that allows even refinement across a variety of intensity and length scales was proposed by Löhner (1987). In general terms, for linear elements it is of the form error = h 2 |second derivatives| h|first derivatives|+c n |mean value| . (14.21) Dividing the second derivatives by the absolute value of the first derivatives makes the error indicator bounded and dimensionless, and avoids the ‘eating-up’ effect of strong features. The terms following c n are added as a noise filter in order not to refine wiggles or ripples which may appear due to loss of monotonicity. The value for c n thus depends on the algorithm chosen to solve the PDEs describing the physical process at hand. The multi-dimensional form of this error indicator is given by E I = k,l ( N I ,k N J ,l d · U J ) 2 k,l ( |N I ,k |[|N J ,l U J |+c n (|N J ,l ||U J |)] d) 2 , (14.22) where N I denotes the shape functionof node I. The fact that this errorindicator is dimension- less allows the simultaneous use of several indicator variables. Because the error indicator is bounded (0 ≤ E I ≤ 1), it can be used for whole classes of problems without having to be scaled to the problem at hand. This results in an important increase in user-friendliness, allowing non-expert users access to automatic self-adaptive procedures. This error indicator has been used successfully for many years on a variety of applications (Löhner (1987, 1988b, 1989a,b), Baum and Löhner (1989), Löhner and Baum (1990), Löhner and Baum (1990), Baum and Löhner (1991, 1992), Löhner and Baum (1992), Loth et al. (1992), Sivier et al. (1992), Baum and Löhner (1993), Baum et al. (1994, 1995), Löhner et al. (2004c), Baum et al. (2006)). 14.2.3. DETERMINATION OF ELEMENT SIZE AND SHAPE After the error in the present solution has been measured, or at least the regions of the computational domain that require further refinement or coarsening have been identified, the next question to be answered is the magnitude of mesh change required. This question is of minor importance for h-refinement or p-refinement, where the grid is simply subdivided further by factors of two in space or by adding the next higher degree polynomial to the space of available shape functions. On the other hand, for adaptive mesh movement or adaptive remeshing, where the element size and shape vary smoothly, it is necessary to obtain a more precise estimation of the required element size and shape. How to achieve this will be shown for the non-dimensional error indicator given by (14.21). It is a simple matter to perform a similar analysis for all the other error indicators described. Defining the derivatives according ADAPTIVE MESH REFINEMENT 277 to order as D 0 i = c n (|U i+1 |+2 ·|U i |+|U i−1 |), (14.23a) D 1 i =|U i+1 − U i |+|U i − U i−1 |, (14.23b) D 2 i =|U i+1 − 2 · U i + U i−1 |, (14.23c) the error indicator on the present (old) grid E old is given by E old i = D 2 i D 1 i + D 0 i . (14.24) The reduction of the current element size h old by a fraction ξ to h new = ξh old will yield a new error indicator of the form E new i = D 2 i ξ 2 D 1 i ξ + D 0 i . (14.25) Given the desired error indicator value E new for the improved mesh, the reduction factor ξ is given by ξ = E new 2E old D 1 i + (D 1 i ) 2 +4D 0 i E old E new [D 1 i +D 0 i ] [D 1 i +D 0 i ] . (14.26) Observe that for a smooth solution with D 1 D 0 this results in ξ = (E new /E old ) 0.5 , consistent with the second-order accuracy of linear elements. Close to discontinuities D 1 D 0 holds,and one obtains ξ =E new /E old , consistent with the first-order error obtained in these regions. This error indicator can be generalized to multi-dimensional situations by defining the following tensors: (D 0 ) I kl = h 2 c n |N I ,k ||N J ,l ||U J | d, (14.27) (D 1 ) I kl = h 2 |N I ,k ||N J ,l U J | d, (D 2 ) I kl = h 2 N I ,k N J ,l dU J , (14.28) which yield an error matrix E of the form E = E xx E yx E zx E xy E yy E zy E xz E yz E zz = X · E 11 00 0 E 22 0 00E 33 · X −1 . (14.29) The principal eigenvalues of this matrix are then used to obtain reduction parameters ξ j j in the three associated eigenvector directions. Due to the symmetry of E, this is an orthogonal system of eigenvectors that defines a local coordinate system. The variation in element size required to meet a certain tolerance can be determined with any of the error indicators enumerated in section 14.1. However, the variation in stretching, i.e. the shape of the elements for the adapted 3-D mesh, requires an error indicator that is based on a tensor of second derivatives. [...]... by expanding the refinement region; - make elements to be coarsened compatible by reducing the coarsening region; - refine/coarsen the mesh; 28 2 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 1 :2 2:4 2: 8 1:4 1:8 8+ 8+ 4:8 Figure 14.4 Refinement cases for tetrahedra 4 4 10 8 10 8 9 7 6 5 2 10 8 9 3 1 4 1 9 3 7 1 6 5 2 3 7 5 6 2 Figure 14.5 Choice of inner diagonal - correct the location of new boundary... built-in p-refinement capability Possible reasons for this lack of success, which stands in contrast to CSD applications (Dunavant and Szabo (1983), Wang et al (1984), Szabo (1986), Babuska et al (1986)) are the following 27 9 ADAPTIVE MESH REFINEMENT (a) (b) 1 N1 (c) 1 N N1 2 1 2 1 N N1 2 1 2 N 2 1 2 Level 0 (a) (b) N 1 N1 1 3 (c) 1 N N1 2 3 2 1 N 3 1 N N1 2 3 2 1 N 3 N 2 3 2 Level 1 Figure 14 .2 Mesh... h/p-type refinements are considered This is not to say that we may not see much activity in this area: boundary layers, shear layers, flames and other features that are currently being computed using under-resolved Navier– Stokes runs are, when properly resolved, smooth features that should be ideally suited to high-order discretizations 28 0 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 14.3 .2. 1 H-enrichment... (1991, 19 92) , Löhner and Baum (19 92) , Sivier et al (19 92) , Baum and Löhner (1993), Baum et al (1994, 1995), Löhner et al (20 04c), Baum et al (20 06)) 28 3 ADAPTIVE MESH REFINEMENT 8:1 4:1 8 :2 4 :2 8:4 2: 1 Figure 14.6 Coarsening cases for tetrahedra Recursive subdivision of the largest edge The separate coding and maintenance of allowable refinement and coarsening patterns observed for classic h-refinement... coding complexity of p-methods or h/p-methods as compared to straightforward h-methods The only possible difficulty of h-methods is given by hanging nodes for quad- or brick-type elements (for triangles and tetrahedra even this problem disappears) Apart from this relatively small modification, the original oneelement-type flow solver can remain unchanged On the other hand, any p-method requires the development... a point The formation of these two arrays has been treated in Chapter 2 After these two side arrays have been formed, a further loop over the elements is performed, identifying which sides belong to each element 28 8 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 14.4.1 .2 Identification of elements to be refined The aim of this sub-step is to determine on which sides further gridpoints need to be introduced,... (1 :2) , three contiguous sides (1:4) or six contiguous sides (1:8) These admissible cases can be obtained from the following element-by-element algorithm (see Figure 14.7): - set the node-array lnode(1:4)=0; - loop over the sides of the element: if the side has been marked for the introduction of a new point, set lnode(ip1)=1, lnode(ip2)=1, where ip1, ip2 are the endnodes corresponding to this side; -. .. obtained on the original, unrefined mesh did not exhibit a good comparison to the experiment Mesh Particle Traces Temp: dt=0.005 abs(v): dv=1 Comparison to Experiment Figure 14.8 Convection between concentric cylinders 29 2 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES (a) (b) Figure 14.9 (a) and (b) Shock-object interaction; (c) comparison to experiment ... differently the parent elements with 0, 1, 2, 3, 4, 5 or 6 total deletion points 29 0 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 14.4.1.4 Refinement of the grid where needed New points and elements are introduced in two independent steps, which in principle could be performed in parallel (i) Points To add further points, the sides marked for refinement in 2 are grouped together For each of these sides... (see section 14.3.4 below) 14.3 .2 MESH ENRICHMENT (H/P-METHODS) In this case, degrees of freedom are added or taken from a mesh One may either split elements into new ones (h-refinement, see Figure 14 .2( a)), or add further degrees of freedom with hierarchical shape functions (Figure 14 .2( b)) The same may be accomplished with the addition of higher-order shape functions (p-refinement), again either conventional . following. ADAPTIVE MESH REFINEMENT 27 9 1 12 Level 0 1 N 2 N 1 12 1 N 2 N 1 12 Level 1 1 N 2 N 1 12 1 N 2 N 33 3 N 3 N 1 12 1 N 2 N 1 12 1 N 2 N 3 3 N (c)(b)(a) (a) (b) (c) Figure 14 .2. Mesh enrichment (a). INTERPOLATION 26 7 Table 13 .2. Particle-mesh interpolation timings ON=F,OFF=V ON=F Particle-tracing time (s) 25 7.0 17.6 MFLOP-rate recorded 1.11 20 . 82 Total running time (s) 29 0.0 21 .45 Timings (µs/particle/step). REFINEMENT 27 3 approximations to a second derivative: u ,xx | 4 1 = 1 h 2 (u i−1 − 2u i + u i+1 ) − 1 12 h 2 u ,I V , (14.6a) u ,xx | 4 2 = 1 4h 2 (u i 2 − 2u i + u i +2 ) − 1 12 4h 2 u ,I V ,