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 LoggM = X + YThere is a subtle difference between defining x <strong>and</strong> y separately <strong>and</strong> thisalternative implementation (reusing the elements X,Y,M):u = Function(M)x, y = split(u)L = inner(grad(x), grad(x))*dx + dot(x,x)*y*dxF = derivative(L, u)J = derivative(F, u)The difference is that the forms here have one coefficient function u in themixed space, <strong>and</strong> the forms above have two coefficient functions x <strong>and</strong> y.TODO: Move this to implementation part? If you wonder how this is alldone, a brief explanation follows. Recall that a Function represents a sumof unknown coefficients multiplied with unknown basis functions in somefinite element space.w(x) = ∑ kw k φ k (x) (2.50)Also recall that a BasisFunction represents any (unknown) basis functionin some finite element space.v(x) = φ k (x), φ k ∈ V h . (2.51)A form L(v;w) implemented in <strong>UFL</strong> is intended for discretization likeb i = L(φ i ; ∑ kw k φ k ), ∀φ i ∈ V h . (2.52)The Jacobi matrix A ij of this vector can be obtained by differentiation of b iw.r.t. w j , which can be writtenA ij = db idw j= a(φ i ,φ j ; ∑ kw k φ k ), ∀φ i ∈ V h , ∀φ j ∈ V h , (2.53)56

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

Saved successfully!

Ooh no, something went wrong!