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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>UFL</strong> <strong>Specification</strong> <strong>and</strong> <strong>User</strong> <strong>Manual</strong> <strong>0.3</strong>Martin S. Alnæs, Anders Loggb = u*v*dx - f*v*dxa, L = lhs(b), rhs(b)Notethatrhsmultipliestheextractedtermsby−1, correspondingtomovingthem from left to right, so this is equivalent toa = u*v*dxL = f*v*dxAs a slightly more complicated example, this formulationF = v*(u - w)*dx + k*dot(grad(v), grad(0.5*(w + u)))*dxa, L = lhs(F), rhs(F)is equivalent toa = v*u*dx + k*dot(grad(v), 0.5*grad(u))*dxL = v*w*dx - k*dot(grad(v), 0.5*grad(w))*dx2.13.6 Automatic Functional Differentiation<strong>UFL</strong> can compute derivatives of functionals or forms w.r.t. to a Function.This functionality can be used for example to linearize your nonlinear residualequation automatically, or derive a linear system from a functional, orcompute sensitivity vectors w.r.t. some coefficient.A functional can be differentiated to obtain a linear form,F(v;w) = ddw f(;w)53

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

Saved successfully!

Ooh no, something went wrong!