cashocs.InequalityConstraint#

class cashocs.InequalityConstraint(variable_function: ufl.Form | ufl_expr.Expr, lower_bound: float | fenics.Function | None = None, upper_bound: float | fenics.Function | None = None, measure: ufl.Measure | None = None)[source]#

Bases: Constraint

Models an (additional) inequality constraint.

Initializes self.

Parameters:
  • variable_function (ufl.Form | ufl_expr.Expr) – Either a UFL Form (when we have a scalar / integral constraint) or an ufl expression (when we have a pointwise constraint), which models the part that is to be constrained

  • lower_bound (float | fenics.Function | None) – The lower bound for the inequality constraint

  • upper_bound (float | fenics.Function | None) – The upper bound for the inequality constraint

  • measure (ufl.Measure | None) – A measure indicating where a pointwise constraint should be satisfied.

Methods Summary

constraint_violation()

Computes the constraint violation for the problem.

Attributes Summary

Methods Documentation

constraint_violation() float[source]#

Computes the constraint violation for the problem.

Returns:

The computed violation

Return type:

float

Attributes Documentation

multiplier: fenics.Function#
target: float#
min_max_term: cost_functional.MinMaxFunctional#
lower_bound: fenics.Function | float#
upper_bound: fenics.Function | float#