cashocs.EqualityConstraint#

class cashocs.EqualityConstraint(variable_function: ufl.Form | ufl_expr.Expr, target: float, measure: ufl.Measure | None = None)[source]#

Bases: Constraint

Models an (additional) equality 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.

  • target (float) – The target (rhs) of the equality 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#