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
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 3Example FormsThe following examples illustrate basic usage of the form language for thedefinition of a collection of st<strong>and</strong>ard multilinear forms. We assume that dxhas been declared as an integral over the interior of Ω <strong>and</strong> that both i <strong>and</strong>j have been declared as a free Index.The examples presented below can all be found in the subdirectory demo/ ofthe <strong>UFL</strong> source tree together with numerous other examples.3.1 The mass matrixAsafirstexample, considerthebilinearformcorrespondingtoamassmatrix,∫a(v,u) = vudx, (3.1)which can be implemented in <strong>UFL</strong> as follows:Ωelement = FiniteElement("Lagrange", triangle, 1)v = TestFunction(element)u = TrialFunction(element)61