cashocs.MinMaxFunctional#
- class cashocs.MinMaxFunctional(
- integrand: ufl_legacy.Form,
- lower_bound: float | int | None = None,
- upper_bound: float | int | None = None,
- mu: float | int = 1.0,
- lambd: float | int = 0.0,
Bases:
FunctionalCost functional involving a maximum of 0 and a integral term squared.
Initializes self.
Methods Summary
Computes the ufl coefficients which are used in the functional.
derivative(argument, direction)Computes the derivative of the functional w.r.t.
evaluate()Evaluates the functional.
scale(scaling_factor)Scales the functional by a scalar.
update()Updates the functional after solving the state equation.
Methods Documentation
- Parameters:
integrand (ufl.Form)
lower_bound (float | int | None)
upper_bound (float | int | None)
mu (float | int)
lambd (float | int)
- coefficients() tuple[fenics.Function][source]#
Computes the ufl coefficients which are used in the functional.
- Returns:
The set of used coefficients.
- Return type:
tuple[fenics.Function]
- derivative(
- argument: ufl_legacy.core.expr.Expr,
- direction: ufl_legacy.core.expr.Expr,
Computes the derivative of the functional w.r.t. argument towards direction.
- Parameters:
argument (ufl_legacy.core.expr.Expr) – The argument, w.r.t. which the functional is differentiated
direction (ufl_legacy.core.expr.Expr) – The direction into which the derivative is computed
- Returns:
A form of the resulting derivative
- Return type:
ufl_legacy.Form
- evaluate() float[source]#
Evaluates the functional.
- Returns:
The current value of the functional.
- Return type:
float