ffc.uflacs package¶
Subpackages¶
- ffc.uflacs.analysis package
- Submodules
- ffc.uflacs.analysis.balancing module
- ffc.uflacs.analysis.crsarray module
- ffc.uflacs.analysis.dependencies module
- ffc.uflacs.analysis.expr_shapes module
- ffc.uflacs.analysis.factorization module
- ffc.uflacs.analysis.graph module
- ffc.uflacs.analysis.graph_rebuild module
- ffc.uflacs.analysis.graph_ssa module
- ffc.uflacs.analysis.graph_symbols module
- ffc.uflacs.analysis.graph_vertices module
- ffc.uflacs.analysis.indexing module
- ffc.uflacs.analysis.modified_terminals module
- ffc.uflacs.analysis.valuenumbering module
- Module contents
- ffc.uflacs.backends package
- Subpackages
- ffc.uflacs.backends.ffc package
- ffc.uflacs.backends.ufc package
- Submodules
- ffc.uflacs.backends.ufc.apply_mappings module
- ffc.uflacs.backends.ufc.coordinate_mapping module
- ffc.uflacs.backends.ufc.dofmap module
- ffc.uflacs.backends.ufc.evalderivs module
- ffc.uflacs.backends.ufc.evaluatebasis module
- ffc.uflacs.backends.ufc.evaluatebasisderivatives module
- ffc.uflacs.backends.ufc.evaluatedof module
- ffc.uflacs.backends.ufc.finite_element module
- ffc.uflacs.backends.ufc.form module
- ffc.uflacs.backends.ufc.generator module
- ffc.uflacs.backends.ufc.generators module
- ffc.uflacs.backends.ufc.integrals module
- ffc.uflacs.backends.ufc.jacobian module
- ffc.uflacs.backends.ufc.templates module
- ffc.uflacs.backends.ufc.utils module
- Module contents
- Module contents
- Subpackages
- ffc.uflacs.language package
Submodules¶
ffc.uflacs.build_uflacs_ir module¶
Main algorithm for building the uflacs intermediate representation.
-
ffc.uflacs.build_uflacs_ir.
analyse_dependencies
(V, V_deps, V_targets, modified_terminal_indices, modified_terminals, mt_unique_table_reference)[source]¶
-
ffc.uflacs.build_uflacs_ir.
build_scalar_graph
(expressions)[source]¶ Build list representation of expression graph covering the given expressions.
TODO: Renaming, refactoring and cleanup of the graph building algorithms used in here
-
ffc.uflacs.build_uflacs_ir.
build_uflacs_ir
(cell, integral_type, entitytype, integrands, tensor_shape, coefficient_numbering, quadrature_rules, parameters)[source]¶
-
class
ffc.uflacs.build_uflacs_ir.
common_block_data_t
(block_mode, ttypes, factor_index, factor_is_piecewise, unames, restrictions, transposed)¶ Bases:
tuple
-
block_mode
¶ Alias for field number 0
-
factor_index
¶ Alias for field number 2
-
factor_is_piecewise
¶ Alias for field number 3
-
restrictions
¶ Alias for field number 5
-
transposed
¶ Alias for field number 6
-
ttypes
¶ Alias for field number 1
-
unames
¶ Alias for field number 4
-
-
class
ffc.uflacs.build_uflacs_ir.
full_block_data_t
(block_mode, ttypes, factor_index, factor_is_piecewise, unames, restrictions, transposed, ma_data)¶ Bases:
tuple
-
block_mode
¶ Alias for field number 0
-
factor_index
¶ Alias for field number 2
-
factor_is_piecewise
¶ Alias for field number 3
-
ma_data
¶ Alias for field number 7
-
restrictions
¶ Alias for field number 5
-
transposed
¶ Alias for field number 6
-
ttypes
¶ Alias for field number 1
-
unames
¶ Alias for field number 4
-
-
ffc.uflacs.build_uflacs_ir.
integrate_block
(weights, unames, ttypes, unique_tables, unique_table_num_dofs)[source]¶
-
ffc.uflacs.build_uflacs_ir.
integrate_block_interior_facets
(weights, unames, ttypes, unique_tables, unique_table_num_dofs)[source]¶
-
class
ffc.uflacs.build_uflacs_ir.
ma_data_t
(ma_index, tabledata)¶ Bases:
tuple
-
ma_index
¶ Alias for field number 0
-
tabledata
¶ Alias for field number 1
-
-
ffc.uflacs.build_uflacs_ir.
multiply_block
(point_index, unames, ttypes, unique_tables, unique_table_num_dofs)[source]¶
-
ffc.uflacs.build_uflacs_ir.
multiply_block_interior_facets
(point_index, unames, ttypes, unique_tables, unique_table_num_dofs)[source]¶
-
ffc.uflacs.build_uflacs_ir.
parse_uflacs_optimization_parameters
(parameters, integral_type)[source]¶ Following model from quadrature representation, extracting uflacs specific parameters from the global parameters dict.
-
class
ffc.uflacs.build_uflacs_ir.
partial_block_data_t
(block_mode, ttypes, factor_index, factor_is_piecewise, unames, restrictions, transposed, ma_data, piecewise_ma_index)¶ Bases:
tuple
-
block_mode
¶ Alias for field number 0
-
factor_index
¶ Alias for field number 2
-
factor_is_piecewise
¶ Alias for field number 3
-
ma_data
¶ Alias for field number 7
-
piecewise_ma_index
¶ Alias for field number 8
-
restrictions
¶ Alias for field number 5
-
transposed
¶ Alias for field number 6
-
ttypes
¶ Alias for field number 1
-
unames
¶ Alias for field number 4
-
-
class
ffc.uflacs.build_uflacs_ir.
preintegrated_block_data_t
(block_mode, ttypes, factor_index, factor_is_piecewise, unames, restrictions, transposed, is_uniform, name)¶ Bases:
tuple
-
block_mode
¶ Alias for field number 0
-
factor_index
¶ Alias for field number 2
-
factor_is_piecewise
¶ Alias for field number 3
-
is_uniform
¶ Alias for field number 7
-
name
¶ Alias for field number 8
-
restrictions
¶ Alias for field number 5
-
transposed
¶ Alias for field number 6
-
ttypes
¶ Alias for field number 1
-
unames
¶ Alias for field number 4
-
-
class
ffc.uflacs.build_uflacs_ir.
premultiplied_block_data_t
(block_mode, ttypes, factor_index, factor_is_piecewise, unames, restrictions, transposed, is_uniform, name)¶ Bases:
tuple
-
block_mode
¶ Alias for field number 0
-
factor_index
¶ Alias for field number 2
-
factor_is_piecewise
¶ Alias for field number 3
-
is_uniform
¶ Alias for field number 7
-
name
¶ Alias for field number 8
-
restrictions
¶ Alias for field number 5
-
transposed
¶ Alias for field number 6
-
ttypes
¶ Alias for field number 1
-
unames
¶ Alias for field number 4
-
ffc.uflacs.elementtables module¶
Tools for precomputed tables of terminal values.
-
ffc.uflacs.elementtables.
build_element_tables
(num_points, quadrature_rules, cell, integral_type, entitytype, modified_terminals, rtol=1e-05, atol=1e-08)[source]¶ Build the element tables needed for a list of modified terminals.
- Input:
- entitytype - str modified_terminals - ordered sequence of unique modified terminals FIXME: Document
- Output:
- tables - dict(name: table) mt_table_names - dict(ModifiedTerminal: name)
-
ffc.uflacs.elementtables.
build_optimized_tables
(num_points, quadrature_rules, cell, integral_type, entitytype, modified_terminals, existing_tables, compress_zeros, rtol=1e-05, atol=1e-08)[source]¶
-
ffc.uflacs.elementtables.
build_unique_tables
(tables, rtol=1e-05, atol=1e-08)[source]¶ Given a list or dict of tables, return a list of unique tables and a dict of unique table indices for each input table key.
-
ffc.uflacs.elementtables.
clamp_table_small_numbers
(table, rtol=1e-05, atol=1e-08, numbers=(-1.0, -0.5, 0.0, 0.5, 1.0))[source]¶ Clamp almost 0,1,-1 values to integers. Returns new table.
-
ffc.uflacs.elementtables.
generate_psi_table_name
(num_points, element_counter, averaged, entitytype, derivative_counts, flat_component)[source]¶ Generate a name for the psi table of the form: FE#_C#_D###[_AC|_AF|][_F|V][_Q#], where ‘#’ will be an integer value.
- FE - is a simple counter to distinguish the various bases, it will be
- assigned in an arbitrary fashion.
- C - is the component number if any (this does not yet take into account
- tensor valued functions)
- D - is the number of derivatives in each spatial direction if any.
- If the element is defined in 3D, then D012 means d^3(*)/dydz^2.
AC - marks that the element values are averaged over the cell
AF - marks that the element values are averaged over the facet
F - marks that the first array dimension enumerates facets on the cell
V - marks that the first array dimension enumerates vertices on the cell
Q - number of quadrature points, to distinguish between tables in a mixed quadrature degree setting
-
ffc.uflacs.elementtables.
get_ffc_table_values
(points, cell, integral_type, ufl_element, avg, entitytype, derivative_counts, flat_component)[source]¶ Extract values from ffc element table.
Returns a 3D numpy array with axes (entity number, quadrature point number, dof number)
-
ffc.uflacs.elementtables.
optimize_element_tables
(tables, table_origins, compress_zeros, rtol=1e-05, atol=1e-08)[source]¶ Optimize tables and make unique set.
Steps taken:
- clamp values that are very close to -1, 0, +1 to those values
- remove dofs from beginning and end of tables where values are all zero
- for each modified terminal, provide the dof range that a given table corresponds to
- Terminology:
name - str, name used in input arguments here table - numpy array of float values stripped_table - numpy array of float values with zeroes
removed from each end of dofrange- Input:
- tables - { name: table } table_origins - FIXME
- Output:
- unique_tables - { unique_name: stripped_table } unique_table_origins - FIXME
-
ffc.uflacs.elementtables.
strip_table_zeros
(table, compress_zeros, rtol=1e-05, atol=1e-08)[source]¶ Strip zero columns from table. Returns column range (begin, end) and the new compact table.
-
ffc.uflacs.elementtables.
table_origin_t
¶ alias of
ffc.uflacs.elementtables.table_origin
-
ffc.uflacs.elementtables.
unique_table_reference_t
¶ alias of
ffc.uflacs.elementtables.unique_table_reference
ffc.uflacs.integralgenerator module¶
Controlling algorithm for building the tabulate_tensor source structure from factorized representation.
-
class
ffc.uflacs.integralgenerator.
IntegralGenerator
(ir, backend, precision)[source]¶ Bases:
object
-
generate
()[source]¶ Generate entire tabulate_tensor body.
Assumes that the code returned from here will be wrapped in a context that matches a suitable version of the UFC tabulate_tensor signatures.
-
generate_block_parts
(num_points, blockmap, blockdata)[source]¶ Generate and return code parts for a given block.
Returns parts occuring before, inside, and after the quadrature loop identified by num_points.
Should be called with num_points=None for quadloop-independent blocks.
-
generate_element_tables
()[source]¶ Generate static tables with precomputed element basis function values in quadrature points.
-
generate_runtime_quadrature_loop
()[source]¶ Generate quadrature loop for custom integrals, with physical points given runtime.
-
get_var
(num_points, v)[source]¶ “Lookup ufl expression v in variable scope dicts.
Scope is determined by num_points which identifies the quadrature loop scope or None if outside quadrature loops.
If v is not found in quadrature loop scope, the piecewise scope (None) is checked.
Returns the CNodes expression to access the value in the code.
-
ffc.uflacs.params module¶
Collection of exposed parameters available to tune form compiler algorithms.
ffc.uflacs.tools module¶
-
ffc.uflacs.tools.
accumulate_integrals
(itg_data, quadrature_rule_sizes)[source]¶ Group and accumulate integrals according to the number of quadrature points in their rules.
ffc.uflacs.uflacsgenerator module¶
Controlling algorithm for building the tabulate_tensor source structure from factorized representation.
ffc.uflacs.uflacsoptimization module¶
ffc.uflacs.uflacsrepresentation module¶
Module contents¶
This is UFLACS, the UFL Analyser and Compiler System.