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 LoggThe ordering of the vertices in the graph can in principle be arbitrary, buthere they are ordered such thatv i ≺ v j , ∀j > i, (5.3)where a ≺ b means that a does not depend on b directly or indirectly.Another property of the computational graph built by <strong>UFL</strong> is that no identicalexpressionisassignedtomorethanonevertex.Thisisachievedefficientlyby inserting expressions in a dict (a hash map) during graph building.In principle, correct code can be generated for an expression from its computationalgraph simply by iterating over the vertices <strong>and</strong> generating codefor each one separately. However, we can do better than that.5.4.2 Partitioning the graphTo help generate better code efficiently, we can partition vertices by their dependencies,which allows us to, e.g., place expressions outside the quadratureloop if they don’t depend (directly or indirectly) on the spatial coordinates.This is done simply byP = partition(G) # TODOTODO: finish dependencies.pyTODO91

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

Saved successfully!

Ooh no, something went wrong!