ffc.uflacs.backends.ffc package

Submodules

ffc.uflacs.backends.ffc.access module

FFC/UFC specific variable access.

class ffc.uflacs.backends.ffc.access.FFCBackendAccess(ir, language, symbols, parameters)[source]

Bases: ufl.corealg.multifunction.MultiFunction

FFC specific cpp formatter class.

cell_coordinate(e, mt, tabledata, num_points)[source]
cell_edge_vectors(e, mt, tabledata, num_points)[source]
cell_facet_jacobian(e, mt, tabledata, num_points)[source]
cell_normal(e, mt, tabledata, num_points)
cell_orientation(e, mt, tabledata, num_points)[source]
cell_vertices(e, mt, tabledata, num_points)[source]
coefficient(e, mt, tabledata, num_points)[source]
expr(e, mt, tabledata, num_points)[source]

Trigger error for types with missing handlers.

facet_coordinate(e, mt, tabledata, num_points)[source]
facet_edge_vectors(e, mt, tabledata, num_points)[source]
facet_jacobian(e, mt, tabledata, num_points)
facet_jacobian_determinant(e, mt, tabledata, num_points)
facet_jacobian_inverse(e, mt, tabledata, num_points)
facet_normal(e, mt, tabledata, num_points)
facet_orientation(e, mt, tabledata, num_points)[source]
float_value(e, mt, tabledata, num_points)[source]
int_value(e, mt, tabledata, num_points)[source]
jacobian(e, mt, tabledata, num_points)[source]
jacobian_determinant(e, mt, tabledata, num_points)
jacobian_inverse(e, mt, tabledata, num_points)
reference_cell_edge_vectors(e, mt, tabledata, num_points)[source]
reference_cell_volume(e, mt, tabledata, access)[source]
reference_facet_edge_vectors(e, mt, tabledata, num_points)[source]
reference_facet_volume(e, mt, tabledata, access)[source]
reference_normal(e, mt, tabledata, access)[source]
spatial_coordinate(e, mt, tabledata, num_points)[source]
zero(e, mt, tabledata, num_points)[source]

ffc.uflacs.backends.ffc.backend module

Collection of FFC specific pieces for the code generation phase.

class ffc.uflacs.backends.ffc.backend.FFCBackend(ir, parameters)[source]

Bases: object

Class collecting all aspects of the FFC backend.

ffc.uflacs.backends.ffc.common module

FFC/UFC specific symbol naming.

ffc.uflacs.backends.ffc.common.num_coordinate_component_dofs(coordinate_element)[source]

Get the number of dofs for a coordinate component for this degree.

This is a local hack that works for Lagrange 1-3, better would be to get this passed by ffc from fiat through the ir. The table data is to messy to figure out a clean design for that quickly.

ffc.uflacs.backends.ffc.common.ufc_restriction_offset(restriction, length)[source]

ffc.uflacs.backends.ffc.definitions module

FFC/UFC specific variable definitions.

class ffc.uflacs.backends.ffc.definitions.FFCBackendDefinitions(ir, language, symbols, parameters)[source]

Bases: ufl.corealg.multifunction.MultiFunction

FFC specific code definitions.

argument(t, mt, tabledata, num_points, access)[source]

Arguments are accessed through element tables.

cell_coordinate(e, mt, tabledata, num_points, access)[source]

Return definition code for the reference spatial coordinates.

If reference coordinates are given:

No definition needed.

If physical coordinates are given and domain is affine:

X = K*(x-x0)

This is inserted symbolically.

If physical coordinates are given and domain is non- affine:

Not currently supported.
cell_edge_vectors(e, mt, tabledata, num_points, access)

These quantities refer to coordinate_dofs

cell_facet_jacobian(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

cell_normal(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

cell_orientation(e, mt, tabledata, num_points, access)[source]
cell_vertices(e, mt, tabledata, num_points, access)

These quantities refer to coordinate_dofs

coefficient(t, mt, tabledata, num_points, access)[source]

Return definition code for coefficients.

constant_value(e, mt, tabledata, num_points, access)[source]

Constants simply use literals in the target language.

expr(t, mt, tabledata, num_points, access)[source]

Trigger error for types with missing handlers.

facet_edge_vectors(e, mt, tabledata, num_points, access)

These quantities refer to coordinate_dofs

facet_jacobian(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

facet_jacobian_determinant(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

facet_jacobian_inverse(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

facet_normal(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

facet_orientation(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

jacobian(e, mt, tabledata, num_points, access)[source]

Return definition code for the Jacobian of x(X).

J = sum_k xdof_k grad_X xphi_k(X)

jacobian_determinant(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

jacobian_inverse(e, mt, tabledata, num_points, access)

These quantities are expected to be replaced in symbolic preprocessing.

reference_cell_edge_vectors(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

reference_cell_volume(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

reference_facet_edge_vectors(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

reference_facet_volume(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

reference_normal(e, mt, tabledata, num_points, access)

These quantities refer to constant tables defined in ufc_geometry.h.

spatial_coordinate(e, mt, tabledata, num_points, access)[source]

Return definition code for the physical spatial coordinates.

If physical coordinates are given:
No definition needed.
If reference coordinates are given:
x = sum_k xdof_k xphi_k(X)
If reference facet coordinates are given:
x = sum_k xdof_k xphi_k(Xf)

ffc.uflacs.backends.ffc.symbols module

FFC/UFC specific symbol naming.

class ffc.uflacs.backends.ffc.symbols.FFCBackendSymbols(language, coefficient_numbering)[source]

Bases: object

FFC specific symbol definitions. Provides non-ufl symbols.

J_component(mt)[source]

Jacobian component.

X_component(mt)[source]

Reference coordinate component.

argument_loop_index(iarg)[source]

Loop index for argument #iarg.

cell_orientation_argument(restriction)[source]

Cell orientation argument in ufc. Not same as cell orientation in generated code.

cell_orientation_internal(restriction)[source]

Internal value for cell orientation in generated code.

coefficient_dof_access(coefficient, dof_number)[source]
coefficient_dof_sum_index()[source]

Index for loops over coefficient dofs, assumed to never be used in two nested loops.

coefficient_value(mt)[source]

Symbol for variable holding value or derivative component of coefficient.

custom_points_table()[source]

Table for chunk of custom quadrature points (physical coordinates).

custom_quadrature_points()[source]

Physical quadrature points, argument to custom integrals.

custom_quadrature_weights()[source]

Quadrature weights including cell measure scaling, argument to custom integrals.

custom_weights_table()[source]

Table for chunk of custom quadrature weights (including cell measure scaling).

domain_dof_access(dof, component, gdim, num_scalar_dofs, restriction)[source]
domain_dofs_access(gdim, num_scalar_dofs, restriction)[source]
element_table(tabledata, entitytype, restriction)[source]
element_tensor()[source]

Symbol for the element tensor itself.

entity(entitytype, restriction)[source]

Entity index for lookup in element tables.

num_custom_quadrature_points()[source]

Number of quadrature points, argument to custom integrals.

points_table(num_points)[source]

Table of quadrature points (points on the reference integration entity).

quadrature_loop_index()[source]

Reusing a single index name for all quadrature loops, assumed not to be nested.

weights_table(num_points)[source]

Table of quadrature weights.

x_component(mt)[source]

Physical coordinate component.

ffc.uflacs.backends.ffc.symbols.format_mt_name(basename, mt)[source]

Format variable name for modified terminal.

ffc.uflacs.backends.ffc.symbols.ufc_restriction_postfix(restriction)[source]

Module contents

The FFC specific backend to the UFLACS form compiler algorithms.