3.10 intc3d – Arithmetic mean of intersection vertices for arbitrary polyhedra¶
The tintc3d routine computes the arithmetic mean of the intersection points generated where the polyhedron edges cross the plane \(\mathbf n\cdot\mathbf x+\texttt{c}=0\). The result is returned as the three-component vector cen in global coordinates.
This provides a representative point for the cut feature, useful for initializing PLIC fitting procedures.
Fortran:
call intc3d(c,cen,iecen,ipv,nipv,ntp,nts,vertp,xnc,ync,znc)
C:
intc3d(&c,cen,&iecen,ipv,nipv,&ntp,&nts,vertp,&xnc,&ync,&znc);
Python:
(cen,iecen) = voft.intc3d(c,ipv,nipv,ntp,nts,vertp,xnc,ync,znc)
Arguments:
|
|
|
scalar representing the signed distance from the PLIC interface to the origin along the normal vector \(\boldsymbol{n}\) |
|
|
|
vector representing the arithmetic mean of the intersection vertex coordinates |
|
|
|
integer status flag: 1 if successful, 0 otherwise |
|
|
|
array of dimensions |
|
|
|
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 |
|
|
|
array of dimensions \(({nv},3)\) containing the vertex coordinates; rows beyond |
|
|
|
\(x,y,z\)-components of the unit-length vector \(\boldsymbol{n}\) normal to the PLIC interface pointing towards the liquid phase |
Note:¶
The routine preserves the original connectivity, size parameters, and vertex coordinates up to index ntp, but may write intersection coordinates to subsequent rows of vertp. The array must therefore have sufficient capacity and, in Python, must be writable and Fortran-contiguous.
Use cen only when iecen=1. When iecen=0, no intersection-point mean has been computed, and cen is set to zero.
The result is an arithmetic mean of intersection points, not an area-weighted centroid. For non-convex or disconnected sections, this point need not lie within the section.
To compute the area centroid of the planar section, use inte3d to generate the truncated geometry, identify the face boundaries created by the cut, and compute the centroid by post-processing.