3.4 enforv3d – PLIC interface location for arbitrary polyhedra

The enforv3d routine addresses the VCE problem in 3D, specifically aiming to locate the PLIC interface within a polyhedral cell. The subroutine can be invoked in Fortran, C, and Python as follows:

Fortran:

call enforv3d(c,ipv,nipv,ntp,nts,ntv,v,vt,vertp,xnc,xns, &
              ync,yns,znc,zns)

C:

enforv3d(&c,ipv,nipv,&ntp,&nts,&ntv,&v,&vt,vertp,&xnc,xns,
&ync,yns,&znc,zns);

Python:

c = voft.enforv3d(ipv,nipv,ntp,nts,ntv,v,vt,vertp,xnc,xns,
ync,yns,znc,zns)

Arguments:

c

OUT

W_P

scalar representing the signed distance from the PLIC interface to the origin along the normal vector \(\boldsymbol{n}\)

ipv

IN

I_P

array of dimensions (ns,nv) storing the vertex indices defining each face boundary

nipv

IN

I_P

array of length \(\texttt{ns}\) storing the number of vertices per face boundary

ntp

IN

I_P

maximum vertex index in the connectivity list

nts

IN

I_P

total number of face boundaries

ntv

IN

I_P

total number of vertices

v

IN

W_P

scalar representing the target liquid volume within the cell

vt

IN

W_P

scalar representing the total volume of the polyhedron

vertp

IN

W_P

array of dimensions \(({nv},3)\) storing the \(x,y,z\)-coordinates of each vertex

xnc, ync, znc

IN

W_P

\(x,y,z\)-components of the unit-length vector \(\boldsymbol{n}\) normal to the PLIC interface pointing towards the liquid phase

xns, yns, zns

IN

W_P

arrays of length \(\texttt{ns}\) storing the \(x,y,z\)-components of the outward-pointing unit normal vector for each face boundary

Note: This routine is intended for the original, untruncated cell geometry, with (\(\texttt{ntp}=\texttt{ntv}\)). The total cell volume must satisfy \(\texttt{vt}>0\), and the target liquid volume must satisfy \(0\leq \texttt{v}\leq \texttt{vt}\). The argument \(\texttt{v}\) is a volume, not a volume fraction; for a prescribed liquid volume fraction \(\alpha\), use \(\texttt{v}=\alpha\,\texttt{vt}\).

If \(\texttt{vt}\leq0\) or \(\texttt{ntp}>\texttt{ntv}\), the routine prints a diagnostic message and returns without assigning a valid value to c.