pyrtid.utils#
pyRTID submodule providing tools and utilities for other submodules.
Working with dataclasses#
Utilities for python dataclasses.
|
Helper to set a default value for a dataclass field. |
Regular grids#
Provide utilities to work with regular grids.
|
Convert indices (ix, iy, iz) to a node-number. |
|
Convert a node-number to indices (ix, iy, iz) for a regular grid. |
|
Convert the given span to an array of node indices. |
|
Convert the given span to an array of node indices. |
|
Get a selection of the array border as a bool array. |
|
Get a selection of the array border as a bool array. |
|
Return the elements of a not found in b sorted by ascending order. |
|
Create an array of points coordinates for regular grids. |
|
Return a grid array containing the sel_ids as values. |
|
Represent a rectilinear 3D grid. |
Extend the selections using binary dilation. |
|
|
WellField#
Utilities to create wellfields.
|
Generate sequences of injectors and producers coordinates. |
Random fields#
Provide utilities to generate random fields. This is based on the GStools package.
|
Generate a (ne, nx, ny, nz) ensemble of 3D random fields. |
Get the mean of the normalized log-normal distribution. |
|
Get the standard deviation of the normalized log-normal distribution. |
|
Get the mean of the log-normalized normal distribution. |
|
Get the mean of the log-normalized normal distribution. |
Working string enums#
Provide a str enum class.u
|
Hashable string Enum. |
Numerical approximation by finite differences#
Provide functions to compute the gradient of a function by finite difference numerical approximation.
|
Compute the Jacobian by finite difference. |
|
Compute the gradient by finite difference. |
|
Return whether the two vectors are approximately equal. |
|
Check by finite difference if the Jacobian matrix is correct. |
|
Check by finite difference if the gradient is correct. |
Spatial differential operators#
Provide functions for spatial differentiation.
|
Compute the gradient using the first order forward differences. |
|
Compute the gradient using the first order forward differences. |
|
Compute the hessian matching gradient_ffd. |
Mean operators#
Provide functions to perform mean and their first derivative.
|
Return the arithmetic mean of xi and xj. |
|
Return the first derivative of xi and xj arithmetic mean with respect to xi. |
|
Return the harmonic mean of xi and xj. |
|
Return the first derivative of xi and xj arithmetic mean with respect to xi. |
|
|
|
Get the mean values for the last axis of the input array. |
|
Return the gradient of the weighted arithmetic mean. |
|
Return the gradient of the weighted geometric mean. |
|
Return the gradient of the harmonic arithmetic mean. |
|
Get the mean values for the last axis of the input array. |
Filters#
Provide some spatial filters
|
A gradient filter. |
|
Apply gaussian filter filtering. |
Others#
Other functions
Convert a singleton or an iterable of this object to a list of object. |
|
|
Get an incomplete LU preconditioner for the given sparse matrix. |
|
Show the versions of all packages used by pyrtid. |
|
Turn seed into a np.random.RandomState instance. |
Types#
Other functions
Sparse helpers#
Helpers to work with sparse matrices and sparse arrays.
|
|
|
Assert that two sparse matrices or arrays are almost equal. |