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 LoggAlternatively, using the shorth<strong>and</strong> lambda notation, the strain operator maybe defined as follows:epsilon = lambda v: 0.5*(grad(v) + grad(v).T)2.13 Form TransformationsWhen you have defined a Form, you can derive new related forms from itautomatically. <strong>UFL</strong> defines a set of common form transformations describedin this section.2.13.1 Replacing arguments of a FormThe function replace lets you replace terminal objects with other values,using a mapping defined by a Python dict. This can be used for example toreplace a Function with a fixed value for optimized runtime evaluation.f = Function(element)g = Function(element)c = Constant(cell)a = f*g*v*dxb = replace(a, { f: 3.14, g: c })The replacement values must have the same basic properties as the originalvalues, in particular value shape <strong>and</strong> free indices.2.13.2 Action of a form on a functionThe action of a bilinear form a is defined asb(v;w) = a(v,w),50

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

Saved successfully!

Ooh no, something went wrong!