Manuscript Offprint
arXiv:2610.34702Faster Polyhedral Intersections in 3D
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
The operation of intersecting two polyhedra, which can be reduced to clipping one polyhedron with a series of planes formed from another polyhedron, is central to intersection based mesh interpolation and material interface reconstruction. R3D is a robust library for such operation which implements the algorithm of Sugihara. In this paper, we present J3D, a new implementation of the clipping algorithm of Sugihara that provides substantial performance improvements over R3D.
Keywords: Polyhedral clipping, Computational physics, Algorithms, Data structures
1 Introduction
In the implementation of fluid simulations, especially when shocks are involved, the Arbitrary Lagrangian Eulerian (ALE) method is heavily relied upon to reliably simulate flows [3, 13]. At a high level, the ALE method operates as follows. First, the mesh is deformed with the fluid until it is no longer viable. Then, to continue the simulation, the fields of the deformed mesh are conservatively interpolated onto a higher quality mesh and the simulation continues. A commonly used method to conservatively interpolate the field values from a source mesh to a target mesh is intersection based remap [10]. In this procedure, each cell of the target mesh is intersected with cells of the source mesh, and the resulting moments of intersection are used as weights in the interpolation of source cell values onto the target cell. Intersecting two polyedra reduces to the problem of assuming that one of them is convex and intersecting the planes of the convex polyhedron with the other. Another operation commonly operation found in ALE simulations is material interface reconstruction [4, 9, 15, 11]. In interface reconstruction, the volume fractions and, possibly centroids, of materials in a cell must be used to recover the geometry of the interfaces between the materials. This is done by repeatedly clipping the polyhedron with a plane to find the optimal material geometry. As suggested from the descriptions of the two aforementioned procedures, intersecting a polyhedron with a plane is fundamental. In fact, while polyhedral intersection is typically a very small algorithm within the context of a larger ALE method, it has significant performance impacts. This is exacerbated by the fact that as the mesh deforms in ALE, the faces of a polyhedron may no longer be planar. To resolve this, faces of a polyhedron are “facetized” which adds to the problem complexity. That is, the faces of one polyhedron are decomposed into triangular faces by adding a point in the center of each face and joining it with each of the edges making up the original face.


Figure 1: A hexahedra (left) and the same hexahedra after being facetized into triangular faces (right).
Now, given the importance of clipping a polyhedron efficiently, the focus of this paper will be just that. We will begin by briefly describing existing algorithms which do this and why we chose the algorithm of Sugihara [18] in particular. We will then go into detail of an existing implementation known as R3D [16] as well as its limitations. Finally, we will describe our novel implementation known as J3D, the data structures we introduce for it, and the significant performance improvements it yields. The code repository of J3D is located at https://github.com/lanl/j3d.
On the other hand, algorithms that use a Binary Space Partitioning (BSP) Tree like [5] are numerically accurate and fast for very large geometries. However, they require the initialization of a BSP-tree which is an overhead we cant afford since our use cases require intersections to be called many times on polyhedra known to be relatively small.
Ultimately, we settled on Sugihara's clipping algorithm [18] which we also refer to as clip-n-cap. The algorithm is very simple and practical to implement. Moreover, to address robustness, the only floating point operations required are to determine if a vertex is on the positive or negative side of the plane. It is well known that differences in classification of a vertex as being in front or behind the plane in the Sugihara algorithm can result in a different topology for the polyhedron. In particular, when clipping non-convex polyhedra, these errors can yield a resulting graph with small independent polyhedral pieces with possibly negative volumes. If the only goal is to extract out the moments of intersection as needed in conservative remapping, these small positive or negative polyhedral fragments do not make a significant difference. On the other hand, in the case of interface reconstruction, if one needs to recover the polyhedron topology for further reuse, then one needs to do some cleanup of the small fragments using a tolerance which only needs to be done once after clipping with all the planes is done.
In the Sugihara clipping algorithm [18], the polyhedron is represented as a graph where V is the set of vertices and E is the set of edges. When a plane “clips” G, the vertices are partitioned into two sets and . is the set of vertices on the positive side of the plane and is the set of points on the negative side of the plane. We reconstruct the polyhedron on the positive side of the plane as follows.
-
Each edge with one endpoint in and one endpoint in is split in two by a new vertex generated at the intersection of the edge and the clipping plane.
-
Next, a cycle separating and is generated by connecting the aforementioned new vertices. This cycle represents the capping face.
-
Finally, the vertices in and their incident edges are removed from the graph.
With the Sugihara algorithm in mind, we will now introduce two common representations of a polyhedron. A boundary representation (BREP) describes a hierarchy between a cell, its faces, and the vertices on each face ordered in the outward normal direction to the face. The graph representation of a polyhedron is one in which each vertex maintains a list of edge connected nodes also referred to as neighbors.

| Graph | |||
|---|---|---|---|
| BREP | vertex | neighbors | |
| face | vertices | 1 | [3,5,2] |
| f1 | [1,2,4,3] | 2 | [4,1,6] |
| f2 | [7,8,6,5] | 3 | [7,1,4] |
| f3 | [3,7,5,1] | 4 | [8,3,2] |
| f4 | [8,4,2,6] | 5 | [7,6,1] |
| f5 | [3,4,8,7] | 6 | [8,2,5] |
| f6 | [1,5,6,2] | 7 | [8,5,3] |
| 8 | [4,6,7] | ||
Table 1: A hexahedron with labeled vertices and faces. The left table demonstrates the corresponding BREP with faces and their nodes ordered in the outward normal direction. The right table demonstrates the corresponding graph with nodes and their neighbors ordered counter-clockwise relative to the exterior of the hexahedron.
R3D and J3D both represent the polyhedron in the graph representation with the additional restriction that neighbors around a node are ordered counter-clockwise relative to the exterior of the polyhedron. The ordering is required so that clipped faces after step 1 are traversed correctly and to compute the moments of a polyhedron.

(a)

(b)

(c)
Figure 2: The clip-n-cap algorithm divided into three stages. (a) New vertices (in red) are generated on each edge connecting a vertex from to a vertex from . (b) A cycle (5,6,7) separating and is generated by connecting the new vertices. (c) The vertices in and their incident edges are removed from the graph and vertices are relabeled.
Meshes typically represent polyhedra in the BREP and are converted into the graph representation for clip-n-cap. This is because only local information (neighbors) of vertices have to be modified during clip-n-cap in the graph representation. To compute the moments, for each face, one begins with picking a starting vertex on that face. Then, for each directed edge on the face not containing , the points , , and are use to construct a triangular facet. Finally, each tuple of three points forming a triangular facet along with the origin are used to build a tetrahedron to be integrated over [12]. This is very straightforward and performant in the BREP because BREPs inherently have the notion of a faces described by a sequence of vertices from which we can pick out pairs of consecutive vertices. On the other hand, a graph representation does not have such a natural face representation.

(a)

(b)

(c)
Figure 3: The procedures (a), (b), then (c) of constructing tetrahedra from the pentagonal face of a polyhedron to compute its volume. A starting vertex 1, is picked. As we walk around the face, the segments (2,3), (3,4), and (4,5) are used along with vertex 1 to build triangular faces. Each of these triangular faces along with the origin O are used to build tetrahedra and their volumes are summed to compute the volume of the polyhedron.
3 R3D
R3D is a C library which was introduced to conduct conservative voxelization and later refined at Los Alamos National Laboratory for more general polyhedral clipping [17, 16]. Here, we describe some of the details of the R3D implementation of clip-n-cap and their effect on performance. R3D represents its polyhedra as a graph but imposes an additional restriction that every node has a valence of three, which is not present in the original Sugihara paper. This restriction was introduced to enhance vectorization of computations but handicaps the algorithm in other ways. Most notably, if a polyhedron has vertices with a valence greater than three, the algorithm has to duplicate vertices and create edges to initialize the internal representation (Figure 4).

(a)

(b)

④
⑤
(c)

(d)
Figure 4: R3D's procedure (a)-(d) of duplicating nodes to enforce that all nodes have a valence of three. (a) Vertex 1 is identified to be a vertex with valence of four. (b) Vertex 1 is replaced with a cycle composing of four vertices 6, 7, 8, and 9 with coordinates equivalent to that of vertex 1. (c) Two edge connected vertices 8 and 9 from the cycle are removed. (d) The vertex clockwise from 8 in the cycle (7) is joined with 8's old neighbor (4). The vertex counter-clockwise from 9 in the cycle (6) is joined with 9's old neighbor (5).
3.1 R3D's Data Structures
R3D avoids dynamic memory allocation by setting the maximum number of vertices via the compile time variable R3D_MAX_VERTS and by setting the number of neighbors per vertex to three. Since R3D enforces that all vertices have three neighbors, this causes modification of the original polyhedron and sometimes a dramatic increase in the number of vertices. As a consequence, R3D_MAX_VERTS has to be set to a very large size.
typedef struct { r3d_int pnbrs[3]; /*!< Neighbor indices. / r3d_rvec3 pos; /!< Vertex position. */ } r3d_vertex;
typedef struct { r3d_vertex verts[R3D_MAX_VERTS]; /*!< Vertex buffer. / r3d_int nverts; /!< Number of vertices in the buffer. */ } r3d_poly;
Figure 5: The r3d_vertex and r3d_poly structs respectively used to represent a polyhedra in R3D. Note that the r3d_vertex has a buffer of size 3 to store neighbors.
4 J3D
We present a revised implementation of the Sugihara clip-n-cap algorithm that aims to remove some of the restrictions of R3D with an eye to improved performance on conventional CPUs and porting the algorithm to modern GPUs. We introduce new data structures suited for this purpose and describe new algorithms to take advantage of these constructs.
Given a face from a BREP and the ordered set of nodes forming that face, a directed edge is a pair of sequential nodes. From this, the data structures we introduce are two maps and . These maps serve the dual purpose of cycling through the vertices of a face as well a cycling through the neighbors of a graph vertex, both in an ordered manner. maps a directed edge to the vertex preceding it in the face walk and maps a directed edge to the vertex succeeding it in the face walk. Each of these maps are represented as a array of vertex indices where is the set of vertices in the polyhedron.

Figure 6: An oriented four sided face and the corresponding maps P and N.
Alternatively, can be viewed as mapping to the node following B in the counter-clockwise iteration of neighbors around A. In addition, can also be viewed as mapping to the node preceding A in the clockwise iteration of neighbors around B.

Figure 7: Vertex 1, its neighbors, and the corresponding maps P and N.
4.1 Graph Initialization
For initializing the graph from a BREP, we also define a map which for a vertex simply returns a neighbor of . This map, along with , is used to initialize the graph representation. First, the algorithm to initialize and is as follows.
Algorithm 1 Initialization of the Maps S and P
Require: BREP representation B.
Ensure: S and P are initialized.
function INITIALIZATIONSETUP(B, S, P) prev ← 0 curr ← 0 next ← 0 for faces do for do prev ← f.vertices[(i - 1) mod f.num_vertices] curr ← f.vertices[i] next ← f.vertices[(i + 1) mod f.num_vertices] S[curr] ← next P[curr][next] ← prev end for end for end function
From here, the algorithm to initialize the graph with counter-clockwise vertex neighbor ordering is as follows.
Algorithm 2 Counter-Clockwise Neighbors Initialization
Require: .
Ensure: Graph with counter-clockwise neighbor ordering.
function NEIGHBORSINITIALIZATION() for vertices do neighbors[v].append() while do neighbors[v].append() end while end for end function
4.2 Clip-N-Cap
Before describing the clip-n-cap implementation in J3D, let's recall some details of the Sugihara algorithm from section 2. When a plane clips a graph , is partitioned into two sets and . is the set of vertices on the positive side of the plane and is the set of vertices on the negative side of the plane. Our goal is to reconstruct the polyhedron on the positive side of the plane. First, new vertices are generated on each edge connecting a vertex from to a vertex from . Now a detail which is important to mention is that after this step, clip-n-cap in R3D and J3D is implemented such that for each new vertex, the edge connecting it to a vertex in is deleted and the edge connecting it to a vertex in is kept. Moreover, at this point, each new vertex has a singular neighbor which is a vertex in . This singular neighbor is the first element in the list of neighbors of a new vertex. Before being able to execute clip-n-cap efficiently, we need to initialize so we can walk from one new vertex to the next efficiently along a path of vertices in . So, we will initialize by visiting each neighbor of each vertex in . We will take advantage of the fact that the neighbors of each vertex in are ordered counter clockwise relative to the exterior of the polyhedron.
Algorithm 3 Initialization of the Map After Initializing , , and New Vertices
Require: Graph with a subset of the vertices with connectivity to the new vertices.
Ensure: is initialized.
function CAPSETUP() prev ← 0 next ← 0 for do for do prev ← v.neighbors[i] next ← v.neighbors[(i - 1) mod v.num_neighbors] end for end for end function
Next, the algorithm to execute step two in Sugihara's clip-n-cap algorithm with the help of is as follows.
Algorithm 4 Generating a Cycle Separating and
Require:
Require: Graph has a set of new vertices s.t. each new vertex has a singular neighbor in .
Ensure: The cycle of new vertices separating and is generated.
function CAP( )
for do
prev
curr prev.neighbors[0]
next
while next do
prev curr
curr next
next
end while
next
next.neighbors[2]
end for
end function
4.3 BREP Traversal for Moment Calculation
The map will also prove necessary for efficient moments computation. To compute the volume or the zeroth order moment, for example, we traverse each face and construct triangular facets from a starting vertex on the face. Like in Figure 2, we begin with a starting vertex and the next two vertices and around the face of a polyhedron to form the first triangular facet. So, in terms of the map we defined earlier, we have that and the next facet we construct will be defined by the points , , and and so on. This high level idea is leveraged by J3D to efficiently compute the moments of a polyhedron. Before computing moments however, we need to initialize the map as follows. This algorithm is almost identical to how we initialized before clip-n-cap except we consider all vertices in the polyhedron rather than just the vertices in .
Algorithm 5 Initialization of the Map N
Require: Graph G representing the polyhedron with neighbors around each vertex ordered ccw relative to the exterior
Ensure: N is initialized.
function VOLUMECOMPUTATIONSETUP(G) prev ← 0 next ← 0 for do for do prev ← v.neighbors[i] next ← v.neighbors[(i - 1) mod v.num_neighbors] N[prev][v] ← next end for end for end function
By using the origin O as a reference point, the signed volume of the tetrahedra formed by O, A,
B, and C is the following [12].
With this, the volume of the whole polyhedron can be computed via the following algorithm
Algorithm 6 Volume Computation
Require: N Require: Graph G Ensure: Volume vol of the polyhedra. function BREPWALK(G, N, vol) vol ← 0 visited_edges[G.num_vertices][G.num_vertices] for v ∈ G.vertices do for i = 1 : G.num_neighbors[v] do if not visited_edges[v][G.neighbors[v][i]] then prev ← v curr ← G.neighbors[v][i] next ← N(prev, curr) visited_edges[prev][curr] ← true while next ≠ v do vol ← vol + vol_T(v, curr, next) prev ← curr curr ← next next ← N(prev, curr) visited_edges[prev][curr] ← true end while visited_edges[curr][next] ← true end if end for end for end function
4.4 J3D Implementation
J3D is a C library which only uses static allocations for its working buffers. However, since we have no restrictions on the valence of nodes, J3D has two compile time variables J3D_MAX_VERTS and J3D_MAX_EDGES to statically size its working buffers. Since the graph representing a polyhedra is always isomorphic to a planar graph and is therefore sparse, J3D_MAX_EDGES can be set to a positive integer multiple of J3D_MAX_VERTS. The adjacency of the graph is stored in a compressed sparse rows (CSR) array [7]. That is, rather than storing the neighbors of an vertex in an individual array for each vertex, neighbors are stored in a contiguous chunk of a larger array and a separate row index array is used to index into the correct chunk of a vertex.
typedef struct { double verts[J3D_MAX_VERTS][3]; /*!< Vertex positions. / int dir_edges[2 * J3D_MAX_EDGES]; /!< CSR array of the graph adjacency. / int indices[J3D_MAX_VERTS + 1]; /!< Offsets for the CSR array. / int num_dir_edges; /!< Number of directed edges. / int num_verts; /!< Number of vertices. */ } j3d_poly;
Figure 8: The struct used to represent a polyhedron in J3D. J3D_MAX_EDGES is used to reserve a fixed sixed buffer for a CSR array used to store the graph adjacency. J3D_MAX_VERTS is used to reserve fixed sized buffers for the vertex positions and the row indices for the CSR array.

neighbors of neighbors of neighbors of neighbors of neighbors of
vertex 1 vertex 2 vertex 3 vertex 4 vertex 5

Figure 9: A quadrilateral pyramid with its CSR array representation. The first array is used to store the adjacency or all the neighbors contiguously. Moreover, the second array consists of indices used to index into the neighbors of each vertex in the first array. There is an additional element at the end of the second array so that we know when the contents of the first array end.
4.5 Additional Implementation Improvements
In moments calculation, J3D explicitly computes the zeroth, first, second, and third order moments and falls back to the recursive method in [12] for higher order moments whereas R3D uses the recursive method for all moments. The explicit formulas for the moments computation can be found in Appendix A.
4.6 Within The Context of Modern Day Computing
R3D was implemented primarily with CPU computation in mind but did make some optimizations for vectorization. Since its development, the computational power of new supercomputers is coming primarily from GPUs (over 95%) while the memory capacity of both CPUs and GPUs is still constrained. J3D is optimized on both counts for the GPU. Given that J3D polyhedra themselves are facing size constraints on modern GPUs, the explosion in size of R3D polygons coming from the trivalent requirement is a non-starter for such platforms.
5 Lessons Learned
It is possible to implement a data structure representing a graph with arbitrary valence utilizing a J3D_MAX_DEGREE compile variable time instead. Such variable is used to statically allocate a working buffer for each vertex to store its neighbors. While this improves the performance on small scale benchmarks, it ended up being slower when integrated into a larger code.
typedef struct { int pnbrs[J3D_MAX_DEGREE]; /*!< Neighbor indices. / int degree; /!< Number of neighbors. / j3d_vec3 pos; /!< Vertex position. */ } j3d_vertex;
typedef struct { j3d_vertex verts[J3D_MAX_VERTS]; /*!< Vertex buffer. / int nverts; /!< Number of vertices in the buffer. */ } j3d_poly;
Figure 10: The j3d_vertex and j3d_poly structs respectively used to represent a polyhedron with a J3D_MAX_DEGREE compile time variable.

| memory buffer for neighbors of vertex 1 | memory buffer for neighbors of vertex 2 | memory buffer for neighbors of vertex 3 | memory buffer for neighbors of vertex 4 | memory buffer for neighbors of vertex 5 | memory buffer for neighbors of vertex 6 | memory buffer for neighbors of vertex 7 | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 3 | 4 | 5 | 6 | 7 | 3 | 1 | 7 | 4 | 1 | 2 | 5 | 1 | 3 | 6 | 1 | 4 | 7 | 1 | 5 | 2 | 1 | 6 | ||||||||||||||||||
Figure 11: A hexagonal pyramid with an overview of how its adjacency is represented in memory with J3D_MAX_DEGREE=6. Empty memory cells represent unused or redundant memory cells. As a consequence, the representation is memory inefficient and cache misses occur far more frequently than if the polyhedron is represented with a CSR array.
This performance loss was attributable to a lack of memory locality which led to far more cache misses. Since the majority of vertices do not have J3D_MAX_DEGREE many neighbors, those vertices have unused information at the end of their respective buffer. Consequently, the memory used to store the entire polyhedron is fragmented and cache misses inevitably arise. This led to the implementation in section 4.4 which has optimal memory locality and superior performance across various tests as demonstrated in the next section.
6 Benchmarks
Our algorithm makes improvements to the serial implementation of a single clip operation on a polyhedron over R3D's implementation and therefore, we are doing serial comparisons. While this clipping algorithm will indeed be used in parallel in real applications, we did not want to muddy the performance comparisons for the core algorithm.
6.1 Kernel Level Benchmarks
For the following kernel level benchmark, the hardware we utilized was the Intel(R) Xeon(R) CPU E5-2695 v4 @ 2.10GHz. R3D and J3D were compiled with gcc 8.5.0. The default buffer sizes for J3D and R3D were used, that is, J3D_MAX_VERTS=256, J3D_MAX_EDGES=512, and R3D_MAX_VERTS=512. We retrieved the results from HPCToolkit [1].

Tetrahedron

Triangular prism

Cube

Quadrilateral pyramid

Pentagonal pyramid

Hexagonal pyramid

Octahedron

Facetized cube
Figure 12: The eight polyhedra we tested for the kernel level benchmarks.
We considered eight polyhedra starting in the BREP representation. For each of these polyhedra, we ran iterations of initializing the polyhedron into the internal representation of R3D and J3D, conducting clip-n-cap with a random plane through the center, then computing the resulting volume. A polyhedron we want to emphasize is the facetized cube, which is a cube with each of its faces decomposed into triangular faces (Figure 1). This decomposition is a common practice used to decompose potentially curved faces of a polyhedral cell into planar faces [2]. Another reason for using this polyhedron in our benchmarks is to show how expensive the initialization step of R3D is especially when the polyhedron has vertices with degree greater than three and the algorithm in Figure 4 must be invoked.

Figure 13: Runtime in seconds for J3D and R3D to run iterations of initializing a polyhedron from the BREP to the internal data structure, conducting clip-n-cap with a random plane through the centroid, then computing the resulting volume.

Figure 14: Runtime in seconds for each method in J3D and R3D after running iterations of initializing a facetized cube from the BREP to the internal data structure, conducting clip-n-cap with a random plane through the centroid, then computing the resulting volume.
6.2 Rotor Problem
A problem in interface reconstruction that we benchmarked is the rotor problem. In this problem, our material interface reconstruction code Tangram [10] is used to recover the material geometry of a complex series of intermeshed gears or rotors onto a 288x288x288 cartesian structured mesh.

Figure 15: A picture of the reference material interfaces in the rotor problem demonstrating the scale and complexity of the problem.
In the following benchmarks, the hardware we utilized was the AMD EPYC 7513 32-Core Processor @ 2.60GHz. Tangram and its dependencies were compiled with gcc/11.2.0. The buffer sizes for J3D and R3D required by Tangram were used, that is, J3D_MAX_VERTS=256, J3D_MAX_EDGES=512, and R3D_MAX_VERTS=1024. We ran several instances of the rotor problem with different material interface reconstruction strategies (VOF, MOF, LVIRA, and LVIRA+ which reconstruct the interfaces with varying degrees of fidelity) [4, 9, 15, 11].

Figure 16: Runtime in seconds for J3D and R3D with various interface reconstruction methods to run the rotor problem on a 288x288x288 cartesian structured mesh.
6.3 Rocket Problem
To demonstrate the performance improvements in mesh interpolation and material interface reconstruction, we also benchmarked the rocket problem. In this problem, we begin with a boundary conformal mesh in the shape of a rocket. We remap this mesh onto a structured mesh and remap this result onto a slightly shifted structured mesh to exercise remap and interface reconstruction in the same run.
In the following benchmarks, the hardware we utilized was the Intel(R) Xeon(R) CPU E5-2695 v4

Figure 17: A snapshot of the conformal boundary mesh representing the rocket (left). The resulting structured mesh after the first remap in the rocket problem run (right).
@ 2.10GHz. Portage and its dependencies (Tangram etc.) were compiled with gcc/9.3.0. The buffer sizes for J3D and R3D required by Portage and Tangram were used, that is, J3D_MAX_VERTS=256, J3D_MAX_EDGES=512, and R3D_MAX_VERTS=1024. We retrieved the results from HPCToolkit [1].

Figure 18: Total runtime of the rocket problem with J3D vs R3D.

Figure 19: Runtime in seconds for each method in J3D and R3D after running the rocket problem.
7 Conclusion
In this paper, we began by discussing the motivations for performant polyhedral clipping especially within the context of mesh to mesh interpolation and material interface reconstruction. We then went into the implementation details of R3D as well as its performance limitations. To address this, we introduced a novel use of data structures to implement more performant algorithms for clipping and we discussed some lessons learned in pursuit of this. Finally, we presented some benchmarks on various problems which demonstrate J3D's impressive performance gains over R3D.
8 Acknowledgments
This work was conducted under the auspices of U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory, which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. We gratefully acknowledge the support of the U.S. Department of Energy National Nuclear Security Administration Advanced Simulation and Computing Program. We would like to thank Jon Woodring for some helpful suggestions on the implementation of J3D. We would like to thank Jacob Jones who contributed to the early discussions of efficient polyhedral intersection algorithms. We would like to thank Evgeny Kikinzon who contributed the rotor problem benchmark implementation.
References
[1] L. Adhianto, S. Banerjee, M. Fagan, M. Krentel, G. Marin, J. Mellor-Crummey, and N. R. Tallent. Hpctoolkit: tools for performance analysis of optimized parallel programs. Concurrency and Computation: Practice and Experience, 22(6):685–701, 2010.
[2] Hyung Taek Ahn and Mikhail Shashkov. Multi-material interface reconstruction on generalized polyhedral meshes. Journal of Computational Physics, 226(2):2096–2132, 2007.
[3] Andrew J. Barlow, Pierre-Henri Maire, William J. Rider, Robert N. Rieben, and Mikhail J. Shashkov. Arbitrary lagrangian-eulerian methods for modeling high-speed compressible multi-material flows. Journal of Computational Physics, 322:603–665, 2016.
[4] David J Benson. Volume of fluid interface reconstruction methods for multi-material problems. Applied Mechanics Reviews, 55(2):151–165, 04 2002.
[5] Gilbert Bernstein and Don Fussell. Fast, Exact, Linear Booleans. Computer Graphics Forum, 2009.
[6] Gilbert C. Best. Helpful formulas for integrating polynomials in three dimensions. Mathematics of Computation, 18(86):310–312, 1964.
[7] Aydin Buluç, Jeremy T. Fineman, Matteo Frigo, John R. Gilbert, and Charles E. Leiserson. Parallel sparse matrix-vector and matrix-transpose-vector multiplication using compressed sparse blocks. In Proceedings of the Twenty-First Annual Symposium on Parallelism in Algorithms and Architectures, SPAA '09, page 233–244, New York, NY, USA, 2009. Association for Computing Machinery.
[8] Bernard Chazelle. An optimal algorithm for intersecting three-dimensional convex polyhedra. SIAM Journal on Computing, 21(4):671–696, 1992.
[9] Vadim Dyadechko and Mikhail Shashkov. Moment-of-fluid interface reconstruction. Los Alamos Report LA-UR-05-7571, 49, 2005.
[10] Angela Herring, Charles Ferenbaugh, Christopher Malone, Daniel Shevitz, Evgeny Kikinzon, Gary Dilts, Hoby Rakotoarivelo, Jan Velechovsky, Konstantin Lipnikov, Navamita Ray, and Rao Garimella. Portage: A modular data remap library for multiphysics applications on advanced architectures. Journal of Open Research Software, Sep 2021.
[11] Evgeny Kikinzon, Hoby Nirina Rakotoarivelo, and Jan Velechovsky. Lvira+, extended least squares volume-of-fluid interface reconstruction algorithm for m > 2 material domains. Number LA-UR-24-29017, 2024. Sponsor: USDOE Office of Science (SC). Advanced Scientific Computing Research (ASCR) (SC-31).
[12] Patrice Koehl. Fast recursive computation of 3d geometric moments from surface meshes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(11):2158–2163, 2012.
[13] Raphaël Loubère, Pierre-Henri Maire, Mikhail Shashkov, Jérôme Breil, and Stéphane Galera. Reale: A reconnection-based arbitrary-lagrangian-eulerian method. Journal of Computational Physics, 229(12):4724–4761, 2010.
[14] D.E. Muller and F.P. Preparata. Finding the intersection of two convex polyhedra. Theoretical Computer Science, 7(2):217–236, 1978.
[15] James Edward Pilliod and Elbridge Gerry Puckett. Second-order accurate volume-of-fluid algorithms for tracking material interfaces. Journal of Computational Physics, 199(2):465–502, 2004.
[16] D Powell. r3d: Software for fast, robust geometric operations in 3d and 2d. Los Alamos National Laboratory, 2015.
[17] Devon Powell and Tom Abel. An exact general remeshing scheme applied to physically conservative voxelization. Journal of Computational Physics, 297:340–356, 2015.
[18] Kokichi Sugihara. A robust and consistent algorithm for intersecting convex polyhedra. Computer Graphics Forum, 13(3):45–54, 1994.
A Formula for Explicit Moments Computation
To properly define the moments, we will begin by considering three points from a triangular facet A, B, and C, along with the origin O, which form a tetrahedron . The geometric moments of the tetrahedron are the following, from Koehl [12].
The integral over the tetrahedron is the following [6]:
where
and the oriented volume, , of the tetrahedron is given by
By combining equations (2) and (3) we have that the geometric moments of the tetrahedron are
Using equation (6) the explicit moments of a tetrahedra from zero through third order are the following