cashocs.IntegralFunctional#

class cashocs.IntegralFunctional(form: ufl_legacy.Form)[source]#

Bases: Functional

A functional which is given by the integral of form.

Initializes self.

Parameters:

form (ufl.Form) – The form of the integrand, which is to be calculated for evaluating the functional.

Methods Summary

coefficients()

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

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) ufl_legacy.Form[source]#

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

scale(scaling_factor: float | int) None[source]#

Scales the functional by a scalar.

Parameters:

scaling_factor (float | int) – The scaling factor used to scale the functional

Return type:

None

update() None[source]#

Updates the functional after solving the state equation.

Return type:

None