gruvoc.volcomp
: Functions to calculate element volumes¶
This module contains functions to compute the volumes of the four basic unstructured volume types.
- cape.gruvoc.volcomp.hexvol(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, x5, y5, z5, x6, y6, z6, x7, y7, z7, x8, y8, z8)¶
Compute the volume of a hex cell
The hex is constructed so that 1,2,3,4 are counterclockwise at the base and 5,6,7,8 at the top counterclockwise.
This function works by dividing the 8-node hexahedron by splitting it into two triangular prisms.
- Call:
>>> v = hexvol(x1, y1, z1, x2, ..., x8, y8, z8)
- Inputs:
- x1:
float
|np.ndarray
X-coordinates of point 1
- y1:
float
|np.ndarray
Y-coordinates of point 1
- z1:
float
|np.ndarray
Z-coordinates of point 1
- x8:
float
|np.ndarray
X-coordinates of point 8
- y8:
float
|np.ndarray
Y-coordinates of point 8
- z8:
float
|np.ndarray
Z-coordinates of point 8
- x1:
- Outputs:
- v:
float
|np.ndarray
Volume of each prism
- v:
- cape.gruvoc.volcomp.privol(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, x5, y5, z5, x6, y6, z6)¶
Compute the volume of a triangular prism
The prism is constructed so that 1,2,3 are counterclockwise at the base and 4,5,6 at the top counterclockwise.
This function works by dividing the 6-node pentahedron by splitting it into a pyramid and tetrahedron.
- Call:
>>> v = privol(x1, y1, z1, x2, ..., x6, y6, z6)
- Inputs:
- x1:
float
|np.ndarray
X-coordinates of point 1
- y1:
float
|np.ndarray
Y-coordinates of point 1
- z1:
float
|np.ndarray
Z-coordinates of point 1
- x6:
float
|np.ndarray
X-coordinates of point 6
- y6:
float
|np.ndarray
Y-coordinates of point 6
- z6:
float
|np.ndarray
Z-coordinates of point 6
- x1:
- Outputs:
- v:
float
|np.ndarray
Volume of each prism
- v:
- cape.gruvoc.volcomp.pyrvol(xa, ya, za, xb, yb, zb, xc, yc, zc, xd, yd, zd, xp, yp, zp)¶
Compute the volume of a pentahedral pyramid
The base of the points are A,B,C,D counterclockwise viewed from apex P. All inputs can be either scalars or vectors, but each input that is a vector must have the same shape. The output is a scalar if and only if all 15 inputs are scalar.
- Call:
>>> v = pyrvol(xa, ya, za, xb, ..., zd, xp, yp, zp)
- Inputs:
- xa:
float
|np.ndarray
X-coordinates of base point(s) A
- ya:
float
|np.ndarray
Y-coordinates of base point(s) A
- za:
float
|np.ndarray
Z-coordinates of base point(s) A
- xp:
float
|np.ndarray
X-coordinates of vertex point(s)
- yp:
float
|np.ndarray
Y-coordinates of vertex point(s)
- zp:
float
|np.ndarray
Z-coordinates of vertex point(s)
- xa:
- Outputs:
- v:
float
|np.ndarray
Volume of each pyramid
- v:
- cape.gruvoc.volcomp.tetvol(xa, ya, za, xb, yb, zb, xc, yc, zc, xd, yd, zd)¶
Compute the volume of a tetrahedron All inputs can be either scalars or vectors, but each input that is a vector must have the same shape. The output is a scalar if and only if all 15 inputs are scalar.
- Call:
>>> v = tetvol(xa, ya, za, xb, ..., zc, xd, yd, zd)
- Inputs:
- xa:
float
|np.ndarray
X-coordinates of base point(s) A
- ya:
float
|np.ndarray
Y-coordinates of base point(s) A
- za:
float
|np.ndarray
Z-coordinates of base point(s) A
- xa:
- Outputs:
- v:
float
|np.ndarray
Volume of each tetrahedron
- v: