extract
¶
Coefficient extraction: factor a target vector out of an expression.
extract_from_scalar — coefficient of vec in a scalar expression extract_from_vector — coefficient of vec in a vector expression extract_from_matrix — coefficient of vec in a matrix expression (partial)
extract_coeff(expr, vec) dispatches based on expr.type.
Assumes vec appears linearly (degree 1) in each term. Expressions where vec appears on both sides of a product (e.g. Dot(v, v), Mul with vec in both operands) raise NotImplementedError.
extract_coeff(expr, vec)
¶
Extract the coefficient of vec from expr.
Dispatches to extract_from_scalar / extract_from_vector / extract_from_matrix based on expr.type.
Source code in geomech/core/math/extract.py
extract_from_matrix(expr, vec)
¶
Extract the coefficient of vec from a matrix expression.
Partial — only limited cases supported.
Source code in geomech/core/math/extract.py
extract_from_scalar(expr, vec)
¶
Extract the coefficient of vec from a scalar expression.
Source code in geomech/core/math/extract.py
extract_from_vector(expr, vec)
¶
Extract the coefficient of vec from a vector expression.