The gradient
module¶
-
class
pylife.mesh.gradient.
Gradient
(pandas_obj)[source]¶ Computes the gradient of a value in a 3D mesh
Accesses a mesh registered in
meshsignal
Raises: AttributeError
– if at least one of the columns x, y is missingAttributeError
– if the index of the DataFrame is not a two level MultiIndex with the names node_id and element_id
Notes
The gradient is calculated by fitting a plane into the nodes of each coordinate and the neigbor nodes usine least square fitting.
The method is described in a thread on stackoverflow.
-
gradient_of
(value_key)[source]¶ returns the gradient
Parameters: value_key (str) – The key of the value that forms the gradient. Needs to be found in df
Returns: gradient – A table describing the gradient indexed by node_id
. The keys for the components of the gradients are['dx', 'dy', 'dz']
.Return type: pd.DataFrame