3.8 toolv3d – Volume computation for arbitrary polyhedra¶
The toolv3d routine computes the volume of an arbitrary polyhedron.
Fortran:
call toolv3d(ipv,nipv,nts,vertp,vol,xns,yns,zns)
C:
toolv3d(ipv,nipv,&nts,vertp,&vol,xns,yns,zns);
Python:
vol = voft.toolv3d(ipv,nipv,nts,vertp,xns,yns,zns)
Arguments:
|
|
|
array of dimensions |
|
|
|
array of length \(\texttt{ns}\) storing the number of vertices per face boundary |
|
|
|
total number of face boundaries |
|
|
|
array of dimensions \(({nv},3)\) storing the \(x,y,z\)-coordinates of each vertex |
|
|
|
scalar representing the signed volume of the polyhedron |
|
|
|
arrays of length \(\texttt{ns}\) storing the \(x,y,z\)-components of the outward-pointing unit normal vector for each face boundary |
Note: The routine computes an algebraic volume whose sign depends on the orientation of the face boundaries. Negative values are preserved and may be meaningful, for example when oriented donating polyhedra are used to represent fluid transport across cell faces. In such applications, the sign distinguishes inflow from outflow according to the adopted orientation convention.