Keywords

1 Introduction

A remapping scheme for Arbitrary Lagrangian Eulerian(ALE) methods often requires intersections between the old and new mesh [1, 2]. The aim of this paper is to articulate the mathematical formulation of this problem. For admissible quadrilateral meshes of the same connectivity, we show that the mesh intersection problem can be reduced to a local problem that how an edge intersects with a local frame which consists of 7 edges. According to our classification on the types of intersections, An optimal algorithm to compute these intersections can be applied [3, 4]. The overlap area between the new and old mesh, and the union of the fluxing/swept area can be traveled in \(\mathcal {O}(n)\) time (Theorem 1), where n is the number of elements in the underlying mesh or tessellation. When there is non degeneracy of the overlapped region, the present approach only requires 34 programming cases (17 when considering symmetry), while the classical Cell Intersection Based Donor Cell CIB/DC approach requires 98 programming cases [5, 6]. When consider degeneracy, more benefit can be obtained. The degeneracy of the intersection depends on the so called singular intersection points and impacts the computational complexity. As far as we known this is the first result on how the computational complexity depends on the underlying problem.

2 Preliminary

A tessellation \(\mathcal {T}=\{T_j\}_{j=1}^n\) of a domain \(\varOmega \) is a partition of \(\varOmega \) such that \(\bar{\varOmega } =\cup _{i=1}^N T_i\) and \(\dot{T}_i \cap \dot{T}_j =\emptyset \), where \(\dot{T}_i\) is the interior of the cell \(T_j\) and \(\bar{\varOmega }\) is the closure of \(\varOmega \). An admissible tessellation has no hanging node on any edge of the tessellation. Precisely, \(T_i \) and \(T_j\) can only share a common vertex or a common edge. We use the conversional notation as follows:

  • \(P_{i,j}\), for \(i=1:M, j=1:N\) are the vertices;

  • \(F_{i+ \frac{1}{2},j }\) for \(i=1:M-1,j=1:N\) and \(F_{i, j+\frac{1}{2}}\) for \(i=1:M,j=1:N-1\) are the edges between vertices \(P_{i,j}\) and \(P_{i+1,j}\);

  • \(C_{i+\frac{1}{2},j+\frac{1}{2}}\) stands for the quadrilateral cell \(P_{i,j} P_{i,j+1} P_{i+1,j+1}P_{i,j+1}\) for \(1\le i \le M-1\) and \(1\le j \le N+1\). \(C_{i+\frac{1}{2},j+\frac{1}{2}}\) is an element of \(\mathcal {T}\), we denote it as \(T_{i,j}\);

  • \(x_i(t)\) is the piecewise curve which consists all the face of \(F_{i,j+\frac{1}{2}}\) for \(j=1:N-1\),

    \(y_j(t)\) is the piece wise curve which consists all the faces of \(F_{i+\frac{1}{2},j}\) for \(i=1:M-1\).

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible quadrilateral meshes. The vertices of \(\mathcal {T}^a\) and \(\mathcal {T}^b\) are denoted as \(P_{i,j}\) and \(Q_{i,j}\) respectively, if there is a one-to-one map between \(P_{i,j}\) and \(Q_{i,j}\), then the two tessellations share the same logical structure or connectivity. We assume the two admissible meshes of the connectivity \(\mathcal {T}^a\) and \(\mathcal {T}^b\) have the following property:

  1. A1.

    Vertex \(Q_{i,j}\) of \(\mathcal {T}^b\) can only lie in the interior of the union of the cells \(C^a_{i\pm \frac{1}{2},j\pm \frac{1}{2} }\) of \(\mathcal {T}^a\).

  2. A2.

    Curve \(x_i^b(t)\) has at most one intersection point with \(y_j^a(t)\), so does for \(y_j^b(t)\) and \(x^a_i(t)\).

  3. A3.

    The intersection of edges between the old and new meshes lies in the middle of the two edges.

For convenience, we also introduce the following notation and definition.

Definition 1

A local patch \(l\mathcal {P}_{i,j}\) of an admissible quadrilateral mesh consists an element \( T_{i,j}\) and its neighbours in \(\mathcal {T}\). Take an interior element of \(T_{i,j}\) as an example,

$$\begin{aligned} l\mathcal {P}_{i,j}:=\{ T_{i,j}, T_{i\pm 1,j}, T_{i,j\pm 1}, T_{i\pm 1,j\pm 1} \}. \end{aligned}$$
(1)

The index set of \(l\mathcal {P}_{i,j}\) are denoted by \( \mathcal {J}_{i,j}=\{ (k,s): T_{k,s} \in l\mathcal {P}_{i,j} \}. \)

Definition 2

An invading set of the element \(T_{i,j}^b\) with respect to the local patch \(l\mathcal {P}^a_{i,j}\) is defined as \( \mathcal {I}_{i,j}^b=(T^b_{i,j} \cap l\mathcal {P}^a_{i,j}) \backslash (T^b_{i,j}\cap T^a_{i,j}). \) An occupied set of the element \(T^a_{i,j}\) with respect to the local patch \(l\mathcal {P}^b_{i,j}\) is defined as \( \mathcal {O}_{i,j}^a=(T^a_{i,j} \cap l\mathcal {P}^b_{i,j}) \backslash (T^a_{i,j}\cap T^b_{i,j}). \)

Definition 3

A swept area or fluxing area is the area which is enclosed by a quadrilateral polygon with an edge in \(\mathcal {T}^a\) and its counterpart edge in \(\mathcal {T}^b\). For example, the swept area enclosed by the quadrilateral polygon with edges \(F^a_{i+\frac{1}{2},j}\) and \(F^b_{i+\frac{1}{2},j}\) are denoted as \(\partial F_{i+\frac{1}{2},j}\). \(\partial ^{b+} F_{k,s}\) stands for boundary of the fluxing/swept area \(\partial F_{k,s}\) is ordered such that direction of edges of the cell \(T^b_{i,j}\) are counterclockwise in the cell \(T^b_{i,j}\). Precisely

$$\begin{aligned} \partial ^{b+}F_{i+\frac{1}{2},j}&=Q_{i,j}Q_{i,j+1}P_{i,j+1}P_{i,j},&\partial ^{b+} F_{i+1, j+\frac{1}{2}}&=Q_{i+1,j}Q_{i+1,j+1}P_{i+1,j+1}P_{i+1,j}, \\ \partial ^{b+} F_{i, j+\frac{1}{2}}&=Q_{i,j+1}Q_{i,j}P_{i,j}P_{i,j+1},&\partial ^{b+}F_{i+\frac{1}{2},j+1}&=Q_{i+1,j+1}Q_{i,j+1}P_{i+1,j+1}P_{i,j+1}. \end{aligned}$$

where \({Q_{i,j}Q_{i+1,j}Q_{i+1,j+1}Q_{i,j+1}}\) are in the counterclockwise order.

The invading set \(\mathcal {I}^b_{i,j}\) has no interior intersection with the occupied set \(\mathcal {O}^a_{i,j}\), while the fluxing area associated to two connect edges can be overlapped. The invading and occupied sets consist of the whole intersection between an old cell and a new cell, while corners of a fluxing area may only be part of an intersection between an old cell and a new cell. Figure 1(a), (b) and (c) illustrate such differences. In a local patch, the union of the occupied and invading set is a subset of the union of the swept/fluxing area of a home cell \(T^a_{i,j}\). However, the difference (extra corner area), if any, will be self-canceled when summing all the signed fluxing area, see the north-west and south-east color region in Fig. 1(b) and (c).

Fig. 1.
figure 1

(a) the invading set \(\mathcal {I}^b_{i,j}\) (red) and occupied set \(\mathcal {O}^a_{i,j}\). (b) the swept/fluxing area \(\partial F_{i\pm \frac{1}{2},j}\). (c) The swept/fluxing area \(\partial F_{i,j\pm \frac{1}{2}}\). (d) the swept area (left) v.s. the local swap set (right) in a local frame. Solid lines for old mesh and dash lines for new mesh. (Color figure online)

Definition 4

A local frame consists an edge and its neighbouring edges. Taking the edge \(F_{i,j+\frac{1}{2}}\) as an example, \( l\mathcal {F}_{i, j+\frac{1}{2}}=\{ F_{i,j\pm \frac{1}{2}}, F_{i,j+\frac{3}{2}}, F_{i\pm \frac{1}{2},j}, F_{i\pm \frac{1}{2},j+1} \}. \)

Figure 2(b) illustrates the local frame \(l\mathcal {F}_{i,j+\frac{1}{2}}\).

Fig. 2.
figure 2

Illustration of the swept/swap region and the local frame

Definition 5

The region between the two curves \(x^a_i(t)\) and \(x^b_{i}(t)\) in \(\varOmega \) is defined as a vertical swap region. The region between \(y_j^a(t)\) and \(y_j^b(t)\) is defined as a horizonal swap region. The region enclosed by \(x^a_{i}(t), x_i^b(t), y^b_j(t)\) and \(y_{j+1}^b(t) \) is referred to as a local swap region in the local frame \(l\mathcal {F}_{i,j+\frac{1}{2}}\).

Definition 6

The intersection points between \(x^a_i(t)\) and \(x^b_i(t)\) or \(y^a_j(t)\) and \(y^b_j(t)\) are referred to as singular intersection points. The total number of singular intersections between \(x^a_i(t)\) and \(x^a_i(t)\) is denoted as \(ns_{xx}\) for \( 1\le i \le M\), and the total singular intersection points between \(y^a_j(t)\) and \(y_j^b(t)\) is denoted as \(ns_{yy}\).

3 Facts and Results

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible quadrilateral meshes with the Assumption A1, then the following facts hold

Fact 1

The element \(T^b_{i,j}\) of \(\mathcal {T}^b\) locates in the interior of a local patch \(l\mathcal {P}^a_{i,j}\) of \(\mathcal {T}^a\).

Fact 2

The face \(F^b_{i,j+\frac{1}{2}}\) locates in the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\).

Fact 3

An inner element of \(\mathcal {T}^b\) has at least \(4^4\) possible ways to intersect with a local patch in \(\mathcal {T}^a\).

Fact 4

If there is no singular point in the local swap region between \(x_i^a(t)\) and \(x_i^b(t)\) in \(\varOmega \) for some \(i \in \{2, 3, \ldots ,M-1 \}\), the local swap region consists of \(2(N-1)-1\) polygons. Each singular intersection point in the swap region will bring one more polygon.

3.1 Basic Lemma

The following results serve as the basis of the CIB/DC and FB/DC methods.

Lemma 1

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible meshes of the same structure. Under the assumption A1, we have

$$\begin{aligned} \mu (T^b_{i,j}) = \mu (T^a_{ij}) -\mu (\mathcal {O}^a_{i,j}) + \mu (\mathcal {I}^b_{i,j}), \end{aligned}$$
(2)

where \(\mu ( \cdot )\) is the area of the underlying set, \(\mathcal {I}^b_{i,j}\) is the invading set of \(T^b_{i,j}\) and \(\mathcal {O}^a_{i,j}\) is the occupied set of \(T^a_{i,j}\) in Definition 2.

$$\begin{aligned} \mu (T^b_{i,j}) =\mu (T^a_{i,j}) + \overrightarrow{\mu } (\partial F^{b+}_{i +\frac{1}{2},j}) + \overrightarrow{\mu } (\partial ^{b+} F_{i+1,j+\frac{1}{2}}) + \overrightarrow{\mu } (\partial F^{b+}_{i +\frac{1}{2},j+1}) + \overrightarrow{\mu } (\partial ^{b+} F_{i,j+\frac{1}{2}}) , \end{aligned}$$
(3)

where \(\overrightarrow{\mu }\) stands for the signed area calculated by directional line integrals.

Proof

See [1] for details.

Suppose a density function is a piecewise function on the tessellation \(\mathcal {T}^a\) of \(\varOmega \). To avoid the interior singularity, we have to calculate the mass on \(T^b_{i,j}\) piecewisely to avoid interior singularity according to

$$\begin{aligned} \int _{T_{i,j}^b} \rho d \varOmega = \sum _{(k,s)\in \mathcal {J}^a_{i,j}} \int _{T^b_{i,j} \cap T^a_{k,s}} \rho d\varOmega = \int _{T^a_{i,j}} \rho d\varOmega - \int _{\mathcal {I}^b_{i,j}} \rho d\varOmega -\int _{\mathcal {O}^a_{i,j}} \rho d\varOmega . \end{aligned}$$
(4)

The following result is a directly consequence of Lemma 1.

Corollary 1

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible quadrilateral meshes of \(\varOmega \), and \(\rho \) is a piecewise function on \(\mathcal {T}^a\), then the mass on each element of \(\mathcal {T}^b\) satisfies

$$\begin{aligned} m(T_{i,j}^b) =m(T^a_{i,j}) -m(\mathcal {O}^a_{i,j})+m(\mathcal {I}^b_{i,j}). \end{aligned}$$
(5)

and

$$\begin{aligned} m(T_{i,j}^b)=m(T^a_{i,j}) + \sum _{k,s} m(\partial ^{b+} F_{k,s}). \end{aligned}$$
(6)

where \((k,s) \in \{ (i+\frac{1}{2},j), (i+1, j+\frac{1}{2}), (i+\frac{1}{2},j+1) , (i,j+\frac{1}{2}) \}\), \( m(\partial ^{b+} F_{k,s})\) is directional mass, the sign is consistent with the directional area of \( \partial ^{b+} F_{k,s}\).

The formulas (5) and (6) are the essential formulas for the CIB/DC method and FB/DC method respectively. It is easy to find that \( \bigcup _{i,j} \mathcal {O}^a_{i,j} =\bigcup _{i,j} \mathcal {I}^b_{i,j} = \bigcup _{i,j} (\partial F_{i + \frac{1}{2},j} \cup \partial F_{i,j+\frac{1}{2}}) \). This is the total swap region and the fluxing area. Since the swap region is nothing but the union of the the intersections between elements in \(\mathcal {T}^a\) and \(\mathcal {T}^b\).

Theorem 1

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible quadrilateral meshes of a square in \(R^2\) with the Assumption A1 and A2. \(ns_{xx}\) and \(ns_{yy}\) be the singular intersection numbers between the vertical and horizonal edges of the two meshes. If there is no common edge in the interior of \(\varOmega \) between \(\mathcal {T}^a\) and \(\mathcal {T}^b\). Then the swapping region of the two meshes consists of

$$\begin{aligned} 3(N-1)(M-1)-2((M-1)+(N-1))+1 +ns_{xx} +ns_{yy}. \end{aligned}$$
(7)

polygons.

Proof

See [1] for details.

Notice that \((N-1)(M-1)\) is the number of the elements of the tessellation of \(\mathcal {T}^a\) and \(\mathcal {T}^b\). Then (7) implies for the CIB/DC method, the swap region can be computed in O(n) time when every the overall singular intersection points is bounded in \(\mathcal {O}(n)\), where n is the number of the cells. The complexity depends on the singular intersection points. Such singular intersection points depends on the underlying problem, for example, a rotating flow can bring such singular intersections.

3.2 Intersection Between a Face and a Local Frame

Table 1. Cases of intersections of a vertical edge with a local frame

For the two admissible meshes \(\mathcal {T}^a\) and \(\mathcal {T}^b\), we classify the intersections between a face \(F^b_{i,j+\frac{1}{2}}\) and the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\) into six groups according to the relative position of the vertices \(Q_{i,j}\) and \(Q_{i,j+1}\) in the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\). The point \(Q_{i,j+1}\) can locate in \(A_1\), \(A_2\), \(A_3\) and \(A_4\) in the local frame of \(l\mathcal {F}_{i,j+\frac{1}{2}}\) in Fig. 2(c), and the point \(Q_{i,j}\) can locate in \(B_1\), \(B_2\), \(B_3\) and \(B_4\) region. Compared with the face \(F^a_{i,j+\frac{1}{2}}\), the face \(F^b_{i,j+\frac{1}{2}}\) can be

  • shifted: \(A_1B_1\), \(A_2B_2\), \(A_3B_3\) and \(A_4,B_4\);

  • diagonally shifted: \(A_1B_2\), \(A_2B_1\), \(A_3B_2\), and \(A_4B_3\);

  • shrunk: \(A_3B_2\) and \(A_4B_1\); diagonally shrunk: \(A_3B_1\) and \(A_4B_3\);

  • stretched: \(A_1B_2\) and \(A_2B_3\); diagonally stretched: \(A_1B_3\) and \(A_2B_4\).

And then for each group, we choose one representative to describe the intersection numbers between the face \(F^b_{i,j+\frac{1}{2}}\) and the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\). Finally, according to intersection numbers between \(F^b_{i,j+\frac{1}{2}}\) and the horizonal/vertical edges in the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\), we classify the intersection cases into six groups in Table 1 and 17 symmetric cases in Fig. 3.

Fact 5

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible quadrilateral meshes of the same structure. Under the assumption A1, A2 and A3, an inner edge \(F^b_{i,j+\frac{1}{2}}\) of \(\mathcal {T}^b\) has 17 symmetric ways to intersect with the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\). A swept/fluxing area has 17 possible symmetric cases with respect to the local frame.

Fig. 3.
figure 3

Intersections between a face (dashed line) and a local frame. (a) shrunk (b) diagonal shrunk, where H0 stands for the intersection number with horizontal edges is 0, V1 stands for the intersection number between the dash line and the vertical edge is 1.

3.3 Fluxing/Swept Area and Local Swap Region in a Local Frame

For the FB/DC method, once the intersection between \(F^b_{i,j+\frac{1}{2}}\) between \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\) is determined, then the shape of the swept area \(\partial F_{i,j+\frac{1}{2}}\) will be determined. There are 17 symmetric cases as shown in Fig. 3. On contrast, the local swap region requires additional effort to be identified. The vertex \(Q_{i,j}\) lies on the line segment \(y^b_{j}(t)\), according the Assumption A2, \(y^b_{j}(t)\) can only have one intersection with \(x^a_i(t)\). This intersection point is referred to as \(V_1\). The line segment \(Q_{i,j}V_1\) can have 0 or 1 intersection with the local frame \(l\mathcal {F}_{i,j+\frac{1}{2}}\) except \(V_1\) itself; the intersection point, if any, will be denoted as \(V_2\).

The north and south boundary of the local swap region therefore can have 1 or 2 intersection with the local frame. Therefore each case in Fig. 3 results up to four possible local swap region. We use the intersection number between the up and south boundary and the local frame to classify the four cases, see Fig. 4 for an illustration. For certain cases, it is impossible for the point \(Q_{i,j}V_1\) have two intersection points with the local frame, 98 possible combinations are illustrated in Fig. 5.

Fig. 4.
figure 4

The shapes of local swap region based on the case of H0V0 in Fig. 3, where U1 / U2 stands for the face \(Q_{i,j+1}Q_{i+1,j+1}\) or \(Q_{i-1,j+1}Q_{i,j+1}\) has 1/2 intersections with the old local frame, while S1 / S2 stands for the face \(Q_{i,j-1}Q_{i+1,j-1}\) or \(Q_{i-1,j-1}Q_{i-1,j}\) has 1/2 intersections with the old local frame.

Fig. 5.
figure 5

Classification tree for all possible cases of a local swap region. \(Q_{i+1,j+1}\) is on of the vertex of \(F^b_{i,j+1/2}\), L, R U and D stand for the relative position of \(Q_{i,j}\) in the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\). The edge \(F^b_{i,j+\frac{1}{2}}\) can be shifted(st), shrunk(sk), stretched(sh), diagonally shifted(dst), diagonally shrunk(dsk), and diagonally stretched(dsh).

Fact 6

Let \(\mathcal {T}^a\) and \(\mathcal {T}^b\) be two admissible quadrilateral meshes of the same structure. Under the Assumption A1, A2 and A3, a local swap region has up 98 cases with respect to a local frame.

Form the Fig. 1 in [6, 7], we shall see that Ramshaw’s approach requires at least 98 programming cases. Under the assumption A1, A2 and A3, while the swept region approach requires only 34 programming cases. This is a significant improvement. When the assumption A3 fails, or the so called degeneracy of the overlapped region arises, more benefit can be obtained.

Fig. 6.
figure 6

Some degeneracy of the intersections. The swept/fluxing area for (a)–(e) degenerates to be a triangle plus a segment, for (f), (g) and (h), the intersection degenerate to a line segment. While for the swap region, an overlap line segment of a new edge and the old edge can be viewed a degeneracy of a quadrilaterals. A overlap of the horizontal and vertical intersection point can be viewed as the degeneracy of a triangular.

3.4 Degeneracy of the Intersection and Signed Area of a Polygon

The intersection between \(T^b_{i,j}\) and \(T^a_{k,s}\) for \((k,s) \in \mathcal {J}^a_{i,j}\) can be an polygon, an edge or even only a vertex. The degeneracy of the intersection was believed as one of the difficulty of the challenge of the CIB/DC method [8, p. 273]. In fact, some cases can be handled by the Green formula to calculate the planar polygon with line integrals. Suppose the vertices of a polygon are arranged in counterclockwise, say, \(P_1P_2,\ldots , P_s\), then it area can be calculated by

(8)

where \(P_{s+1}=P_1\). This is due to the fact

$$ \int _{\overrightarrow{P_1P_2}} x dy = \int _{x_1}^{x_2} x \frac{y_2 -y_1}{x_2-x_1} dx = \frac{(y_2-y_1)(x_1+x_2)}{2}. $$

The formula (8) can handle any polygon including the degenerate cases: a polygon with \(s+1\) vertices degenerate to one with s vertices, a triangle degenerates to a vertex or a quadrilateral polygonal degenerates to a line segment. Such degenerated cases arise when one or two vertices of the face \(F^b_{i,j+\frac{1}{2}}\) lie on the local frame \(l\mathcal {F}^a_{i,j+\frac{1}{2}}\), or the horizontal intersection points overlap with the vertical intersection points. The later cases bring no difficulty, while the cases when \(Q_{ij}\) locates in the vertical lines in the local frame or the face overlaps with partial of the vertical lines in the local frame do bring difficulties. To identify such degeneracies, one need more flags to identify whether such cases happens when calculating the intersections between face \(F^b_{i,j+\frac{1}{2}}\) and \(F^a_{i,j\pm \frac{1}{2}}\) and \(F^a_{i,j+\frac{3}{2}}\).

figure a

3.5 Assign a New Vertex to an Old Cell

As shown in Fig. 5, the relative position of a new vertex in an old local frame is the basis to classify all the intersections. This can also be obtained by the Green formula for the singed area of a polygon. We denote the signed area of \(P_{i,j}P_{i+1,j}Q_{i,j}\) as \(A_1\), \(P_{i,j}P_{i,j+1}Q_{i,j}\) as \(A_2\), \(P_{i-1,j}P_{i,j}Q_{i,j}\) as \(A_3\) and \(P_{i,j-1}P_{i,j}Q_{i,j}\) as \(A_4\). Then the vertex \(Q_{i,j}\) can be assigned according to Algorithm 1. This determines the first two level (left) of branches of the classification tree in Fig. 5.

Fig. 7.
figure 7

Illustration for the vertical and horizontal swap and swept regions.

3.6 Alternative Direction Sweeping

To calculate all intersections in the swap area and swept/fluxing area, we can apply the alternative direction idea: view the union of the swap area between two admissible quadrilateral meshes of a domain as the union of (logically) vertical strips (shadowed region in Fig. 7(b)) and horizonal strips (shadowed area in Fig. 7(c)). One can alternatively sweep the vertical and horizontal swap strips. Notice that the horizonal strips can be viewed as the vertical strip by exchanging the x-coordinates and the y-coordinates. Therefore, one can only program the vertical sweep case. Each sweep calculate the intersections in the vertical/horizontal strips chunk by chunk. For the CIB/DC method, each chunk is a local swap region, while the FB/DC method, each chunk is a fluxing/swept area.

For the CIB/DC method, one can avoid to repeat calculating the corner contribution by thinning the second sweeping. The first vertical sweep calculate all the intersection areas in the swap region. The second sweep only calculates the swap region due to the intersection \(T^b_{i,j} \cap T^a_{i,j\pm 1}\). On contrast, in the FB/DC methods, the two sweep is totaly symmetric, repeat calculating the corner contribution is necessary.

4 Examples

The following examples is used to illustrated the application background. Direct apply the implementation of the result results a first order remapping scheme. We consider the following two kinds of grids.

Fig. 8.
figure 8

Illustration of the tensor grids (a) and the random grids (b). The franke test function (c), the tanh function(d) and the peak function(e).

4.1 Tensor Product Grids

The mesh on the unit square \([0,1] \times [0,1]\) is generated by the following function

$$\begin{aligned} x(\xi , \eta , t)=(1-\alpha (t)) \xi +\alpha (t) \xi ^3, \quad y(\xi , \eta , t)=(1-\alpha (t)) \eta ^2, \end{aligned}$$
(9)

where \(\alpha (t)= \sin (4\pi t)/2,\xi ,\eta , t \in [0,1].\) This produces a sequence of tensor product grids \( {x_{i,j}^n}\) given by

$$\begin{aligned} x_{i,j}^n=x(\xi _i,\eta _i, t^n), \quad y_{i,j}^n=y(\xi _i, \eta _j, t^n). \end{aligned}$$
(10)

where \(\xi _i \) and \(\eta _j\) are nx and ny equally spaced points in [0, 1]. For the old grid, \(t_1=1/(320+nx)\), \(t_2=2t_1\). We choose \(nx=ny=11,21,31,41,\ldots ,101\).

4.2 Random Grids

A random grid is a perturbation of a uniform grid, \(x_{ij}^n= \xi _i + \gamma r_i^n h\), and \(y_{ij}^n= \eta _j+ \gamma r_j^n h\). where \(\xi _i\) and \(\eta _j\) are constructed as that in the above tensor grids. \(h=1/(nx-1)\). We use \(\gamma =0.4\) as the old grid and \(\gamma =0.1\) as the new grid, \(nx=ny\).

4.3 Testing Functions

We use three examples as density functions, the franke function in Matlab (Fig. 8(c)), a shock like function (Fig. 8(d)) defined by

$$\begin{aligned} \rho _2(x,y)=\tanh (y-15x+6)+1.2. \end{aligned}$$
(11)

and the peak function (Fig. 8(e)) used in [8]

$$\begin{aligned} \rho _3(x,y)= {\left\{ \begin{array}{ll} 0, &{} \sqrt{(x-0.5)^2+(y-0.5)^2} >0.25; \\ \max \{ 0.001, 4(0.25-r)\}, &{} \sqrt{(x-0.5)^2+(y-0.5)^2} \le 0.25. \end{array}\right. } \end{aligned}$$
(12)

The initial mass of on the old cell is calculated by a fourth order quadrature, the remapped density function is calculated by the exact FB/DC method: the swept region is calculated exactly. The density are assumed to be a piecewise constant on each old cell. Since the swept/flux area are calculated exactly. The remapped error only depends on the approximation scheme to the density function on the old cell. The \(L_\infty \) norm

$$\begin{aligned} \Vert \rho ^{*} -\rho \Vert _{\infty } =\max _{i_j}| \rho ^{h}_{i+\frac{1}{2},j+\frac{1}{2}}- \rho (x_{i+\frac{1}{2},j+\frac{1}{2}}) | \end{aligned}$$
(13)

is expected in the order of \(\mathcal {O}(h)\) for piecewise constant approximation to the density function on the old mesh. While the \(L_1\) norm

$$ \Vert m^*-m \Vert _{\infty }=\max _{i,j} | (\rho ^{h}_{i+\frac{1}{2},j+\frac{1}{2}}- \rho (x_{i+\frac{1}{2},j+\frac{1}{2}}))\mu (C_{i+\frac{1}{2}, j+\frac{1}{2}}) |. $$

is expected to be in the order of \(\mathcal {O}(h^3)\). We don’t use the \(L_1\) normal like in other publications, because when plot the convergence curve in the same figure, the \(L_1\) norm and the \(L_\infty \) norm for the density function converges also the same rate. Figure 9 demonstrates the convergence of the remmapping error based on the piecewise constant reconstruction of the density function in the old mesh.

Fig. 9.
figure 9

Convergence of the error between the remapped density functions and the true density functions. F: the Franke function, P: the peak function, and T: tanh function. The error are scaled by the level on the coarse level.

Fig. 10.
figure 10

Remapped error of the density function on \(101 \times 101\) tensor grids.

Fig. 11.
figure 11

Remapped error of the density function on \(101 \times 101\) random grinds.

Fig. 12.
figure 12

Contour lines of the remapped density functions on \(nx \times ny \) random grids. \(nx=ny=11\) (left), 21 (middle) and 51 (right).

5 Discussion

Computing the overlapped region of a Lagrangian mesh (old mesh) and a rezoned mesh(new mesh) and reconstruction (the density or flux) on the Lagrangian mesh are two aspects of a remapping scheme. According to the way how the overlapped (vertical) strips are divided, a remmapping scheme can be either an CIB/DC approach or an FB/DC approach. Both approaches are used in practice. The CIB/DC methods is based on pure geometric or set operation. It is conceptually simple, however, it is non trial even for such a simple case of two admissible meshes of the same connectively. The CIB/DC approach requires 98 programming cases for the non-degenerate intersections to cover all the possible intersection cases which are more than 256. On contrast, the FB/DC method, only requires 34 programming cases for the non-degenerate intersections. This approach is attractive for the case when the two meshes share the same connectivity. Here we present method to calculate fluxing/swept area or the local swap area. They are calculated exact. The classification on the intersection types can help us to identify the possible degenerate cases, this is convenient when develop a robust remapping procedure. Based on the Fact 3, we know there are at least 256 possible ways for a new cell to intersect with an old tessellation. But according to Fig. 3, we can tell there are more cases than 256. What is the exactly possibilities? This problem remains open as far as we know.