ffc.uflacs.backends.ufc package¶
Submodules¶
ffc.uflacs.backends.ufc.apply_mappings module¶
ffc.uflacs.backends.ufc.coordinate_mapping module¶
-
ffc.uflacs.backends.ufc.coordinate_mapping.
generate_assign_inverse
(L, K, J, detJ, gdim, tdim)[source]¶
-
ffc.uflacs.backends.ufc.coordinate_mapping.
generate_compute_ATA
(L, ATA, A, m, n, index_prefix='')[source]¶ Generate code to declare and compute ATA[i,j] = sum_k A[k,i]*A[k,j] with given A shaped (m,n).
-
class
ffc.uflacs.backends.ufc.coordinate_mapping.
ufc_coordinate_mapping
[source]¶ Bases:
ffc.uflacs.backends.ufc.generator.ufc_generator
Each function maps to a keyword in the template. See documentation of ufc_generator.
ffc.uflacs.backends.ufc.dofmap module¶
-
class
ffc.uflacs.backends.ufc.dofmap.
ufc_dofmap
[source]¶ Bases:
ffc.uflacs.backends.ufc.generator.ufc_generator
Each function maps to a keyword in the template. See documentation of ufc_generator.
ffc.uflacs.backends.ufc.evalderivs module¶
Work in progress translation of FFC evaluatebasis code to uflacs CNodes format.
ffc.uflacs.backends.ufc.evaluatebasis module¶
Work in progress translation of FFC evaluatebasis code to uflacs CNodes format.
-
ffc.uflacs.backends.ufc.evaluatebasis.
generate_compute_basisvalues
(L, dofs_data, element_cellname, tdim, X, ip)[source]¶
-
ffc.uflacs.backends.ufc.evaluatebasis.
generate_evaluate_reference_basis
(L, data, parameters)[source]¶ Generate code to evaluate element basisfunctions at an arbitrary point on the reference element.
The value(s) of the basisfunction is/are computed as in FIAT as the dot product of the coefficients (computed at compile time) and basisvalues which are dependent on the coordinate and thus have to be computed at run time.
The function should work for all elements supported by FIAT, but it remains untested for tensor valued elements.
This code is adapted from code in FFC which computed the basis from physical coordinates, and also to use UFLACS utilities.
The FFC code has a comment “From FIAT_NEW.polynomial_set.tabulate()”.
ffc.uflacs.backends.ufc.evaluatebasisderivatives module¶
Work in progress translation of FFC evaluatebasisderivatives code to uflacs CNodes format.
-
ffc.uflacs.backends.ufc.evaluatebasisderivatives.
generate_evaluate_basis_derivatives
(L, data)[source]¶ Evaluate the derivatives of an element basisfunction at a point. The values are computed as in FIAT as the matrix product of the coefficients (computed at compile time), basisvalues which are dependent on the coordinate and thus have to be computed at run time and combinations (depending on the order of derivative) of dmats tables which hold the derivatives of the expansion coefficients.
ffc.uflacs.backends.ufc.evaluatedof module¶
-
ffc.uflacs.backends.ufc.evaluatedof.
generate_evaluate_dof
(L, ir)[source]¶ Generate code for evaluate_dof.
ffc.uflacs.backends.ufc.finite_element module¶
-
ffc.uflacs.backends.ufc.finite_element.
compute_values
(L, data, dof_data)[source]¶ This function computes the value of the basisfunction as the dot product of the coefficients and basisvalues.
-
ffc.uflacs.backends.ufc.finite_element.
generate_element_mapping
(mapping, i, num_reference_components, tdim, gdim, J, detJ, K)[source]¶
-
class
ffc.uflacs.backends.ufc.finite_element.
ufc_finite_element
[source]¶ Bases:
ffc.uflacs.backends.ufc.generator.ufc_generator
Each function maps to a keyword in the template. See documentation of ufc_generator.
ffc.uflacs.backends.ufc.form module¶
-
ffc.uflacs.backends.ufc.form.
add_ufc_form_integral_methods
(cls)[source]¶ This function generates methods on the class it decorates, for each integral name template and for each integral type.
This allows implementing e.g. create_###_integrals once in the decorated class as ‘_create_foo_integrals’, and this function will expand that implementation into ‘create_cell_integrals’, ‘create_exterior_facet_integrals’, etc.
Name templates are taken from ‘integral_name_templates’ and ‘ufc_integral_types’.
-
class
ffc.uflacs.backends.ufc.form.
ufc_form
[source]¶ Bases:
ffc.uflacs.backends.ufc.generator.ufc_generator
Each function maps to a keyword in the template. See documentation of ufc_generator.
- The exceptions are functions on the form
- def _*_foo_*(self, L, ir, parameters, integral_type, declname)
which add_ufc_form_integral_methods will duplicate for foo = each integral type.
-
create_cell_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_cell_integral().
-
create_custom_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_custom_integral().
-
create_cutcell_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_cutcell_integral().
-
create_default_cell_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_cell_integral().
-
create_default_custom_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_custom_integral().
-
create_default_cutcell_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_cutcell_integral().
-
create_default_exterior_facet_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_exterior_facet_integral().
-
create_default_interface_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_interface_integral().
-
create_default_interior_facet_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_interior_facet_integral().
-
create_default_overlap_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_overlap_integral().
-
create_default_vertex_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_default_vertex_integral().
-
create_exterior_facet_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_exterior_facet_integral().
-
create_interface_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_interface_integral().
-
create_interior_facet_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_interior_facet_integral().
-
create_overlap_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_overlap_integral().
-
create_vertex_integral
(L, ir, parameters)¶ Return implementation of ufc::form::create_vertex_integral().
-
has_cell_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_cell_integrals().
-
has_custom_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_custom_integrals().
-
has_cutcell_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_cutcell_integrals().
-
has_exterior_facet_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_exterior_facet_integrals().
-
has_interface_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_interface_integrals().
-
has_interior_facet_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_interior_facet_integrals().
-
has_overlap_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_overlap_integrals().
-
has_vertex_integrals
(L, ir, parameters)¶ Return implementation of ufc::form::has_vertex_integrals().
-
max_cell_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_cell_subdomain_id().
-
max_custom_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_custom_subdomain_id().
-
max_cutcell_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_cutcell_subdomain_id().
-
max_exterior_facet_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_exterior_facet_subdomain_id().
-
max_interface_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_interface_subdomain_id().
-
max_interior_facet_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_interior_facet_subdomain_id().
-
max_overlap_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_overlap_subdomain_id().
-
max_vertex_subdomain_id
(L, ir, parameters)¶ Return implementation of ufc::form::max_vertex_subdomain_id().
ffc.uflacs.backends.ufc.generator module¶
-
class
ffc.uflacs.backends.ufc.generator.
ufc_generator
(basename)[source]¶ Bases:
object
Common functionality for code generators producing ufc classes.
The generate function is the driver for generating code for a class. It automatically extracts each template keyword %(foo)s and calls self.foo(…) to define the code snippet for that keyword.
The standard arguments to every self.foo(…) function are: - L (the language module reference) - ir (the full ir dict) - parameters (the parameters dict, can be omitted) If the second argument is not named “ir”, it must be a valid key in ir, and the value of ir[keyname] is passed instead of the full ir dict. Invalid keynames result in attempts at informative errors, meaning errors will often be caught early when making changes.
-
constructor_arguments
(L, ir)[source]¶ Return empty string. Override in classes that need constructor.
-
generate
(L, ir, parameters=None, snippets=None, jit=False)[source]¶ Return composition of templates with generated snippets.
-
ffc.uflacs.backends.ufc.generators module¶
ffc.uflacs.backends.ufc.integrals module¶
-
class
ffc.uflacs.backends.ufc.integrals.
ufc_integral
(integral_type)[source]¶ Bases:
ffc.uflacs.backends.ufc.generator.ufc_generator
Each function maps to a keyword in the template. See documentation of ufc_generator.
ffc.uflacs.backends.ufc.jacobian module¶
ffc.uflacs.backends.ufc.templates module¶
ffc.uflacs.backends.ufc.utils module¶
-
ffc.uflacs.backends.ufc.utils.
generate_return_literal_switch
(L, i, values, default, literal_type, typename=None)[source]¶
Module contents¶
Backend for generating UFC code.