FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
104 stars 64 forks source link

Implements the perp operator as a class #184

Closed tommbendall closed 1 year ago

tommbendall commented 1 year ago

The perp operation is currently implemented as function:

lambda u: as_vector([-u[1], u[0]])

This create problems for the form manipulation language used in Firedrake's Gusto package. When we try to use UFL's replacement routines on a perp-ed vector, the perp-ed vector is not recognised as an operation on the original vector.

This PR addresses this by implementing perp as a class Perp, just as other operations such as the cross product are implemented.