13.07.2015 Views

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>UFL</strong> <strong>Specification</strong> <strong>and</strong> <strong>User</strong> <strong>Manual</strong> <strong>0.3</strong>Martin S. Alnæs, Anders Loggf = energy_norm(a, w)which is equivalent tof = action(action(a, w), w)2.13.4 Adjoint of a bilinear FormThe adjoint a ′ of a bilinear form a is defined asa ′ (u,v) = a(v,u).This operation is implemented in <strong>UFL</strong> simply by swapping test <strong>and</strong> trialfunctions in a Form, <strong>and</strong> is used like this:aprime = adjoint(a)2.13.5 Linear <strong>and</strong> bilinear parts of a FormSome times it is useful to write an equation on the formata(v,u)−L(v) = 0.Before we can assemble the linear equationAu = b,we need to extract the forms corresponding to the left h<strong>and</strong> side <strong>and</strong> righth<strong>and</strong> side. This corresponds to extracting the bilinear <strong>and</strong> linear terms ofthe form respectively, or the terms that depend on both a test <strong>and</strong> a trialfunction on one side <strong>and</strong> the terms that depend on only a test function onthe other.This is easily done in <strong>UFL</strong> using lhs <strong>and</strong> rhs:52

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!