3.2 Polyhedron and polygon geometries¶
VOFTools allows for the representation of arbitrary convex and non-convex polyhedral and polygonal geometries.
While Table 3.3 summarizes the specific cell types implemented in the test programs of Section 4, the core library enables users to define arbitrary polytopes beyond this predefined set. These geometries are defined by invoking specific initialization routines that return the necessary geometric parameters.
The geometry of polyhedra and polygons is represented using connectivity arrays and coordinate lists. To maintain compatibility with fixed-dimension buffers and avoid jagged array complexities, these quantities are physically allocated with a maximum capacity ns (for faces) or nv (for vertices). However, their logical sizes correspond to the actual number of entities (e.g., \(\texttt{nts}\) for face boundaries and \(\texttt{ntv}\) for vertices). This convention ensures that routines operate on logical arrays of the appropriate size while respecting the allocated physical buffers of size ns or nv.
Figs. 3.1 and 3.2 illustrate representative cells using the polout2d (Section 3.30) and polout3d (Section 3.20) visualization routines in conjunction with Gnuplot [16] and ParaView [3], respectively. The routine name corresponding to each geometry is indicated within the figures.
As an example, the calling conventions for a cubic cell are provided below for Fortran (blue background), C (green background) and Python (red background):
Fortran:
call voftools_cube(ipv,nipv,ntp,nts,ntv,vertp,xns,yns,zns)
C:
voftools_cube(ipv,nipv,&ntp,&nts,&ntv,vertp,xns,yns,zns);
Python:
(ipv,nipv,ntp,nts,ntv,vertp,xns,yns,zns) = voft.voftools_cube()
Figure 3.3. Detailed definition of the non-convex pentagonal pyramid shown in Fig. 3.2. See the source code of the routine voftools_ncpentapy for parameter definitions. Note that the values of the face normal components (xns, yns, zns) are rounded in the figure for clarity. The red arrow indicates the counterclockwise order of the vertices for face boundary 2 when viewed from the exterior of the polyhedron, consistent with the outward-pointing normal convention.¶
Arguments:
Argument |
Intent |
Type |
Definition |
|---|---|---|---|
|
|
|
array of dimensions \((\texttt{ns},\texttt{nv})\) storing the vertex indices defining each face boundary |
|
|
|
array of length \({\texttt{ns}}\) storing the number of vertices per face boundary |
|
|
|
maximum vertex index in the connectivity list |
|
|
|
total number of face boundaries |
|
|
|
total number of vertices |
|
|
|
array of dimensions \(({nv},3)\) storing the \(x,y,z\)-coordinates of each vertex |
|
|
|
arrays of length \(\texttt{ns}\) storing the \(x,y,z\)-components of the outward-pointing unit normal vectors for each face boundary |
To illustrate a specific example, Fig. 3.3 depicts the non-convex pentagonal pyramid defined by the supplied routine voftools_ncpentapy (also shown in Fig. 3.2).
For a square cell,
Fortran:
call voftools_square(ipv,ntp,ntv,vertp)
C:
voftools_square(ipv,&ntp,&ntv,vertp);
Python:
(ipv,ntp,ntv,vertp) = voft.voftools_square()
Arguments:
Argument |
Intent |
Type |
Definition |
|---|---|---|---|
|
|
|
array of length \(\texttt{nv}\) storing the vertex indices defining the polygon |
|
|
|
maximum vertex index in the connectivity list |
|
|
|
total number of vertices |
|
|
|
array of dimensions \(({nv},2)\) storing the \(x,y\)-coordinates of each vertex |
Note 1:¶
Initially, \(\texttt{ntp}=\texttt{ntv}\) for the defined polytope. However, if subsequent intersection operations are performed on the polytope, these values may diverge for the resulting truncated geometry. This is because \(\texttt{ntp}\) tracks the maximum vertex index in the connectivity list, while \(\texttt{ntv}\) counts the total count of unique vertices.
Note 2:¶
For detailed definitions of these parameters and their specific roles within the example geometry-defining routines, please refer to the source code of each respective routine.
Similarly, the arguments and calling conventions for the remaining routines in the VOFTools library (voftools.f90) are described in detail below.
To distinguish variables corresponding to different states of a geometric entity (e.g., before and after an operation), numerical suffixes are appended to the parameter names.