Next Article in Journal
New Advances in Distribution Theory and Its Applications
Previous Article in Journal
Synthesis of Sources of Common Randomness Based on Keystream Generators with Shared Secret Keys
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Robust Discontinuity Indicators for High-Order Reconstruction of Piecewise Smooth Functions

Department of Applied Mathematics and Statistics, Institute for Advanced Computational Science, Stony Brook University, Stony Brook, NY 11794, USA
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(15), 2442; https://doi.org/10.3390/math13152442
Submission received: 8 June 2025 / Revised: 21 July 2025 / Accepted: 23 July 2025 / Published: 29 July 2025

Abstract

The accurate reconstruction of piecewise continuous functions on meshes is challenging due to potential spurious oscillations—namely the Gibbs phenomenon—especially for high-order methods. This paper introduces the Robust Discontinuity Indicators (RDI) method, a novel technique for constructing discontinuity indicators. These indicators can effectively identify both C 0 and C 1 discontinuities in a single pass using a new comprehensive theoretical analysis combined with cell-based overshoot–undershoot indicators and node-based oscillation indicators. In addition to detecting discontinuities, these indicator values can also facilitate the construction of adaptive weighting schemes to mitigate the Gibbs phenomenon. Due to its flexibility, RDI can accommodate complex geometries and applies to nonuniform unstructured meshes and general surfaces, broadening its utility. Through experiments, we show that RDI can accurately capture discontinuities while producing fewer false positives than two-pass methods. By providing a more rigorous method for discontinuity detection, RDI has the potential to offer significant improvements in computational simulations and data remapping.

1. Introduction

The detection and accurate resolution of discontinuities in piecewise continuous functions are pivotal in diverse computational applications, including computer-aided design (CAD), computer graphics, and computational fluid dynamics (CFD) [1,2,3]. Inaccuracies in these processes can lead to non-physical oscillations, known as the Gibbs phenomenon [4], which can severely jeopardize the fidelity of results, especially when high-order methods are used.
Sophisticated numerical methods, such as Discontinuous Galerkin (DG) methods [1], Essentially Non-Oscillatory (ENO) schemes [5], and Weighted Essentially Non-Oscillatory (WENO) schemes [6], have been effectively established to address these issues, especially in handling sharp transitions in the context of solving hyperbolic partial differential equations (PDEs). These challenges extend to other domains, such as in the numerical integration of piecewise-smooth (PWS) dynamical systems, where naive regularization can alter the system’s qualitative behavior [7], making accurate event detection essential [8]. The ENO-SR scheme introduced by Harten [9] further incorporates subcell resolution, which improves the accuracy of discontinuity detection by utilizing cell averages to precisely locate discontinuities within a cell, thus preventing the smearing of features like contact discontinuities. Most of these methods focus on identifying and resolving C 0 discontinuities, namely discontinuities in function values. Some works, such as [10,11], can also detect and/or resolve C 1 discontinuities, namely discontinuities in the gradients of functions, such as in the context of solving Hamilton–Jacobi equations [10]. The latter is even more crucial in remapping and reconstructing piecewise continuous functions than it is in solving PDEs. Recognizing this challenge, we aim to develop a method for detecting and characterizing C 0 and C 1 discontinuities. This method should apply to nonuniform, unstructured surface meshes and general surfaces, unlike traditional methods limited to structured meshes or 2D planes. In addition, the indicator values in detecting discontinuities should also be useful for constructing adaptive weighting schemes to resolve the Gibbs phenomenon, such as those used in WENO-like schemes [12,13].
This paper details the Robust Discontinuity Indicators (RDI) method, a sophisticated technique that addresses these challenges. This work significantly expands upon our previous research [13], where the analysis was primarily heuristic and testing was limited to uniform spherical meshes. The main contributions of this paper are a more rigorous theoretical foundation and a significant generalization of the method. Specifically, we provide a systematic theoretical analysis, including proofs, that explains the behavior of the indicators and enables the robust detection of both C 0 and C 1 discontinuities in a single pass. Furthermore, we generalize the method to accommodate complex geometries with sharp features and nonuniform unstructured meshes, which is critical for practical applications [2]. The enhanced scheme also improves robustness for functions with poor scaling characteristics and, importantly, is extended to handle cell-averaged data, a key requirement for finite volume methods not previously addressed. Finally, through extensive numerical verification, we demonstrate that RDI accurately captures discontinuities while producing fewer false positives than comparable two-pass methods. By enhancing the accuracy of discontinuity detection and resolution, the RDI method can facilitate more consistent and reliable simulations, data remapping, and other computational procedures.
The remainder of this paper is organized as follows. Section 2 provides an introductory overview of weighted least squares approximations and the Gibbs phenomenon. Section 3 presents a detailed analysis of overshoots and undershoots near discontinuities, culminating in the derivation of cell-based overshoot–undershoot indicators. Section 4 introduces node-based oscillation indicators and a dual-thresholding strategy and elaborates on their effective implementation in scenarios involving nonuniform meshes and distinct surface features. Section 5 showcases a series of numerical tests and compares RDI with other state-of-the-art approaches to substantiate the robustness of the RDI method. Lastly, Section 6 summarizes the findings and discusses prospective avenues for further exploration.

2. Background and Preliminaries

Weighted least squares (WLS) is a powerful method for data fitting, remapping, reconstruction, and other applications. However, degree-p WLS with p 2 can introduce oscillations near discontinuities [13]. Interestingly, these oscillations can also be useful in detecting discontinuities. In this section, we provide an overview of WLS and discuss the phenomenon of oscillations, commonly referred to as the Gibbs phenomenon. This section also introduces Weighted Averaging of Local Fittings (WALF), a technique used later in the construction of our indicators.

2.1. Related Work

Discontinuities often lead to undesired overshoots or undershoots in numerical methods. Specifically, C 0 discontinuities, also known as edges [14], jump discontinuities [15,16], or faults [17,18], have a finite jump in function values. These discontinuities tend to cause O ( 1 ) oscillations that persist with mesh refinement [13]. This phenomenon is referred to as the Gibbs or Gibbs–Wilbraham phenomenon in the context of the Fourier transform [16]. While C 0 discontinuities have been extensively studied, less attention has been given to C 1 discontinuities, which have a finite jump in the gradients of functions. Nonetheless, C 1 discontinuities are still crucial in various applications. For instance, they often represent junctions or intersections of components, such as features or ridge points. The  C 1 discontinuities may cause mild oscillations in numerical methods [19].
Detecting these discontinuities is essential for the effective resolution of the Gibbs phenomenon in numerical methods. It also has significant implications for various other applications, such as mesh reconstruction [20] and image processing [21]. Several methods have been developed for edge detection, such as the Polynomial Annihilation Edge Detector (PAED) [22,23,24,25] based on the polynomial annihilation (PA) technique, zero-crossing in the second derivatives [26,27,28], and singularity detection and processing with wavelets (SDPW) [29] based on the wavelet transform. The PA technique in [22] focused on a 2D unstructured mesh, approximating the jump function to detect C 0 discontinuities. The work in [23] further utilizes PAED on an approximation of the gradient to detect C 1 discontinuities. In [25], the work combined the use of PA techniques to detect discontinuities and applied 1 regularization to mitigate the Gibbs phenomenon in the context of solving hyperbolic PDEs in 1D. Furthermore, work on variably scaled kernels (VSKs) has shown success in interpolating functions with gradient discontinuities by locally adapting the smoothness of the basis functions to the position of the discontinuities [30]. Separately, recent work has developed methods for polynomial interpolation using mapped bases while avoiding resampling, addressing the Gibbs phenomenon [31]. Unlike these previous works, our method is based on weighted-least squares and can detect both C 0 and C 1 discontinuities in a single pass without explicitly estimating derivatives. In addition, our method can be applied to general surfaces and nonuniform meshes, which are not addressed in the PA technique. In Section 5.2, we will compare our method with PAED [22,23] and demonstrate that our method tends to produce fewer false positives. It is also worth noting that for general surfaces, we cannot easily transform the problem into 1D problems or apply a Fourier transform, and many existing methods (such as the 1D technique in [25,32] and the Fourier transform in [33]) are not directly applicable in this context.

2.2. Weighted-Least-Squares Approximations

In numerical analysis, approximation uses a simple function to simulate a more complex function or a function without an analytic formula. In practice, these functions might only have values at a discrete set of points, necessitating the use of interpolation or other fitting techniques to obtain an approximation from these sample points. Degree-p weighted least squares (WLS) is a powerful method that employs polynomials of a degree up to p to approximate a function sampled at discrete points. Taking degree-2 WLS as an example, we can expand the n-dimensional Taylor series of a function f at a point x = x 0 + h using the first three terms,
f ( x 0 + h ) = f ( x 0 ) + h T f ( x 0 ) + 1 2 h T H f ( x 0 ) h + O ( h 3 ) ,
where f and H f denote the gradient and Hessian of f with respect to x , respectively. We use the 2-norm by default for vectors unless otherwise noted.
By considering the approximation q f ( x ) = f ( x 0 ) + h T g ˜ + 1 2 h T H ˜ h , where g ˜ and H ˜ denote the approximations to f ( x 0 ) and H f ( x 0 ) , respectively, we can express each component of g ˜ and H ˜ as a linear combination of f i = f ( x i ) , i.e.,
g ˜ j = k c i k f k and h ˜ i j = k d i j , k f k .
Here, c i k and d i j , k are coefficients that depend on the weights used in the WLS approximation. These coefficients have magnitudes of Θ ( 1 / h ) and Θ ( 1 / h 2 ) , respectively, and are independent of the function f. When f is at least C 2 continuous, the quadratic WLS approximation q f ( x ) is at least second-order accurate. To determine the coefficients, we construct a linear system
A c = f ,
where A is the generalized Vandermonde matrix and c contains the coefficients to be determined. The rows of A correspond to basis functions evaluated at sample points, and  f contains the function values at these sample points. By including an adequate number of sampling points in a stencil (a local neighborhood of points), we aim to ensure the good conditioning of the system. We assign weights to each equation (row) to emphasize the importance of the corresponding sample point, leading to the weighted system W A c = W f , which is solved in a least-squares sense to minimize W ( A c f ) 2 . Here, W is typically a diagonal matrix of weights. Different weight choices, such as distance-inverse weights [34] or radial basis function (RBF) weights [35] based on distances, have been used in WLS, each suited to different scenarios. Notably, the WLS-WENO weights [36,37,38,39,40] are based on function values and aim to resolve discontinuities.
To improve conditioning, the WLS problem is typically formulated in a local coordinate system centered at x 0 , where coordinates are normalized by a characteristic length scale related to the stencil size. This makes the entries of A dimensionless and bounded. The matrix W A is then called the scaled Vandermonde matrix.
A mesh is quasi-uniform if there exist constants c 1 , c 2 > 0 such that for any element (cell) σ in the mesh, c 1 h diam ( σ ) c 2 h and c 1 h d vol ( σ ) c 2 h d (for d-dimensional elements), where h is a global mesh size parameter (e.g., average edge length of all elements in the mesh) and diam ( σ ) is the diameter of σ . For such meshes, the maximum and minimum edge lengths of elements are bounded within a constant factor of each other. We denote h as the average edge length of the mesh.
Definition 1. 
A degree-p WLS is stable if the scaled Vandermonde matrix W A , constructed using normalized local coordinates, has a condition number that is bounded independently of the mesh size h.
Stability is critical in ensuring the accuracy of the approximation under mesh refinement. The weights in W are also chosen to be dimensionless and independent of h. Note that interpolation is a special case of WLS where the Vandermonde matrix (after selecting a subset of rows if overdetermined) is square and non-singular.
Lemma 1. 
Given a C p function f, of which the ( p + 1 ) st derivative is bounded, a stable degree-p WLS approximation f p is ( p + 1 ) st-order accurate, i.e.,
f p f = O ( h p + 1 ) .
Furthermore, the entries in the gradient and Hessian of f p are accurate to O ( h p ) and O ( h p 1 ) , respectively.
Proof. 
This result is standard in WLS theory (e.g., Theorem 4 in [34]). For completeness, we outline the key steps of the proof, which is based on backward error analysis. First, using Taylor series expansion for f around the center of the WLS stencil x 0 , the local error for the kth sample point x k is f ( x k ) P p ( x k ) = O ( h k p + 1 ) , where P p is the degree-p Taylor polynomial and h k = x k x 0 . When these residuals are incorporated into the WLS system, the backward error in the scaled Vandermonde system (constructed with normalized coordinates) is O ( h p + 1 ) . Under the assumption that the condition number of the scaled Vandermonde matrix is bounded independently of h, the forward error in the computed polynomial coefficients c is of the same order. Consequently, the error in approximating f ( x ) by f p ( x ) for x near x 0 is also O ( h p + 1 ) . The approximations for the derivatives are obtained by differentiating f p . Since the local coordinates used in f p are scaled by h, differentiation effectively divides by h for the gradient and h 2 for the Hessian, leading to accuracy orders of O ( h p ) and O ( h p 1 ) , respectively.    □
Lemma 1 will be used later in Section 3 and Section 4 to derive our indicators in RDI.

2.3. Weighted Averaging of Local Fittings

In this subsection, we review the concept of Weighted Averaging of Local Fittings (WALF) [41]. WALF is a technique for reconstructing functions on discrete surfaces Ω R 3 and is a key component in constructing one of our discontinuity indicators. Compared to pure WLS (where a separate WLS approximation is constructed for each target point) and the Continuous Moving Frames (CMF) method [41,42], WALF offers computational advantages when the number of sampled points is smaller than the number of target points. In addition, it is important to note that WALF is more susceptible to oscillations near discontinuities than CMF, as demonstrated in [41]. This oscillatory property of WALF is useful in detecting discontinuities, as discussed in Section 3.4.
Given a point p located within a cell with vertices { x i } i = 1 m , let ξ = ( ξ 1 , , ξ m ) denote the natural (or barycentric, if applicable) coordinates of p with respect to these vertices, such that p = i = 1 m ξ i x i and ξ i = 1 . For each vertex x i , we introduce a local u v coordinate system in the tangent plane centered at x i , with u denoting the coordinates in this plane. Let f i ( u ) : = f ( x ) denote the function f expressed in this local coordinate system associated with the vertex x i . Let g i ( p ) denote an approximation of f ( p ) obtained by first constructing a WLS polynomial P i ( u ) centered at x i (using data from a stencil around x i ) and then evaluating this polynomial at the projection of p onto the u v -plane of x i . The WALF reconstruction for f ( p ) is then given by
g WALF ( p ) = i = 1 m ξ i g i ( p ) .
For further details on WALF, we refer readers to [41].
To construct the WLS approximation P i ( u ) (which yields g i ( p ) ) for each sampled point x i , we use the scaled Buhmann weight introduced in [13],
ω j SB = γ j + ϕ ( r j / ρ ) ,
where r j = u j is the distance from the center x i to a stencil point x j in the local u v -coordinates of x i , ρ is the cut-off radius, and 
ϕ ( r ) = 112 45 r 9 / 2 + 16 3 r 7 / 2 7 r 4 14 15 r 2 + 1 / 9 , if 0 r 1 , 0 , if r > 1 .
Here, ϕ ( r ) in (3) is a C 3 function due to Buhmann [43]. We define ρ = σ R for some radius ratio σ > 1 , where R = r k , the distance from the kth farthest point in the local coordinate system to center node x i (within its WLS stencil), and  σ = 2.0 , 1.6 , and  1.4 for degree-2, 4, and 6 WLS, respectively; see [13] for their justifications. γ j + = max { 0 , n j T n 0 } is a safeguard against “short circuiting” (such as a stencil that wraps around a small circle of a torus), where n j and n 0 denote some approximate normal directions at stencil point x j and the center node x i , respectively. The geometry and mesh solely determine these weights, independently of the function values. By precomputing the WLS polynomials P i at each vertex x i , we can efficiently evaluate g i ( p ) for any point p in the proximity of x i .

3. Cell-Based Indicators

One fundamental aspect of our proposed algorithm is the development of cell-based indicators specifically designed for detecting discontinuities within single mesh cells. This approach builds upon and significantly refines a technique originally introduced in [13], particularly by offering a deeper analysis of stable quadratic Weighted Least Squares (WLS) and linear interpolation. Notably, these two approximation methods exhibit differential behaviors in smooth regions versus near discontinuities. In this section, we rigorously quantify these differences to inform the construction of cell-based indicators accurately.
The ensuing analysis is crucial for the precise identification of both C 0 and C 1 discontinuities, laying solid groundwork for the indicator’s formulation. This enhancement significantly augments our capability to detect critical features within the data. Furthermore, this analytical base underpins the development of more advanced node-based markers, as will be elaborated in Section 4. Through this methodological and analytical approach, we seek to improve the robustness and computational efficiency of the algorithm, especially when dealing with data characterized by complex discontinuity structures. We will analyze in the 2D case for simplicity and generalize the analysis to smooth surfaces in Section 3.3 and surfaces with discontinuities in Section 4.3.

3.1. Asymptotic Bounds in Smooth Regions

Given a piecewise smooth function f : Ω R defined on a 2D mesh Ω , let l f ( x ) denote the piecewise linear interpolation of f at a point x , and let q f ( x ) denote the corresponding quadratic WLS approximation. We assume that the WLS is stable, as explained in Section 2.2. The linear interpolation typically averages function values at nearby mesh nodes or uses local basis functions, while quadratic WLS accounts for changes up to the second derivative. This difference in approximation power leads to an O ( h 2 ) discrepancy in smooth regions, as stated in the following proposition.
Proposition 1. 
In regions where a function f is C 2 continuous on a 2D mesh, the difference between a stable quadratic WLS approximation q f ( x ) and linear interpolation l f ( x ) is O ( h 2 ) , where h denotes the average edge-length of the mesh.
Proof. 
Without loss of generality, let us first assume that the mesh comprises triangles. The error of linear interpolation l f ( x ) for a C 2 function f is l f ( x ) f ( x ) = O ( h 2 ) . For the quadratic WLS approximation q f ( x ) , when f is C 2 , its error q f ( x ) f ( x ) is O ( h 2 ) . This is because quadratic WLS is exact for quadratic polynomials, and the error is determined by how well a quadratic can approximate f over the stencil. For a C 2 function, this deviation is controlled by the second derivative, leading to an O ( h 2 ) error. If f were C 3 (or C 2 with a bounded third derivative), Lemma 1 would provide O ( h 3 ) accuracy. Then, according to the triangle inequality,
l f ( x ) q f ( x ) = ( l f ( x ) f ( x ) ) ( q f ( x ) f ( x ) ) l f ( x ) f ( x ) + q f ( x ) f ( x ) .
Substituting the error bounds, we have l f ( x ) q f ( x ) O ( h 2 ) + O ( h 2 ) = O ( h 2 ) . For quadrilateral meshes, replacing linear with bilinear interpolation maintains these error bounds.    □
This analysis indicates that the difference between quadratic WLS and linear interpolation is minimal in smooth regions. However, this difference becomes substantially larger near discontinuities, which we will show next.

3.2. Asymptotic Bounds near Discontinuities

The presence of discontinuities significantly alters the approximation characteristics, leading to distinct asymptotic behaviors for quadratic weighted least squares (WLS) q f and linear interpolation l f . Estimating this difference is challenging because the derivatives of discontinuous functions are not well defined in the classical sense. Generalized derivatives, such as the Dirac delta function as the distributional derivative of the Heaviside function, cannot be directly used in the context of Taylor series expansions to derive error bounds.
Generalizing the analysis in Section 3.1, we present a rigorous analysis of the differences between q f and l f near C 0 and C 1 discontinuities. This is achieved by considering the behavior of the WLS approximation q f itself, whose derivatives are well-defined polynomials, even if they do not accurately represent the derivatives of f near the discontinuity. These results are crucial for the development of cell-based indicators, as they provide a solid foundation for detecting discontinuities within single mesh cells.
Lemma 2. 
In the vicinity of radius O ( h ) near a C 0 discontinuity, the error in the quadratic WLS approximation q f is O ( 1 ) . In contrast, near a C 1 discontinuity, it is O ( h ) , where h denotes the average edge-length of the quasi-uniform mesh.
Proof. 
Given the function f : Ω R and a point x Ω located near a discontinuity, we consider the two cases separately. Let x 0 be the center of the WLS stencil used to construct q f .
Case 1:  C 0  Discontinuity. At a C 0 discontinuity, the function values exhibit an O ( 1 ) abrupt change. If the WLS stencil for q f (centered at x 0 ) includes points from both sides of the discontinuity, the WLS fit will attempt to bridge this jump. Let h ( x ) = x x 0 , with  h ( x ) = O ( h ) . The WLS solution q f ( x 0 ) will typically be some average of the function values in the stencil, so | q f ( x 0 ) f ( x 0 ) | can be O ( 1 ) if f ( x 0 ) is on one side of the jump. The estimated gradient g 0 = q f ( x 0 ) and Hessian H 0 = H q f ( x 0 ) will be scaled by inverse powers of h to capture the jump: g 0 = O ( h 1 ) and H 0 = O ( h 2 ) are possible if the WLS attempts to fit the jump with a quadratic. Then, the change in q f over a distance O ( h ) is
q f ( x ) q f ( x 0 ) = h ( x ) T g 0 + 1 2 h ( x ) T H 0 h ( x ) = O ( h · h 1 + h 2 · h 2 ) = O ( 1 ) .
By applying the triangle inequality, we obtain
q f ( x ) f ( x ) q f ( x ) q f ( x 0 ) + q f ( x 0 ) f ( x 0 ) + f ( x 0 ) f ( x ) .
Since | f ( x 0 ) f ( x ) | = O ( 1 ) if x and x 0 are on opposite sides of the jump (or one is on it), and  | q f ( x 0 ) f ( x 0 ) | can be O ( 1 ) , the total error q f ( x ) f ( x ) is O ( 1 ) .
Case 2: C 1 Discontinuity. A C 1 discontinuity is characterized by continuous function values but an O ( 1 ) abrupt change in the gradient of f. In this case, f is continuous, so q f ( x 0 ) can approximate f ( x 0 ) well, potentially | q f ( x 0 ) f ( x 0 ) | = O ( h 2 ) or O ( h 3 ) if the stencil is mostly on one side or if x 0 is at the kink. However, the WLS-approximated gradient g 0 will be an average of gradients from both sides, so g 0 f ( x 0 ) can be O ( 1 ) . The WLS-approximated Hessian H 0 might scale as O ( h 1 ) to capture the change in gradient. So, g 0 = O ( 1 ) , and  H 0 = O ( h 1 ) . The change in q f is q f ( x ) q f ( x 0 ) = O ( h · 1 + h 2 · h 1 ) = O ( h ) . The error is
q f ( x ) f ( x ) q f ( x ) q f ( x 0 ) + q f ( x 0 ) f ( x 0 ) + f ( x 0 ) f ( x ) .
Here, | f ( x 0 ) f ( x ) | = O ( h ) , since f is continuous and its gradient is bounded (piecewise). If we assume | q f ( x 0 ) f ( x 0 ) | = O ( h 2 ) (reasonable for a C 1 kink), then the total error q f ( x ) f ( x ) is O ( h ) .    □
In the preceding proof, the key idea was to analyze the behavior of the WLS polynomial q f ( x ) and its derivatives, which are well defined, even when the true derivatives of f ( x ) are not. This strategy effectively overcame the difficulty of undefined derivatives of f ( x ) at discontinuities. Using this lemma, we can now quantify the difference between quadratic WLS and linear interpolation near discontinuities.
Proposition 2. 
In the vicinity of radius O ( h ) near a C 0 discontinuity of a piecewise smooth function f on a 2D mesh Ω, the difference between the quadratic WLS q f and the piecewise linear interpolation l f is O ( 1 ) . In the vicinity of radius O ( h ) near a C 1 discontinuity, this difference is O ( h ) , where h denotes the average edge-length of the mesh.
Proof. 
Given the function f : Ω R and a point x Ω located near a discontinuity, we consider the two cases separately.
Case 1: C 0 Discontinuity. At a C 0 discontinuity, the function values have an O ( 1 ) abrupt change. Piecewise linear interpolation l f does not introduce new extrema beyond the range of local data values, so the deviation of linear interpolation l f from f at x is bounded by the local jump height, i.e.,  l f ( x ) f ( x ) = O ( 1 ) . From Lemma 2, q f ( x ) f ( x ) = O ( 1 ) . Applying the triangle inequality, we get
q f ( x ) l f ( x ) q f ( x ) f ( x ) + l f ( x ) f ( x ) = O ( 1 ) + O ( 1 ) = O ( 1 ) .
Case 2: C 1 Discontinuity. A C 1 discontinuity is characterized by an O ( 1 ) abrupt change in the gradient of f, while f itself is continuous. Piecewise linear interpolation l f deviates from f by O ( h 2 ) in smooth parts, but across a C 1 kink, its error is typically O ( h ) if one considers the maximum deviation from the true function over an element of size h. More precisely, the error of linear interpolation is bounded by C h 2 max H f . Near a C 1 discontinuity, the Hessian is not well defined. However, f is Lipschitz continuous, so | f ( x ) f ( y ) | L x y . The error of linear interpolation l f from f is O ( h ) because the function behaves like c 1 x for x < 0 and c 2 x for x > 0 locally, and linear interpolation will have an O ( h ) error with respect to the underlying smooth pieces if it spans the kink. Thus, l f ( x ) f ( x ) = O ( h ) . From Lemma 2, q f ( x ) f ( x ) = O ( h ) . Applying the triangle inequality, we get
q f ( x ) l f ( x ) q f ( x ) f ( x ) + l f ( x ) f ( x ) = O ( h ) + O ( h ) = O ( h ) .
   □
Proposition 2 provides an upper bound, as signified by the O notation. These bounds are not necessarily tight for all points in the vicinity of the discontinuity, depending on both the positions of the points relative to the discontinuity and the choices of the WLS stencils. In practice, we observe that these bounds are likely to be tighter when the WLS is constructed using stencils that include points on both sides of a discontinuity and evaluated at points somewhat centrally located with respect to these stencils, especially when using WALF as described in Section 2.3. Since WALF is computed as a weighted average of the WLS fittings, the upper bounds of the errors for WALF are asymptotically the same as those of WLS. This observation motivates us to use WALF to reconstruct the function at cell centers when constructing cell-based indicators in Section 3.4.
It is also worth noting that the error bounds in Propositions 1 and  2 hold not only for quadratic WLS but also for other degrees, such as linear and cubic WLS, when compared against an appropriate baseline (e.g., constant or linear interpolation). However, linear WLS may not be sensitive enough to higher-order features, and cubic WLS may induce oscillations when approximating C 2 continuous functions (i.e., functions with discontinuous third derivatives) and also incur higher computational costs. Hence, quadratic WLS emerges as a practical choice in terms of robustness, sensitivity to C 1 features, and computational efficiency in the context of detecting discontinuities.

3.3. Generalization to Smooth Surfaces in R 3

The preceding analysis was conducted in R 2 for simplicity. To extend these results to smooth surfaces in R 3 , we need to consider the geometric properties of the surface mesh. The analysis becomes more complex if the surface contains geometric discontinuities, such as edges or corners. We defer the consideration of geometric discontinuities to Section 4.3 and focus on smooth surfaces here.
For a given point x on a smooth surface Ω R 3 , we can approximate the local surface around x using its tangent plane. Let p be a point near x on the surface. By projecting p onto the tangent plane at x , we obtain a point p in the 2D plane. The error introduced by this projection (i.e., the distance between p and p ) is O ( h 2 ) for smooth surfaces, where h = p x . This projection allows us to apply the 2D analysis to the 3D surface by considering the local coordinates on the tangent plane, as performed in the WLS construction (Section 2.2) and WALF (Section 2.3). The WLS approximations are constructed in these local u v -planes. Since the geometric error due to local planar approximation is O ( h 2 ) , this perturbation does not alter the leading order terms in the asymptotic error bounds derived in Propositions 1 and 2.

3.4. Precomputing Operator for Cell-Based Overshoot–Undershoot Indicators

We now build an operator to compute cell-based indicators for local overshoots and undershoots, inspired by Proposition 2.

3.4.1. Overshoot–Undershoot Indicators

To maximize the efficacy of the indicators, we evaluate them at “cell centers” since the error bounds in Proposition 2 are likely tighter for these points relative to the scale of the cell. For a cell σ with m vertices { v j } j = 1 m , we define its center as x c ( σ ) = 1 m j = 1 m v j . Let g σ , 1 denote the approximate value of f at x c ( σ ) obtained by linear interpolation and  g σ , 2 denote the approximate value from WALF with quadratic WLS, evaluated at x c ( σ ) . Specifically, we define g σ , 1 as the average of the function values at the vertices of σ :
g σ , 1 = 1 m j = 1 m f ( v j ) .
and g σ , 2 is the WALF approximation at x c ( σ ) , using natural coordinates ξ j = 1 / m (since x c ( σ ) is the average of vertices):
g σ , 2 = g WALF ( x c ( σ ) ) = 1 m j = 1 m g j ( x c ( σ ) ) ,
where g j ( x c ( σ ) ) is the evaluation of the quadratic WLS polynomial centered at vertex v j of cell σ , at the point x c ( σ ) . We then compute the value of α σ as the difference between g σ , 2 and g σ , 1 :
α σ = g σ , 2 g σ , 1 = 1 m j = 1 m g j ( x c ( σ ) ) f ( v j ) .
We refer to α σ as the overshoot–undershoot (OSUS) indicator at σ , since its positive and negative signs, respectively, indicate local overshoot and undershoot of g σ , 2 relative to g σ , 1 at σ , and its magnitude indicates the level of this difference. We choose this cell center x c ( σ ) to compute α σ because g σ , 2 (being a higher-order fit) is more prone to exhibiting significant deviations (overshoots/undershoots) from a simple linear average g σ , 1 near discontinuities compared to points closer to the cell vertices. In addition, these cell centers can be used as approximate quadrature points when we compute the node-based indicators in Section 4.
Both g σ , 2 and g σ , 1 are linear combinations of nodal function values f ( v k ) (where v k are vertices in the stencils for WLS and vertices of σ ). Consequently, α σ is also a linear combination of nodal values. The computation of all α σ values for all cells can be expressed as a sparse matrix-vector multiplication α = O f , where f is the vector of nodal function values. We refer to this sparse matrix O as the OSUS operator. Each row of O corresponds to a cell σ , each column corresponds to a node in the mesh, and each non-zero entry O σ k stores the weight of f ( v k ) in the expression for α σ . Specifically, to compute g j ( x c ( σ ) ) for cell σ and its vertex v j , we use a quadratic WLS centered at v j . A common choice for the WLS stencil is the k-ring neighborhood of v j : the zero-ring stencil is v j itself; the one-ring stencil consists of v j and its direct edge-neighbors; and the k-ring consists of all nodes reachable from v j by traversing at most k edges. We typically use the two-ring stencil for the WLS at each vertex v j of the cell σ [41]. The non-zeros in the row of O corresponding to cell σ are determined by the union of WLS stencils for all vertices v j of σ . This OSUS operator O depends only on the mesh geometry and WLS parameters and is independent of the function values f , so it can be pre-computed for a given mesh.
Occasionally, the Vandermonde matrix for a WLS problem may be poorly conditioned, e.g., due to an insufficient number of points in the stencil or a degenerate geometric configuration of stencil points (e.g., co-linear points for a quadratic fit). When this happens, we monitor the condition number of the Vandermonde matrix. If it exceeds a threshold, we enlarge the stencil (e.g., from a two-ring to a three-ring stencil) to incorporate more geometric variation and ensure sufficient independent constraints for the polynomial basis, which generally improves conditioning. To implement stencil operations efficiently, we can use an array-based half-facet data structure [44], which supports computing arbitrary ring sizes.

3.4.2. Cell-Based Threshold

In accordance with Propositions 1 and 2, most of the smooth regions can be filtered out by a cell-wise threshold applied to | α σ | . Let U σ represent the union of the two-ring stencils of all vertices of cell σ . Let δ f , σ = max x U σ f ( x ) min x U σ f ( x ) be the local range of f within this extended stencil for cell σ . Let h , σ be the average edge length of the cell σ itself (calculated in the original R 3 space). Let δ f g = max x Ω f ( x ) min x Ω f ( x ) be the global range of the function over the entire mesh Ω . Let h be the global average edge length of the mesh. We define the threshold for cell σ as
τ σ = max C δ f , σ h , σ 0.5 , C g δ f g h 1.5 ,
where the powers 0.5 and 1.5 are chosen based on Propositions 1 and 2 so that they are intermediate to the powers of h in the error bounds for α σ in smooth regions versus discontinuous regions. This choice is further elucidated in Table 1. We mark cells σ where | α σ | > τ σ as candidates for containing discontinuities. The majority of cells near C 0 and C 1 discontinuities are likely to be marked for sufficiently fine meshes, since their α σ values are asymptotically larger than this threshold. Note that near local extrema (or other critical points such as saddle points) in smooth regions, f is close to zero. Here, δ f , σ might be small (e.g., O ( h , σ 2 ) if dominated by quadratic behavior). In such cases, C δ f , σ h , σ 0.5 could become very small. To safeguard against false positives that might arise if α σ (being O ( h , σ 2 ) ) is compared to an overly small local term, the global term C g δ f g h 1.5 provides a baseline. However, C g should be small to prevent false negatives near genuine discontinuities where α σ might not be very large (e.g., mild C 1 kinks). We determine C and C g empirically; as a rule of thumb, we choose C = 0.4 and a small C g , such as C g = 0.05 . The small C g may still leave some false positives near local extremes in smooth regions, which we will further address using the node-based oscillation indicator in Section 4.

4. Node-Based Oscillation Indicators

4.1. Definition of Oscillation Indicator

The cell-based indicators α σ are prone to false positives near local extrema of the function, where f is smooth but has significant curvature. To mitigate this issue, we introduce node-based oscillation indicators, denoted as β v , derived from the cell-based α σ values. We define the oscillation indicators based on the observation that the α σ values are large in magnitude (due to Proposition 2) and oscillatory (change signs) in the cells surrounding a node near a discontinuity, a consequence of the Gibbs phenomenon. In contrast, the  α σ values tend to have consistent signs in cells surrounding a node near a local extremum, as proven in Proposition A1 of Appendix A.
Given a node v, let S v = { σ σ is a cell incident to v } be the set of cells containing vertex v. We define the oscillation indicator β v as
β v = σ S v w σ | α σ α ¯ v | σ S v w σ ( α ¯ v + ϵ β max σ S v | α σ | ) + ϵ min ,
where α ¯ v is a weighted average of the α σ values for the cells in S v , given by
α ¯ v = σ S v w σ α σ / σ S v w σ .
The weights w σ can be unit weights ( w σ = 1 ) for uniform meshes as in [13] or area-based weights ( w σ = Area ( σ ) ) for nonuniform meshes, as discussed in Section 4.2. The terms ϵ min and ϵ β are small positive safeguards against division by zero or near-zero values.
To understand why β v can effectively distinguish discontinuities from local extrema, let us first consider the behavior of its numerator and denominator, omitting the safeguards ϵ min and ϵ β for simplicity, so β v σ S v w σ | α σ α ¯ v | σ S v w σ α ¯ v . The numerator measures the weighted mean absolute deviation of α σ values around their weighted mean α ¯ v .
  • Near discontinuities: The α σ values tend to oscillate in sign. For example, if  α σ alternates between + A and A for cells around v, then α ¯ v 0 . The numerator becomes w σ | α σ 0 | w σ | A | . The denominator becomes w σ | α ¯ v | 0 . In this simplified view, β v would be large. With the safeguard ϵ β max | α σ | , the denominator becomes ( w σ ) ϵ β | A | . Thus, β v ( w σ | A | ) / ( ( w σ ) ϵ β | A | ) 1 / ϵ β , which is large if ϵ β is small.
  • Near local extrema (smooth regions): The α σ values tend to have consistent signs (e.g., all negative for a minimum, see Appendix A) and similar magnitudes. Thus, α σ α ¯ v A for all σ S v . The numerator w σ | α σ α ¯ v | becomes very small. The denominator w σ ( | α ¯ v | + ϵ β max | α σ | ) ( w σ ) ( | A | + ϵ β | A | ) remains relatively large. Hence, β v tends to be small.
Thus, β v tends to be large near discontinuities and small at local extrema, helping to reduce false positives from the cell-based indicators. It is also worth noting that β v is non-dimensional and is independent of the function value range and the mesh scale. It is also more computationally efficient and stable than explicitly estimating higher-order derivatives.
Let us elaborate on the two safeguards in the denominator in (10). These safeguards are incorporated against division by a value that is too small, which may happen if the function is locally linear (so all α σ 0 , making α ¯ v 0 and max | α σ | 0 ). ϵ β is a small dimensionless number; we found 10 3 to be robust in practice. The term ϵ min is an absolute small value only used when the rest of the denominator is numerically zero (e.g., if f is constant, all α σ = 0 ). This prevents β v from becoming NaN. We can choose ϵ min to be a very small floating-point number (e.g., related to machine epsilon times a typical scale of α σ , or simply a fixed small number like 10 16 ).
In terms of implementation, we use the one-ring neighborhood of cells S v (i.e., cells sharing vertex v) to evaluate β v from the α σ values. While using a larger neighborhood (e.g., cells incident to vertices in the 1-ring of v) might provide a smoother indicator, it would increase computational cost. To distinguish different types of discontinuities or filter smooth regions, we use a threshold κ for β v . Specifically, we mark a node v as part of a discontinuity if its β v value is large and at least one of its incident cells σ S v has a large | α σ | value (i.e., | α σ | > τ σ from Section 3.4). The final indicator η v for a node v is determined as:
η v = 2 , if β v > κ 0 and σ S v s . t . | α σ | > τ σ ( C 0 discontinuity ) , 1 , if κ 1 < β v κ 0 and σ S v s . t . | α σ | > τ σ ( C 1 discontinuity ) , 0 , otherwise ( smooth region ) ,
where κ 0 and κ 1 are thresholds for β v (with κ 0 > κ 1 ) and  τ σ is the cell-based threshold from (9). This dual-thresholding strategy using both α σ and β v values significantly reduces false positives and negatives, as we will demonstrate in Section 5.
We determine the thresholds κ 0 , κ 1 empirically. As a rule of thumb, lower κ values will result in a more sensitive indicator but may introduce a higher number of false positives. On the other hand, higher κ values will yield a stricter indicator, potentially leading to an increase in false negatives. In practice, we found that it works well to choose κ 1 in the interval [ 0.2 , 0.5 ] for C 1 discontinuities and κ 0 in [ 1 , 2 ] for C 0 discontinuities. These parameters are user-tunable based on the specific application’s tolerance for false positives and false negatives.

4.2. Area Weights for Nonuniform Meshes

In (10), the weights w σ play an important role in the accuracy of the node-based indicators, especially on nonuniform meshes. In our previous work [13], we used unit weights ( w σ = 1 ), assuming the meshes are relatively uniform. For highly nonuniform (albeit still quasi-uniform) meshes, we observe that utilizing unit weights may result in many false positives. To overcome this issue, we propose using area weights for nonuniform meshes, i.e.,  w σ = Area ( σ ) . This choice is motivated by the fact that the area of a cell is a measure of its contribution to the local region, which is a good proxy for its importance when averaging local indicators.
To illustrate the importance of area weights, let us consider a simplified example. Suppose node v is surrounded by one large cell σ 0 (with area A 0 and characteristic edge length h 0 ) and N c small cells σ k (with area A 1 A 0 and characteristic edge length h 1 h 0 ) for k = 1 , 2 , , N c . Assume v is in a smooth region where f is C 2 . Then, from Proposition 1, α σ 0 = O ( h 0 2 ) and α σ k = O ( h 1 2 ) . Since h 1 h 0 , we have | α σ k | | α σ 0 | . If unit weights ( w σ = 1 ) are used, α ¯ v α σ 0 + k = 1 N c α σ k 1 + N c . If  N c is large, α ¯ v could be much smaller than α σ 0 . The numerator of β v would be approximately | α σ 0 α ¯ v | + k = 1 N c | α σ k α ¯ v | . If  α ¯ v α σ 0 / ( N c + 1 ) , then the first term is | α σ 0 N c N c + 1 | . The other terms are N c | α ¯ v | N c | α σ 0 | / ( N c + 1 ) . The numerator becomes 2 N c N c + 1 | α σ 0 | . The denominator (simplified) is ( N c + 1 ) | α ¯ v | | α σ 0 | . So β v 2 N c N c + 1 , which approaches 2 for a large N c . Such a large β v could erroneously identify v as a discontinuity. In contrast, when employing area weights w σ = Area ( σ ) , w σ 0 = A 0 and w σ k = A 1 . Then α ¯ v A 0 α σ 0 + N c A 1 α σ 1 A 0 + N c A 1 . If  A 0 N c A 1 , then α ¯ v α σ 0 . The numerator of β v becomes A 0 | α σ 0 α ¯ v | + k = 1 N c A 1 | α σ k α ¯ v | . The first term is small. The second sum is A 1 | α σ k α σ 0 | N c A 1 | α σ 0 | . The denominator (simplified) is ( A 0 + N c A 1 ) | α ¯ v | ( A 0 + N c A 1 ) | α σ 0 | . So β v N c A 1 | α σ 0 | ( A 0 + N c A 1 ) | α σ 0 | = N c A 1 A 0 + N c A 1 . If  A 0 N c A 1 , then β v is small, correctly indicating a smooth region. This example, though simplified, illustrates that area weights can better handle variations in cell sizes, preventing false positives in smooth regions of nonuniform meshes while preserving effectiveness in detecting genuine discontinuities where α σ values oscillate significantly regardless of cell size.

4.3. Generalization to Surfaces with Geometric Discontinuities

Our preceding analysis generally assumed G 2 continuity of the surface (i.e., continuous surface normals and curvatures) for the WLS constructions to be straightforward. This assumption is not applicable when dealing with geometric discontinuities, such as sharp ridges ( G 1 discontinuity in surface normal) and corners ( G 0 discontinuity in surface position, or more complex normal behavior). This work focuses on discontinuities in normal directions, such as sharp ridges and corners. To accommodate ridge curves, we employ virtual splitting as presented in [20] along these feature curves. The basic idea of virtual splitting is to treat the mesh entities (vertices, edges) along a feature curve as distinct for each adjacent smooth surface patch. This effectively makes the twin half-edges along ridge curves appear disconnected in the mesh data structure (e.g., half-edge or half-facet data structure) and, in turn, creates a separate connected component (a patch with boundary) for each smooth region of the original surface. As a result, the WLS stencils used in computing g i (and thus α σ ) will not include points from different sides of these geometric discontinuities. For instance, after the virtual splitting of a cylinder, the two circular bases and the lateral surface become three distinct connected components (patches). We then separately run our RDI method on these surface patches, treating their new edges as boundaries. Without virtual splitting, using RDI might introduce many false positives (misinterpreting geometric features as function discontinuities) or false negatives (masking function discontinuities that coincide with geometric features), as we demonstrate in Appendix B.
Close to a geometric boundary of a patch (either an original boundary of the surface or one created by virtual splitting), WLS stencils need careful handling. Standard k-ring stencils might be too small or one-sided. We observed that using a slightly larger stencil, e.g., a three-ring neighborhood, can provide adequate data points for stable degree-2 WLS in the OSUS operator construction near such boundaries. Similarly, when computing β v for a vertex v on a patch boundary, its neighborhood S v will consist of cells from only one patch. These adjustments help provide more accurate indicator results, as demonstrated in Section 5.3.

4.4. Summary of Algorithm

We outline the complete algorithm for RDI. Our approach consists of three main stages:
  • Computation of cell-based OSUS indicators α σ for all cells σ .
  • Calculation of node-based oscillation indicators β v for all vertices v.
  • Determination of node-based discontinuity markers η v using a dual-thresholding strategy involving both α σ and β v .
Our design principle aims to separate offline preprocessing from online computation. Given a mesh, the offline component involves computing the OSUS operator O , which is constructed only once per mesh. This step involves setting up and storing the linear transformation from nodal function values f to cell-based indicators α . Once the OSUS operator is generated, the online computation can be performed efficiently, as outlined in Algorithm 1, to detect discontinuities for different function data f on the same mesh.
To analyze the time complexity of Algorithm 1, let N = | V | be the number of vertices and M = | E | be the number of cells. Offline (OSUS operator O construction): For each of the N vertices, a WLS polynomial is constructed. This involves selecting a stencil (e.g., k s -ring, with  S k points, assumed as O ( 1 ) ) and solving a small D p × D p system (where D p is the number of polynomial basis functions, O ( 1 ) for fixed-degree p). This is O ( N · ( S k + D p 3 ) ) = O ( N ) . Then, for each of the M cells σ (with m σ vertices, m σ = O ( 1 ) ), the entries of the corresponding row in O are computed. This involves evaluating m σ WLS polynomials. The support for this row (number of non-zeros) depends on the union of stencils of its m σ vertices. If the average stencil size is S k , this is O ( M · m σ · S k ) . Overall, constructing and storing O (if its total non-zeros is N n z ) is roughly O ( N + N n z ) . If  N n z = O ( M · S k ) , then it is O ( N + M ) . This step is performed once per mesh.
Algorithm 1 Robust Discontinuity Indicators (RDI)
Require: A surface mesh Γ = ( V , E ) (vertices V, cells E), the precomputed OSUS operator O for Γ , function values f at all nodes v V , node-based thresholds κ 0 , κ 1 for C 0 and C 1 discontinuities ( κ 0 > κ 1 ), cell-based threshold parameters C , C g .
Ensure: A vector of integer markers η for all nodes v V ( η v { 0 , 1 , 2 } ).
  1:
α Of                  ▹ Compute all cell-based indicators α σ
  2:
Initialize η v 0 for all v V .
  3:
Initialize M v false for all v V .     ▹ Helper: node v is part of a cell σ with | α σ | > τ σ
  4:
for all cell σ E  do                ▹ Stage 1: Cell-based pre-filtering
  5:
    Compute cell area A σ (if using area weights for β v ).
  6:
    Compute local range δ f , σ , local cell size h , σ .
  7:
    Compute cell threshold τ σ using (9) with C , C g , global range δ f g , global h.
  8:
    if  | α σ | > τ σ  then
  9:
        for all vertex v σ  do
10:
            M v true
11:
        end for
12:
    end if
13:
end for
14:
for all vertex v V  do    ▹ Stage 2 & 3: Node-based indicators and final marking
15:
    if  M v = true  then       ▹ Only compute β v if v is near a cell with significant α σ
16:
        Let S v = { σ E v σ } .
17:
        Compute weights w σ for σ S v (e.g., unit or area A σ ).
18:
        Compute α ¯ v = σ S v w σ α σ / σ S v w σ .
19:
        Compute β v using (10).
20:
        if  β v > κ 0  then
21:
            η v 2                           ▹ C 0 discontinuity
22:
        else if  β v > κ 1  then                    ▹ Note: κ 1 < β v κ 0
23:
            η v 1                           ▹ C 1 discontinuity
24:
        else
25:
            η v 0                  ▹ Filtered out as smooth or extremum
26:
        end if
27:
    else
28:
         η v 0                  ▹ Smooth region based on cell indicators
29:
    end if
30:
end for
31:
return   η
Online (Algorithm 1):
  • Line 1: α Of . Sparse matrix-vector multiplication. If O has N n z non-zeros, complexity is O ( N n z ) . Assuming N n z = O ( M ) (average non-zeros per row is constant), this is O ( M ) .
  • Lines 3–11 (Cell-based pre-filtering): Loop over M cells. Inside, computations are O ( 1 ) per cell (assuming stencil U σ size is O ( 1 ) for δ f , σ ). Total O ( M ) .
  • Lines 13–25 (Node-based indicators): Loop over N vertices. Let N m a r k e d be the number of vertices with M v = true . Inside the loop for marked vertices: compute α ¯ v and β v . This involves summing over cells S v incident to v. If average vertex valence is V a v g ( O ( 1 ) for typical meshes), this is O ( V a v g ) per marked node. Total O ( N m a r k e d · V a v g ) . In the worst case, N m a r k e d N , so O ( N ) .
Thus, the online complexity for detecting discontinuities for one function f is O ( M + N ) . For k f different functions on the same mesh, the OSUS operator is reused. The total online complexity becomes O ( k f ( M + N ) ) . The total complexity including one-time offline preprocessing is O ( N + M ) offline + O ( k f ( M + N ) ) online .

5. Numerical Results

In this section, we report several numerical experiments conducted with RDI, including comparisons on planes, evaluations on general surfaces with sharp features, and the use case of remapping nodal values between meshes for discontinuous functions. We implemented our algorithms in MATLAB and converted the code into C++ using MATLAB Coder. The numerical experiments were conducted using MATLAB R2022b on Linux. Since one of the key applications of RDI is remapping in climate modeling, which tends to employ various representations of the sphere, some of our experiments used spherical meshes. The primary focus of these experiments was to validate the accuracy and robustness of the indicators. Therefore, while we do not present detailed timing studies, we confirm that the observed performance of the online algorithm is consistent with the theoretical O ( M + N ) complexity derived in Section 4.4. This linear scaling ensures the method’s efficiency and practicality for large-scale applications. To facilitate reproducibility and future comparative studies, we have made the meshes used in this work publicly available on Zenodo [45]. For each experiment, specific mesh characteristics (e.g., number of vertices and cells) and RDI parameters ( κ 0 , κ 1 , C , C g ) will be provided or were set to the default values mentioned earlier.

5.1. Experimentation on Unit Spheres with Nonuniform Neshes

To evaluate our discontinuity indicators, we employed two piecewise smooth functions, “interacting waves” and “crossing waves,” which were previously used in [13]. The definitions of these functions are as follows:
f 1 θ , φ = 1 , if 0 θ < 5 π / 18 , 1.7 2.52 θ / π , if 5 π / 18 θ < π / 2 , 0.44 , if π / 2 θ < 13 π / 18 , 0.24 , if 13 π / 18 θ < 9 π / 10 , 0.12 , if 9 π / 10 θ π ,
and
f 2 θ , φ = 1000 + 2000 sign ( cos ( φ ) ) 1 / 2 , if 0 θ < π / 4 , 4 θ / π 1 / 2 , if π / 4 θ < π / 2 , 4 θ / π 1 / 2 , if π / 2 θ < 3 π / 4 , 1 , if 3 π / 4 θ < 7 π / 8 , 64 θ 2 / π 2 + 112 θ / π 48 , if 7 π / 8 θ π .
Note that f 1 has C 0 and C 1 discontinuities, whereas f 2 has C 0 , C 1 , and C 2 discontinuities. We chose these functions since the discontinuities have complex interacting patterns, allowing a more thorough evaluation of the robustness of the indicators. Figure 1 displays the color maps of the two functions on two regionally refined meshes. Specifically, f 1 is shown on the dual of a spherical centroidal Voronoi tessellations (SCVT) mesh [46], and f 2 is shown on a cubed-sphere mesh. The meshes in Figure 1 are relatively coarse. For ease of visualization, we intersect the sphere with planes and will depict the values on the intersection curves henceforth.
Figure 2 depicts the function values and β v values along the intersection curves on finer meshes, which have edge lengths of approximately one-fourth of those seen in Figure 1. We use N v and N c to denote the number of vertices and cells, respectively, in the meshes. It is evident that the β v values can effectively distinguish the discontinuities from the smooth regions. Figure 3 shows the nodes where η v 1 (i.e., β v > κ 1 = 0.5 , assuming κ 0 is larger). These nodes correspond to the regions with C 0 and C 1 discontinuities. For these tests, we used κ 1 = 0.5 , κ 0 = 1.5 , C = 0.4 , C g = 0.05 . Reducing κ 1 to a smaller value may allow for the identification of some C 2 discontinuities on coarse meshes but would also increase the risk of false positives.

5.2. Comparison with Polynomial Annihilation Edge Detection

We compare RDI with Polynomial Annihilation Edge Detector (PAED) [22,23]. Like RDI, PAED is designed to detect discontinuities in functions, primarily C 0 discontinuities in its original formulation [22] and extended to C 1 discontinuities by applying it to estimated derivatives [23]. PAED is based on polynomial annihilation and often uses limiters like the minmod limiter [47,48] to reduce oscillations when approximating jump functions or derivatives. Since PAED is typically formulated for 2D planar data, we conduct the comparison on planar domains.
First, we use two test functions, f 3 and f 4 , from [22], both of which contain only C 0 discontinuities. Specifically, the function f 3 is given by
f 3 ( x , y ) = x y + cos ( 2 π x 2 ) sin ( 2 π x 2 ) , if x 2 + y 2 1 4 , 10 x 5 + x y + cos ( 2 π x 2 ) sin ( 2 π x 2 ) , if x 2 + y 2 > 1 4 ,
for 1 x , y 1 , and f 4 is the gray level of the Shepp–Logan phantom [49].
For comparison with [22], we generated 16,384 random points on [ 1 , 1 ] × [ 1 , 1 ] . As RDI uses a mesh data structure for computing neighborhoods, we computed the Delaunay triangulation of these points when applying RDI. To visualize the detected discontinuities, we computed an approximation of the local jump function
δ f ( x ) = max y R ( x ) f ( y ) min y R ( x ) f ( y ) , if node x is marked by RDI ( i . e . , η x 1 ) , 0 , otherwise ,
where R ( x ) is the one-ring neighborhood of nodes connected to x (including x ) on the sampled mesh.
Figure 4 displays the results, which are visually similar to those for the PAED method shown in Figures 4.2 and 4.3 of [22]. Subplots (a) and (c) show the original functions f 3 and f 4 , where both height (z-axis) and color represent the function’s value. Subplots (b) and (d) visualize the output of our RDI method by plotting the local jump function δ f . In these plots, the non-zero regions trace the detected C 0 discontinuities. Both the height and the color of the resulting surfaces correspond to the magnitude of the local jump, accurately aligning with the true discontinuities in the original functions. For instance, the constant-height (and single-color) circular wall in (b) reflects the constant jump in f 3 , while the varying heights (and colors) in (d) correctly capture the different jump magnitudes in the Shepp–Logan phantom.
The detected discontinuities from PAED may appear thinner in some cases than those of RDI, partly because RDI uses larger stencils (two rings for the OSUS operator), which can slightly widen the detected region around a discontinuity. RDI parameters for this test were κ 1 = 0.3 and κ 0 = 1.0 .
A key feature of RDI is its ability to detect both C 0 and C 1 discontinuities in a single pass without prior derivative estimation. In [23], PAED was extended to detect C 1 discontinuities by first estimating the derivatives and then applying PAED to these derivative fields. To compare our method with [23], we use the test function f 5 from their work,
f 5 ( x , y ) = x 2 + y 2 1 2 + 1 12 sin 2 π x 2 + y 2 , if x 2 + y 2 < 1 2 , x 2 + y 2 1 2 + 1 12 sin 2 π x 2 + y 2 , if x 2 + y 2 1 2 ,
which has a C 1 discontinuity (a kink) along the circle x 2 + y 2 = 1 / 2 . We generated meshes over [ 1 , 1 ] × [ 1 , 1 ] of similar point counts as those in [23]. As shown in Figure 5, our RDI method detected the C 1 discontinuity along the circle with high fidelity and very few false positives. In contrast, the results reported for the two-pass PAED approach in [23] (see their Figure 8) exhibit numerous false positives scattered across the domain, particularly on the random grids. This comparison suggests that RDI’s direct, single-pass approach is more robust for detecting C 1 discontinuities, likely because it avoids a separate, potentially noise-sensitive derivative estimation step.

5.3. Generalization to Surfaces with Sharp Features

Our previous examples employed simple, smooth geometries, such as spheres and planes. We now consider surfaces with sharp features, which present additional complications. As discussed in Section 4.3 and detailed in [20], we virtually split the surface mesh into smooth patches along the feature curves and then employ one-sided stencils (by restricting stencils to the patch) along these sharp features. The virtual splitting helps to prevent many false positives and negatives, as demonstrated in Appendix B. To maintain stability, we increase the stencil sizes (e.g., to 3-rings) for WLS near the patch boundaries when computing the OSUS operator, as discussed in Section 4.3.
We carried out several experiments and displayed the results for functions f 6 and f 7 (defined below) on complex geometries. The functions are as follows:
f 6 ( x , y , z ) = tanh ( x ) sign ( y ) + tanh ( y ) sign ( z ) + tanh ( z ) sign ( x ) ,
and
f 7 ( x , y , z ) = ( max domain { x } min domain { x } ) g x min domain { x } max domain { x } min domain { x } ,
respectively, where max domain { x } and min domain { x } are taken over the coordinate range of the specific geometry, and
g ( s ) = s , if 0 s < 1 4 , 1 2 s , if 1 4 s < 1 2 , 3 4 , if 1 2 s < 3 4 , 16 ( s 3 4 ) 3 + 3 4 , if 3 4 s 1 .
Function f 6 has C 0 discontinuities along the planes y = 0 , z = 0 , x = 0 . Function f 7 has C 0 and C 1 discontinuities based on the x-coordinate.
Figure 6 and Figure 7 display the detected discontinuities on a cylinder and a reamer, respectively. It can be observed that RDI accurately detected the C 0 discontinuities. Some C 1 discontinuities might be missed if the quadratic WLS had minimal overshoots and undershoots for the given mesh resolution in the corresponding regions, leading to small α σ and subsequently small β v . Decreasing the threshold κ 1 would make RDI more sensitive to weaker C 1 discontinuities, although it may also introduce some false positives in regions of high smooth variation.

5.4. Application to Remap

The robust detection of discontinuities has a variety of applications. In this section, we demonstrate the use of RDI in remapping data between different meshes, also known as data remap or conservative interpolation. In this context, upon identifying C 0 and C 1 discontinuities using RDI, one can employ specialized numerical techniques, such as WLS-ENO remap [13,20] or CAAS [50], to resolve or limit across these discontinuities, thereby mitigating the Gibbs phenomena [4]. Figure 8 compares the remapping of f 2 (from Section 5.1) from a source SCVT mesh to a target cubed-sphere mesh using standard WLS interpolation versus a WLS-ENO scheme that utilizes RDI markers. The standard WLS, which does not distinguish smooth and discontinuous regions, suffers from oscillations near discontinuities. In contrast, WLS-ENO, guided by RDI to adjust its stencils and weights near detected discontinuities, effectively eliminated overshoots and undershoots while preserving accuracy in smooth regions.

6. Conclusions and Discussion

In this paper, we have introduced the Robust Discontinuity Indicators (RDI) method, a novel approach for the robust and efficient detection of discontinuities in approximating piecewise continuous functions over meshes. The RDI method distinguishes itself by accurately identifying both C 0 and C 1 discontinuities using node-based values, even in nonuniform meshes and complex surface geometries. Our approach leverages a combination of cell-based overshoot–undershoot indicators ( α σ ) and node-based oscillation indicators ( β v ), processed through a dual-thresholding strategy, ensuring robustness while minimizing false positives. The theoretical foundation provided by our rigorous analysis of WLS and linear interpolation behavior near discontinuities, coupled with extensive numerical experiments, demonstrates that RDI achieves high accuracy in discontinuity detection and maintains computational efficiency across a wide range of scenarios. The ability to precompute the main OSUS operator makes RDI particularly efficient for applications involving multiple functions on a fixed mesh.
Despite the promising results obtained, there are avenues for further enhancement. One potential improvement could involve incorporating a thinning process post-detection to refine the boundaries of the detected discontinuities. Extending the RDI method to three-dimensional volumetric meshes could broaden its applicability. Further investigation into the adaptive determination of the thresholds ( κ 0 , κ 1 , C , C g ) could also improve robustness across a wider range of functions and meshes without manual tuning.
Beyond these direct improvements, our work opens up several avenues for future research. One direction is to reconstruct topologically correct discontinuity curves from the discrete points identified by RDI, a challenge relevant to applications in geometric modeling [51]. Another avenue is adapting RDI’s principles for 1D event detection in ODEs and DAEs. Such a tool would complement existing methods [8] and is critical because improper regularization can alter the qualitative dynamics of piecewise-smooth (PWS) systems, such as their limit cycles [7,52].

Author Contributions

Conceptualization, Y.L. and X.J.; methodology, Y.L. and Q.C.; software, Y.L. and Q.C.; validation, Y.L.; formal analysis, Y.L.; investigation, Y.L.; data curation, Y.L.; writing—original draft preparation, Y.L.; writing—review and editing, Q.C. and X.J.; visualization, Y.L.; supervision, X.J.; project administration, X.J.; funding acquisition, X.J. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported under the Scientific Discovery through Advanced Computing (SciDAC) program in the US Department of Energy’s Office of Science, Office of Advanced Scientific Computing Research through subcontract #462974 with Los Alamos National Laboratory.

Data Availability Statement

The meshes used in this work are available on Zenodo [45].

Acknowledgments

We thank the anonymous reviewers for their constructive comments and suggestions, which helped improve the quality of this paper. Generative AI models were used in correcting grammar and improving the readability of the paper, but all the ideas and the mathematical proofs were developed by the authors.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Oscillatory Properties of Alpha_Sigma near Local Extremes

To derive more accurate indicators, we need a more precise estimation of α σ ’s behavior in smooth regions, particularly near local extrema. In the following, we first derive the theory for a triangular mesh in R 2 and then discuss its generalization to smooth surfaces.
Proposition A1. 
Given a sufficiently fine triangulation over Ω R 2 , in the C 2 regions of a piecewise smooth function f, the cell-based indicator α σ computed over a cell σ using the WALF scheme (as defined in Section 3.4) is negative near a local minimum of f and positive near a local maximum of f.
Proof. 
Consider a function f : R 2 R defined on a plane. For a triangular cell σ = v 1 v 2 v 3 within a C 2 region of f, its center is x c ( σ ) = ( v 1 + v 2 + v 3 ) / 3 . From (8), α σ = g σ , 2 g σ , 1 . Here, g σ , 1 = 1 3 i = 1 3 f ( v i ) and g σ , 2 = 1 3 i = 1 3 g i ( x c ( σ ) ) , where g i is the quadratic WLS approximation centered at v i . Thus,
α σ = 1 3 i = 1 3 g i ( x c ( σ ) ) 1 3 i = 1 3 f ( v i ) = 1 3 i = 1 3 ( g i ( x c ( σ ) ) f ( x c ( σ ) ) ) + f ( x c ( σ ) ) 1 3 i = 1 3 f ( v i ) .
From Lemma 1, for f C 2 , each g i ( x c ( σ ) ) f ( x c ( σ ) ) = O ( h 2 ) (as discussed in the proof of Proposition 1). So the sum 1 3 i = 1 3 ( g i ( x c ( σ ) ) f ( x c ( σ ) ) ) = O ( h 2 ) . Thus,
α σ = f ( x c ( σ ) ) 1 3 i = 1 3 f ( v i ) + O ( h 2 ) .
Let v 1 be the origin for local Taylor expansions. Let e 1 = v 2 v 1 and e 2 = v 3 v 1 . Then v 2 = v 1 + e 1 , v 3 = v 1 + e 2 , and x c ( σ ) = v 1 + ( e 1 + e 2 ) / 3 . Expanding f around v 1 (since f C 2 in this region), f ( v 1 + h ) = f ( v 1 ) + h T f ( v 1 ) + 1 2 h T H f ( v 1 ) h + R f ( h ) , where R f ( h ) = o ( h 2 ) as h 0 .
f ( v 2 ) = f ( v 1 ) + e 1 T f + 1 2 e 1 T H f e 1 + R f ( e 1 ) f ( v 3 ) = f ( v 1 ) + e 2 T f + 1 2 e 2 T H f e 2 + R f ( e 2 ) f ( x c ( σ ) ) = f ( v 1 ) + 1 3 ( e 1 + e 2 ) T f + 1 18 ( e 1 + e 2 ) T H f ( e 1 + e 2 ) + R f ( ( e 1 + e 2 ) / 3 )
Substituting these into (A1), the f terms cancel. The combination of R f terms will be o ( h 2 ) . The H f terms yield the dominant part of f ( x c ( σ ) ) 1 3 f ( v i ) :
1 18 ( e 1 + e 2 ) T H f ( e 1 + e 2 ) 1 6 ( e 1 T H f e 1 + e 2 T H f e 2 ) = 1 18 e 1 T H f e 1 + ( v 3 v 2 ) T H f ( v 3 v 2 ) + ( v 1 v 3 ) T H f ( v 1 v 3 ) .
This term is O ( h 2 ) . Thus, α σ = 1 18 edges e i j e i j T H f e i j + O ( h 2 ) + o ( h 2 ) , where the O ( h 2 ) term represents the WLS approximation error and the o ( h 2 ) term represents the Taylor series remainder. The term e T H f e is positive if H f is positive definite (local minimum) and negative if H f is negative definite (local maximum). Thus, if H f is positive definite (near a local minimum), the sum is positive, making α σ negative. If H f is negative definite (near a local maximum), the sum is negative, making α σ positive. This holds provided h is sufficiently small so that this O ( h 2 ) Hessian-derived term determines the sign, which is expected near non-degenerate extrema where H f is definite and its entries are not excessively small compared to constants hidden in other O ( h 2 ) terms. The Hessian H f is evaluated at v 1 (or more accurately, at some point within σ ). □
This proposition holds for general m-gons as well, and it can be extended to smooth surfaces by considering the function behavior on the local tangent plane, as the out-of-plane error is of higher order. This property of α σ having consistent signs near local extrema is key to how the β v indicator (Section 4.1) distinguishes these smooth features from discontinuities where α σ tends to oscillate.

Appendix B. The Effect of Virtual Splitting Along Sharp Features

A general surface might have geometric discontinuities, such as features (creases) and ridge points. Applying RDI directly across such geometric discontinuities might yield the inaccurate detection of numerical discontinuities in the function f. Specifically, a function f that is smooth in the ambient Euclidean space could be misclassified as having a C 1 discontinuity when evaluated on the surface if its behavior across the geometric feature mimics a kink. Conversely, a function with a genuine C 1 discontinuity that coincides with the geometric discontinuity might be mistaken as smooth if the geometric effect masks the functional one.
To illustrate these two cases, let us first consider two functions f A ( x , y , z ) = g A ( x , y , z , 0.5 ) and f B ( x , y , z ) = g A ( x , y , z , 1 ) on a curve Γ ( t ) = ( t , g B ( t ) , t ) for t R , where
g A ( x , y , z , a ) = a + 3 2 ( y a ) , z > a , x , z a ,
and
g B ( t ) = 1 + 1 2 ( t 1 ) , t > 1 , t , t 1 .
The curve Γ ( t ) has a geometric C 1 discontinuity (a kink in its tangent) at t = 1 (where x = z = 1 , y = 1 ). The function g A has a C 1 discontinuity in its definition with respect to y and x across the plane z = a . Consider f A ( t ) = g A ( Γ ( t ) , 0.5 ) . The plane z = 0.5 (i.e., t = 0.5 ) is a point where g B ( t ) = t = 0.5 , which is smooth for Γ ( t ) . So f A ( t ) has a C 1 discontinuity at t = 0.5 . Consider f B ( t ) = g A ( Γ ( t ) , 1.0 ) . The plane z = 1.0 (i.e., t = 1.0 ) is where Γ ( t ) has its geometric kink. If RDI is applied without considering the geometric kink (i.e., stencils cross t = 1 freely), for f A , the geometric kink at t = 1 might be falsely detected as a C 1 discontinuity in f A if f A varies smoothly across t = 1 . For f B , the C 1 discontinuity in f B at t = 1 might be confused with or masked by the geometric kink. Virtual splitting separates the curve at t = 1 into two pieces, allowing RDI to analyze f B on each piece up to the boundary, correctly identifying the jump in derivatives if one-sided limits are considered.
Figure A1. α σ and β v values for f A on a discretization of Γ ( t ) . The black line is f A ( t ) . In (a), the red dash line is α σ . In (b), the blue dashed line is β v . Without virtual splitting, the geometric kink at t = 1 might cause large β v even if f A is smooth there, while the true C 1 kink at t = 0.5 is sought.
Figure A1. α σ and β v values for f A on a discretization of Γ ( t ) . The black line is f A ( t ) . In (a), the red dash line is α σ . In (b), the blue dashed line is β v . Without virtual splitting, the geometric kink at t = 1 might cause large β v even if f A is smooth there, while the true C 1 kink at t = 0.5 is sought.
Mathematics 13 02442 g0a1
Figure A1 shows that RDI without virtual splitting can detect the C 1 discontinuity at t = 0.5 . However, it might also erroneously classify the region near the geometric kink at t = 1 as a C 1 discontinuity in f A . Figure A2 illustrates that for f B , where the function discontinuity coincides with the geometric kink at t = 1 , RDI without virtual splitting might yield ambiguous β v values (e.g., β v 0 if the WLS fit is poor due to geometry, or large if it captures the combined effect). With virtual splitting, the analysis would be one-sided up to t = 1 , potentially revealing the C 1 jump more clearly.
Similar misclassifications can also occur on surface meshes without virtual splitting. For instance, Figure A3 illustrates RDI applied to a simple smooth function f smooth ( x , y , z ) = z + 2 on the triangulation of a cylinder. The function f smooth is constant on the two bases (if aligned with z-axis) and linear on the lateral surface. RDI with virtual splitting (separating bases from lateral surface) would correctly produce η v = 0 everywhere. In contrast, RDI without virtual splitting might yield false positives (e.g., η v = 1 ) near the sharp circular edges where bases meet the lateral surface, due to WLS stencils crossing these geometric C 1 discontinuities.
Figure A2. α σ and β v values for f B on a discretization of Γ ( t ) . The black line is f B ( t ) . In (a), the red dash line is α σ . In (b), the blue dashed line is β v . The function discontinuity at t = 1 coincides with the geometric kink.
Figure A2. α σ and β v values for f B on a discretization of Γ ( t ) . The black line is f B ( t ) . In (a), the red dash line is α σ . In (b), the blue dashed line is β v . The function discontinuity at t = 1 coincides with the geometric kink.
Mathematics 13 02442 g0a2
Figure A3. Function value (left) of f smooth ( x , y , z ) = z + 2 on a cylinder ( N v = 20,177, N c = 39,788). Numerical discontinuities (right, red regions) detected by RDI without virtual splitting, showing potential false positives along the cylinder edges. With virtual splitting, these false positives would be avoided.
Figure A3. Function value (left) of f smooth ( x , y , z ) = z + 2 on a cylinder ( N v = 20,177, N c = 39,788). Numerical discontinuities (right, red regions) detected by RDI without virtual splitting, showing potential false positives along the cylinder edges. With virtual splitting, these false positives would be avoided.
Mathematics 13 02442 g0a3

References

  1. Hesthaven, J.S.; Warburton, T. Nodal Discontinuous Galerkin Methods; Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar]
  2. Botsch, M.; Kobbelt, L.; Pauly, M.; Alliez, P.; Lévy, B. Polygon Mesh Processing; CRC Press: Boca Raton, FL, USA, 2010. [Google Scholar]
  3. LeVeque, R.J. Finite Volume Methods for Hyperbolic Problems; Cambridge University Press: Cambridge, UK, 2002. [Google Scholar]
  4. Gottlieb, D.; Shu, C.W. On the Gibbs phenomenon and its resolution. SIAM Rev. 1997, 39, 644–668. [Google Scholar] [CrossRef]
  5. Shu, C.W. High order ENO and WENO schemes for computational fluid dynamics. In High-Order Methods for Computational Physics; Springer: Berlin/Heidelberg, Germany, 1999; pp. 439–582. [Google Scholar]
  6. Liu, X.D.; Osher, S.; Chan, T. Weighted essentially non-oscillatory schemes. J. Comput. Phys. 1994, 115, 200–212. [Google Scholar] [CrossRef]
  7. Dieci, L.; Guglielmi, N. Regularizing Piecewise Smooth Differential Systems: Co-Dimension Discontinuity Surface. J. Dyn. Differ. Equ. 2013, 25, 71–94. [Google Scholar] [CrossRef]
  8. Lopez, L.; Maset, S. Numerical event location techniques in discontinuous differential algebraic equations. Appl. Numer. Math. 2022, 178, 98–122. [Google Scholar] [CrossRef]
  9. Harten, A. ENO schemes with subcell resolution. J. Comput. Phys. 1989, 83, 148–184. [Google Scholar] [CrossRef]
  10. Jiang, G.S.; Peng, D. Weighted ENO Schemes for Hamilton–Jacobi Equations. SIAM J. Sci. Comput. 2000, 21, 2126–2143. [Google Scholar] [CrossRef]
  11. Amat, S.; Ruiz, J. New WENO Smoothness Indicators Computationally Efficient in the Presence of Corner Discontinuities. J. Sci. Comput. 2017, 71, 1265–1302. [Google Scholar] [CrossRef]
  12. Liu, H.; Jiao, X. WLS-ENO: Weighted-least-squares based essentially non-oscillatory schemes for finite volume methods on unstructured meshes. J. Comput. Phys. 2016, 314, 749–773. [Google Scholar] [CrossRef]
  13. Li, Y.; Chen, Q.; Wang, X.; Jiao, X. WLS-ENO remap: Superconvergent and non-oscillatory weighted least squares data transfer on surfaces. J. Comput. Phys. 2020, 417, 109578. [Google Scholar] [CrossRef]
  14. Tadmor, E. Filters, mollifiers and the computation of the Gibbs phenomenon. Acta Numer. 2007, 16, 305–378. [Google Scholar] [CrossRef]
  15. Cates, D.; Gelb, A. Detecting derivative discontinuity locations in piecewise continuous functions from Fourier spectral data. Numer. Algo. 2007, 46, 59–84. [Google Scholar] [CrossRef]
  16. Hewitt, E.; Hewitt, R.E. The Gibbs-Wilbraham phenomenon: An episode in Fourier analysis. Arch. Hist. Exact Sci. 1979, 21, 129–160. [Google Scholar] [CrossRef]
  17. Bozzini, M.; Rossini, M. The detection and recovery of discontinuity curves from scattered data. J. Comput. Appl. Math. 2013, 240, 148–162. [Google Scholar] [CrossRef]
  18. de Silanes, M.C.L.; Parra, M.C.; Torrens, J.J. Vertical and oblique fault detection in explicit surfaces. J. Comput. Appl. Math. 2002, 140, 559–585. [Google Scholar] [CrossRef]
  19. Moura, R.C.; Cassinelli, A.; da Silva, A.F.; Burman, E.; Sherwin, S.J. Gradient jump penalty stabilisation of spectral/hp element discretisation for under-resolved turbulence simulations. Comput. Methods Appl. Mech. Eng. 2022, 388, 114200. [Google Scholar] [CrossRef]
  20. Li, Y.; Zhao, X.; Ray, N.; Jiao, X. Compact feature-aware Hermite-style high-order surface reconstruction. Engrg. Comput. 2021, 37, 187–210. [Google Scholar] [CrossRef]
  21. Shrivakshan, G.T. A comparison of various edge detection techniques used in image processing. Int. J. Comput. Sci. Issues 2012, 9, 269. [Google Scholar]
  22. Archibald, R.; Gelb, A.; Yoon, J. Polynomial fitting for edge detection in irregularly sampled signals and images. SIAM J. Numer. Ana. 2005, 43, 259–279. [Google Scholar] [CrossRef]
  23. Saxena, R.; Gelb, A.; Mittelmann, H. A high order method for determining the edges in the gradient of a function. Comm. Comput. Phys. 2009, 5, 694–711. [Google Scholar]
  24. Archibald, R.; Gelb, A.; Yoon, J. Determining the locations and discontinuities in the derivatives of functions. Appl. Numer. Math. 2008, 58, 577–592. [Google Scholar] [CrossRef]
  25. Glaubitz, J.; Gelb, A. High Order Edge Sensors with 1 Regularization for Enhanced Discontinuous Galerkin Methods. SIAM J. Sci. Comput. 2019, 41, A1304–A1330. [Google Scholar] [CrossRef]
  26. Marr, D.; Hildreth, E. Theory of edge detection. Proc. Roy. Soc. Lond. 1980, 207, 187–217. [Google Scholar]
  27. Marr, D. Early processing of visual information. Philos. Trans. R. Soc. Lond. B Biol. Sci. 1976, 275, 483–519. [Google Scholar]
  28. Marr, D.; Ullman, S.; Poggio, T. Bandpass channels, zero-crossings, and early visual information processing. J. Opt. Soc. Am. 1979, 69, 914–916. [Google Scholar] [CrossRef]
  29. Mallat, S.; Hwang, W.L. Singularity detection and processing with wavelets. IEEE Trans. Inf. Theory 1992, 38, 617–643. [Google Scholar] [CrossRef]
  30. Rossini, M. Interpolating functions with gradient discontinuities via Variably Scaled Kernels. Dolomites Res. Notes Approx. 2018, 11, 3–14. [Google Scholar]
  31. De Marchi, S.; Marchetti, F.; Perracchione, E.; Poggiali, D. Polynomial interpolation via mapped bases without resampling. J. Comput. Appl. Math. 2020, 364, 112347. [Google Scholar] [CrossRef]
  32. Gelb, A.; Tadmor, E. Detection of edges in spectral data. Appl. Comput. Harmon. Anal. 1999, 7, 101–135. [Google Scholar] [CrossRef]
  33. Gelb, A.; Tadmor, E. Detection of edges in spectral data II. Nonlinear enhancement. SIAM J. Numer. Anal. 2000, 38, 1389–1408. [Google Scholar] [CrossRef]
  34. Jiao, X.; Zha, H. Consistent computation of first- and second-order differential quantities for surface meshes. In Proceedings of the ACM Solid and Physical Modeling Symposium, Stony Brook, NY, USA, 2–4 June 2008; pp. 159–170. [Google Scholar]
  35. Buhmann, M.D. Radial Basis Functions: Theory and Implementations; Cambridge University Press: Cambridge, UK, 2003; Volume 12. [Google Scholar]
  36. Hu, C.; Shu, C.W. Weighted essentially non-oscillatory schemes on triangular meshes. J. Comput. Phys. 1999, 150, 97–127. [Google Scholar] [CrossRef]
  37. Shi, J.; Hu, C.; Shu, C.W. A technique of treating negative weights in WENO schemes. J. Comput. Phys. 2002, 175, 108–127. [Google Scholar] [CrossRef]
  38. Xu, Z.; Liu, Y.; Du, H.; Lin, G.; Shu, C.W. Point-wise hierarchical reconstruction for discontinuous Galerkin and finite volume methods for solving conservation laws. J. Comput. Phys. 2011, 230, 6843–6865. [Google Scholar] [CrossRef]
  39. Zhang, Y.T.; Shu, C.W. Third order WENO scheme on three dimensional tetrahedral meshes. Comm. Comput. Phys. 2009, 5, 836–848. [Google Scholar]
  40. Liu, Y.; Zhang, Y.T. A robust reconstruction for unstructured WENO schemes. J. Sci. Comput. 2013, 54, 603–621. [Google Scholar] [CrossRef]
  41. Jiao, X.; Wang, D. Reconstructing high-order surfaces for meshing. Engrg. Comput. 2012, 28, 361–373. [Google Scholar] [CrossRef]
  42. Ray, N.; Wang, D.; Jiao, X.; Glimm, J. High-Order Numerical Integration over Discrete Surfaces. SIAM J. Numer. Anal. 2012, 50, 3061–3083. [Google Scholar] [CrossRef]
  43. Buhmann, M. A new class of radial basis functions with compact support. Math. Comput. 2001, 70, 307–318. [Google Scholar] [CrossRef]
  44. Dyedov, V.; Ray, N.; Einstein, D.; Jiao, X.; Tautges, T. AHF: Array-Based Half-Facet Data Structure for Mixed-Dimensional and Non-manifold Meshes. In Proceedings of the 22nd International Meshing Roundtable, Orlando, FL, USA, 13–16 October 2013; Sarrate, J., Staten, M., Eds.; Springer International Publishing: Berlin/Heidelberg, Germany, 2014; pp. 445–464. [Google Scholar]
  45. Li, Y.; Jiao, X. Mesh used for Robust Discontinuity Indicators workflows. arXiv 2024, arXiv:2308.02235. [Google Scholar]
  46. Ju, L.; Ringler, T.; Gunzburger, M. Voronoi tessellations and their application to climate and global modeling. In Numerical Techniques for Global Atmospheric Models; Springer: Berlin/Heidelberg, Germany, 2011; pp. 313–342. [Google Scholar]
  47. Roe, P.L.; Baines, M.J. Algorithms for advection and shock problems. In Proceedings of the 4th Conference on Numerical Methods in Fluid Mechanics, Paris, France, 7–9 October 1981; pp. 281–290, Conference held in 1981, proceedings published in 1982. [Google Scholar]
  48. Gelb, A.; Tadmor, E. Adaptive edge detectors for piecewise smooth data based on the minmod limiter. J. Sci. Comput. 2006, 28, 279–306. [Google Scholar] [CrossRef]
  49. Shepp, L.A.; Logan, B.F. The Fourier reconstruction of a head section. IEEE Trans. Nucl. Sci. 1974, 21, 21–43. [Google Scholar] [CrossRef]
  50. Bradley, A.M.; Bosler, P.A.; Guba, O.; Taylor, M.A.; Barnett, G.A. Communication-efficient property preservation in tracer transport. SIAM J. Sci. Comput. 2019, 41, C161–C193. [Google Scholar] [CrossRef]
  51. Difonzo, F.V. Isochronous attainable manifolds for piecewise smooth dynamical systems. Qual. Theory Dyn. Syst. 2022, 21, 6. [Google Scholar] [CrossRef]
  52. Pi, D. Limit cycles for regularized piecewise smooth systems with a switching manifold of codimension two. Discret. Contin. Dyn. Syst. Ser. B 2019, 24, 881–905. [Google Scholar] [CrossRef]
Figure 1. Function values on coarse regionally refined meshes and the intersection planes. (a) f 1 on the dual of a coarse regionally refined SCVT ( N v = 31,936, N c = 15,970) with the intersection plane x + y = 0 . (b) f 2 on a coarse regionally refined cubed-sphere ( N v = 15,860, N c = 15,858) with the intersection plane y 2 x = 0 .
Figure 1. Function values on coarse regionally refined meshes and the intersection planes. (a) f 1 on the dual of a coarse regionally refined SCVT ( N v = 31,936, N c = 15,970) with the intersection plane x + y = 0 . (b) f 2 on a coarse regionally refined cubed-sphere ( N v = 15,860, N c = 15,858) with the intersection plane y 2 x = 0 .
Mathematics 13 02442 g001
Figure 2. Functions f 1 and f 2 along with their corresponding β v values along the cross section of finer regionally refined meshes (SCVT: N v = 135,768, N c = 67,886; cubed-sphere: N v = 247,330, N c = 247,328) with intersection planes.
Figure 2. Functions f 1 and f 2 along with their corresponding β v values along the cross section of finer regionally refined meshes (SCVT: N v = 135,768, N c = 67,886; cubed-sphere: N v = 247,330, N c = 247,328) with intersection planes.
Mathematics 13 02442 g002
Figure 3. Detected discontinuity cells (cells incident to nodes with η v 1 , shown in red) on regionally refined meshes. (a) Detected discontinuity cells of f 1 on level-3 regionally refined SCVT ( N v = 135,768, N c = 67,886). (b) Detected discontinuity cells of f 2 on level-3 regionally refined cubed-sphere mesh ( N v = 247,330, N c = 247,328).
Figure 3. Detected discontinuity cells (cells incident to nodes with η v 1 , shown in red) on regionally refined meshes. (a) Detected discontinuity cells of f 1 on level-3 regionally refined SCVT ( N v = 135,768, N c = 67,886). (b) Detected discontinuity cells of f 2 on level-3 regionally refined cubed-sphere mesh ( N v = 247,330, N c = 247,328).
Mathematics 13 02442 g003
Figure 4. Original functions (a) f 3 and (c) f 4 , and their approximated local jump functions (b,d) based on RDI detection (on Delaunay triangulation of 16,384 random points), respectively.
Figure 4. Original functions (a) f 3 and (c) f 4 , and their approximated local jump functions (b,d) based on RDI detection (on Delaunay triangulation of 16,384 random points), respectively.
Mathematics 13 02442 g004
Figure 5. Detection of the C 1 discontinuity in f 5 using the RDI method on the Delaunay triangulation of two different random point sets. The method cleanly identifies the circular discontinuity with very few false positives.
Figure 5. Detection of the C 1 discontinuity in f 5 using the RDI method on the Delaunay triangulation of two different random point sets. The method cleanly identifies the circular discontinuity with very few false positives.
Mathematics 13 02442 g005
Figure 6. Function values and numerical discontinuities (red regions indicate η v 1 ) detected by RDI with virtual splitting on the surface triangulations of a cylinder ( N v = 20,177, N c = 39,788).
Figure 6. Function values and numerical discontinuities (red regions indicate η v 1 ) detected by RDI with virtual splitting on the surface triangulations of a cylinder ( N v = 20,177, N c = 39,788).
Mathematics 13 02442 g006
Figure 7. Function values and numerical discontinuities (red regions indicate η v 1 ) detected by RDI with virtual splitting on the surface triangulation of a reamer ( N v = 19,515, N c = 33,246).
Figure 7. Function values and numerical discontinuities (red regions indicate η v 1 ) detected by RDI with virtual splitting on the surface triangulation of a reamer ( N v = 19,515, N c = 33,246).
Mathematics 13 02442 g007
Figure 8. Comparison between standard WLS interpolation and WLS-ENO (using RDI) for remapping f 2 . (a) f 2 on the source mesh. (b) Function profiles along a cross-section of the target mesh: exact solution (black), standard WLS remapped (blue, oscillatory), and WLS-ENO with RDI remapped (red, non-oscillatory).
Figure 8. Comparison between standard WLS interpolation and WLS-ENO (using RDI) for remapping f 2 . (a) f 2 on the source mesh. (b) Function profiles along a cross-section of the target mesh: exact solution (black), standard WLS remapped (blue, oscillatory), and WLS-ENO with RDI remapped (red, non-oscillatory).
Mathematics 13 02442 g008
Table 1. Asymptotic behavior of the cell-based indicator | α σ | versus the threshold τ σ . These are theoretical estimates based on Propositions 1 and 2, assuming h , σ = O ( h ) for quasi-uniform meshes. The table illustrates how τ σ is designed to separate different function behaviors. For example, in smooth regions, | α σ | O ( h 2 ) , while τ σ (driven by the global term or local term if δ f , σ h ) is O ( h 1.5 ) . Since h 2 < h 1.5 for small h, smooth cells are typically not marked. Conversely, near  C 0 discontinuities, | α σ | O ( 1 ) , while τ σ (driven by the local term if δ f , σ 1 ) is O ( h 0.5 ) . Since 1 > h 0.5 for small h, these cells are marked.
Table 1. Asymptotic behavior of the cell-based indicator | α σ | versus the threshold τ σ . These are theoretical estimates based on Propositions 1 and 2, assuming h , σ = O ( h ) for quasi-uniform meshes. The table illustrates how τ σ is designed to separate different function behaviors. For example, in smooth regions, | α σ | O ( h 2 ) , while τ σ (driven by the global term or local term if δ f , σ h ) is O ( h 1.5 ) . Since h 2 < h 1.5 for small h, smooth cells are typically not marked. Conversely, near  C 0 discontinuities, | α σ | O ( 1 ) , while τ σ (driven by the local term if δ f , σ 1 ) is O ( h 0.5 ) . Since 1 > h 0.5 for small h, these cells are marked.
Region Type | α σ | Dominant τ σ Local Term BehaviorGlobal Term
Smooth O ( h 2 ) O ( h 1.5 ) δ f , σ h O ( h 1.5 )
δ f , σ h 2 O ( h 2.5 )
O ( h 1.5 )
Near C 1 disc. O ( h ) O ( h 1.5 ) or
O ( h 0.5 )
δ f , σ h O ( h 1.5 )
δ f , σ 1 O ( h 0.5 )
O ( h 1.5 )
Near C 0 disc. O ( 1 ) O ( h 0.5 ) δ f , σ 1 O ( h 0.5 ) O ( h 1.5 )
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, Y.; Chen, Q.; Jiao, X. Robust Discontinuity Indicators for High-Order Reconstruction of Piecewise Smooth Functions. Mathematics 2025, 13, 2442. https://doi.org/10.3390/math13152442

AMA Style

Li Y, Chen Q, Jiao X. Robust Discontinuity Indicators for High-Order Reconstruction of Piecewise Smooth Functions. Mathematics. 2025; 13(15):2442. https://doi.org/10.3390/math13152442

Chicago/Turabian Style

Li, Yipeng, Qiao Chen, and Xiangmin Jiao. 2025. "Robust Discontinuity Indicators for High-Order Reconstruction of Piecewise Smooth Functions" Mathematics 13, no. 15: 2442. https://doi.org/10.3390/math13152442

APA Style

Li, Y., Chen, Q., & Jiao, X. (2025). Robust Discontinuity Indicators for High-Order Reconstruction of Piecewise Smooth Functions. Mathematics, 13(15), 2442. https://doi.org/10.3390/math13152442

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop