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 Loggthe facet (as seen from each of the two neighboring cells). If v is scalar, thenjump(v, n) is given byjump(v, n) ↔ v n = v + n + +v − n − . (2.46)If v is vector-valued, then jump(v, n) is given byjump(v, n) ↔ v n = v + ·n + +v − ·n − . (2.47)Thus, if the expression v is scalar, then jump(v, n) will be vector-valued,<strong>and</strong> if v is vector-valued, then jump(v, n) will be scalar.2.1<strong>0.3</strong> Average: avg(v)The operator avg may be used to express the average of an expression acrossa common facet of two cells:avg(v) ↔ 〈v〉 = 1 2 (v+ +v − ). (2.48)The expression avg(v) has the same value shape as the expression v.2.11 Conditional Operators2.11.1 Conditional<strong>UFL</strong> has limited support for branching, but for some PDEs it is needed. Theexpression c inc = conditional(condition, true_value, false_value)evaluates to true value at run-time if condition evaluates to true, or tofalse value otherwise.ThiscorrespondstotheC++syntax(condition ? true value: false value),or the Python syntax (true value if condition else false value),48

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

Saved successfully!

Ooh no, something went wrong!