Back to Finite Element (MFEM)
mfem.gridfunction.getGradient
Computes the gradient of a scalar grid function at a point within an element.
Syntax
mfem.gridfunction.getGradient(gf, elemIdx, ip)
Description
Computes the gradient of a scalar grid function at a point within an element. The gradient is computed in physical (not reference) coordinates. The result is a vector with components [∂f/∂x, ∂f/∂y, ∂f/∂z] (depending on dimension).
Parameters
| Name | Description |
|---|---|
| gf | - Scalar GridFunction to differentiate |
| elemIdx | - Index of the element containing the point (0-based) |
| ip | - Integration point in reference coordinates |
Returns
number[]