Fixed Gradient#
Module for defining the fixed gradient equation.
- class FixedGradient(value, components=None, d=None)[source]#
Bases:
EquationEquation to enforce a fixed gradient for a specific condition.
- Example:
>>> from pina.equation import FixedGradient >>> eq = FixedGradient(value=0.0) >>> # Use within a Condition: >>> # condition = Condition(domain=domain, equation=eq)
Initialization of the
FixedGradientclass.- Parameters:
value (float) – The fixed value to be enforced to the gradient.
components (str | list[str]) – The name of the output variables for which the fixed gradient condition is applied. It should be a subset of the output labels. If
None, all output variables are considered. Default isNone.d (str | list[str]) – The name of the input variables on which the gradient is computed. It should be a subset of the input labels. If
None, all the input variables are considered. Default isNone.
- Raises:
ValueError – If
valueis neither a float nor an integer.ValueError – If, when provided,
componentsis neither a string nor a list of strings.ValueError – If, when provided,
dis neither a string nor a list of strings.