Utility Classes and Functions (discretize.utils
)#
The utils
package contains utilities for helping with common operations involving
discrete meshes
Utility Classes#
|
Class for determining property tensor type. |
|
Carries out arithmetic operations between 0 and arbitrary quantities. |
|
Carries out arithmetic operations involving the identity. |
Utility Functions#
Code Utilities#
|
Determine if the input argument is a scalar. |
|
Coerce the given array to have dim columns. |
|
Decorate a function with soft dependencies. |
Coordinate Transform Utilities#
|
Rotate a set of xyz locations about a specified point. |
|
Generate a 3x3 rotation matrix defining the rotation from vector v0 to v1. |
|
Transform from cylindrical to cartesian coordinates. |
|
Transform from cartesian to cylindrical coordinates. |
Interpolation Utilities#
|
Generate interpolation matrix which maps a tensor quantity to a set of locations. |
|
Volume averaging interpolation between meshes. |
IO utilities#
Matrix Utilities#
|
Coerce a vector to the specified dimensionality. |
|
Generate sparse diagonal matrix from a vector. |
|
Return inverse of a sparse diagonal matrix. |
|
Generate sparse identity matrix. |
|
Compute kronecker products between 3 sparse matricies. |
|
Generate sparse matrix of zeros of shape=(n1, n2). |
|
Create 1D difference (derivative) operator from nodes to centers. |
|
Create 1D averaging operator from nodes to cell-centers. |
|
Create 1D averaging operator from cell-centers to nodes. |
|
Generate gridded locations for 1D, 2D, or 3D tensors. |
|
Return subscripts of tensor grid elements from indices. |
|
Return indices of tensor grid elements from subscripts. |
|
Extract a subarray. |
|
Invert a set of 3x3 matricies from vectors containing their elements. |
|
Invert a set of 2x2 matricies from vectors containing their elements. |
Invert a set of 2x2 or 3x3 matricies. |
|
|
Construct the physical property tensor. |
|
Construct the inverse of the physical property tensor. |
|
Compute the cross product of two vectors. |
Mesh Utilities#
|
Unpack a condensed representation of cell widths or time steps. |
|
Find the indicies for the nearest grid location for a set of points. |
|
Extract the core mesh from a global mesh. |
|
Create random tensor model. |
|
Refine region within a |
|
Return boolean array indicating which cells are below surface. |
|
Generate a tensor or tree mesh using a cloud of points. |
Utilities for Curvilinear Meshes#
|
Create the gridded node locations for a curvilinear mesh. |
|
Return the tetrahedron volumes for a specified set of verticies. |
|
Return normal surface vectors and areas for a given set of faces. |
|
Return the index of nodes on a tensor (or curvilinear) mesh. |