3.9 intv3d – Half-space integration volume for arbitrary polyhedra

The intv3d routine computes the signed volume of the portion of a polyhedron lying in the half-space \(\mathbf n\cdot\mathbf x+\texttt{c}>0\). This corresponds to the liquid-side convention used by inte3d. The sign of the volume follows the boundary orientation convention described for toolv3d.

Fortran:

call intv3d(c,ipv,nipv,ntp,nts,vertp,vol,xnc,xns, &
    ync,yns,znc,zns)

C:

intv3d(&c,ipv,nipv,&ntp,&nts,vertp,&vol,&xnc,xns,
&ync,yns,&znc,zns);

Python:

vol = voft.intv3d(c,ipv,nipv,ntp,nts,vertp,xnc,xns,ync,yns,znc,zns)

Arguments:

c

IN

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

vertp

INOUT

W_P

array of dimensions \((\texttt{nv},3)\) containing the vertex coordinates; rows beyond ntp are used to store additional intersection vertices during the calculation

vol

OUT

W_P

scalar representing the signed volume of the portion of the polyhedron lying within the half-space (liquid volume)

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:

Unlike inte3d, this routine does not return a complete representation of the truncated geometry. The original connectivity, size parameters, face normals, and vertex coordinates up to index ntp remain unchanged. However, additional intersection coordinates may be written to vertp beyond ntp, so the array must have sufficient capacity. In Python, vertp must be a writable, Fortran-contiguous NumPy array of the required data type.