ufl.formatting package¶
Submodules¶
ufl.formatting.graph module¶
Algorithms for working with linearized computational graphs.
- class ufl.formatting.graph.Graph(expression)[source]¶
Bases:
object
Graph class which computes connectivity on demand.
- class ufl.formatting.graph.StringDependencyDefiner(argument_deps=None, coefficient_deps=None)[source]¶
Bases:
MultiFunction
Given an expr, returns a frozenset of its dependencies.
- Possible dependency values are:
“c” - depends on runtime information like the cell, local<->global coordinate mappings, facet normals, or coefficients “x” - depends on local coordinates “v%d” % i - depends on argument i, for i in [0,rank)
- ufl.formatting.graph.build_graph(expr)[source]¶
Build a linearized graph from an UFL Expr.
Returns G = (V, E), with V being a list of graph nodes (Expr objects) in post traversal ordering and E being a list of edges. Each edge is represented as a (i, j) tuple where i and j are vertex indices into V.
- ufl.formatting.graph.extract_incoming_edges(G)[source]¶
Build lists of incoming edges to each vertex in a linearized graph.
- ufl.formatting.graph.extract_incoming_vertex_connections(G)[source]¶
Build lists of vertices in incoming and outgoing edges to and from each vertex in a linearized graph.
Returns lists Vin and Vout.
- ufl.formatting.graph.extract_outgoing_edges(G)[source]¶
Build list of outgoing edges from each vertex in a linearized graph.
ufl.formatting.printing module¶
A collection of utility algorithms for printing of UFL objects, mostly intended for debugging purposes.
ufl.formatting.ufl2dot module¶
A collection of utility algorithms for printing of UFL objects in the DOT graph visualization language, mostly intended for debugging purposers.
- class ufl.formatting.ufl2dot.CompactLabeller(function_mapping=None)[source]¶
Bases:
ReprLabeller
- class ufl.formatting.ufl2dot.FancyLabeller(function_mapping=None)[source]¶
Bases:
CompactLabeller
- class ufl.formatting.ufl2dot.ReprLabeller[source]¶
Bases:
MultiFunction
ufl.formatting.ufl2unicode module¶
- class ufl.formatting.ufl2unicode.Expression2UnicodeHandler(argument_names=None, coefficient_names=None, colorama_bold=False)[source]¶
Bases:
MultiFunction
- class ufl.formatting.ufl2unicode.PrecedenceRules[source]¶
Bases:
MultiFunction
An enum-like class for C operator precedence levels.
- bessel_function(o)¶
- cell_avg(o)¶
- cofactor(o)¶
- component_tensor(o)¶
- cross(o)¶
- derivative(o)¶
- deviatoric(o)¶
- division(o)¶
- dot(o)¶
- facet_avg(o)¶
- ge(o)¶
- gt(o)¶
- index_sum(o)¶
- indexed(o)¶
- inner(o)¶
- le(o)¶
- list_tensor(o)¶
- math_function(o)¶
- max_value(o)¶
- min_value(o)¶
- ne(o)¶
- operator(o)¶
- outer(o)¶
- skew(o)¶
- sym(o)¶
- terminal(o)¶
- trace(o)¶
- class ufl.formatting.ufl2unicode.UC[source]¶
Bases:
object
An enum-like class for unicode characters.
- Gamma = 'Γ'¶
- Omega = 'Ω'¶
- bold_math_A = '𝐀'¶
- bold_math_a = '𝐚'¶
- circled_times = '⊗'¶
- combining_overline = '̅'¶
- combining_right_arrow_above = '⃗'¶
- cross_product = '⨯'¶
- division_slash = '∕'¶
- dot = '⋅'¶
- element_of = '∈'¶
- epsilon = 'ε'¶
- for_all = '∀'¶
- gamma = 'γ'¶
- ge = '≥'¶
- gt = '>'¶
- integral = '∫'¶
- integral_contour = '∮'¶
- integral_double = '∬'¶
- integral_surface = '∯'¶
- integral_triple = '∭'¶
- integral_volume = '∰'¶
- le = '≤'¶
- left_angled_bracket = '⟨'¶
- left_double_angled_bracket = '⟪'¶
- left_white_square_bracket = '⟦'¶
- logical_and = '∧'¶
- logical_not = '¬'¶
- logical_or = '∨'¶
- lt = '<'¶
- nabla = '∇'¶
- nary_product = '∏'¶
- ne = '≠'¶
- not_element_of = '∉'¶
- omega = 'ω'¶
- partial = '∂'¶
- right_angled_bracket = '⟩'¶
- right_double_angled_bracket = '⟫'¶
- right_white_squared_bracket = '⟧'¶
- sqrt = '√'¶
- subscript_digits = ['₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉']¶
- subscript_equals = '₌'¶
- subscript_left_paren = '₍'¶
- subscript_minus = '₋'¶
- subscript_plus = '₊'¶
- subscript_right_paren = '₎'¶
- sum = '∑'¶
- superscript_digits = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹']¶
- superscript_equals = '⁼'¶
- superscript_left_paren = '⁽'¶
- superscript_minus = '⁻'¶
- superscript_plus = '⁺'¶
- superscript_right_paren = '⁾'¶
- thin_space = '\u2009'¶
- transpose = 'ᵀ'¶