|
13 | 13 | import numpy.typing as npt
|
14 | 14 | import ufl
|
15 | 15 |
|
| 16 | +from ffcx.definitions import entity_types |
16 | 17 | from ffcx.element_interface import basix_index
|
| 18 | +from ffcx.ir.analysis.modified_terminals import ModifiedTerminal |
17 | 19 | from ffcx.ir.representationutils import (
|
| 20 | + QuadratureRule, |
18 | 21 | create_quadrature_points_and_weights,
|
19 | 22 | integral_type_to_entity_dim,
|
20 | 23 | map_integral_points,
|
@@ -82,7 +85,7 @@ def get_ffcx_table_values(
|
82 | 85 | integral_type,
|
83 | 86 | element,
|
84 | 87 | avg,
|
85 |
| - entity_type, |
| 88 | + entity_type: entity_types, |
86 | 89 | derivative_counts,
|
87 | 90 | flat_component,
|
88 | 91 | codim,
|
@@ -175,7 +178,12 @@ def get_ffcx_table_values(
|
175 | 178 |
|
176 | 179 |
|
177 | 180 | def generate_psi_table_name(
|
178 |
| - quadrature_rule, element_counter, averaged: str, entity_type, derivative_counts, flat_component |
| 181 | + quadrature_rule: QuadratureRule, |
| 182 | + element_counter, |
| 183 | + averaged: str, |
| 184 | + entity_type: entity_types, |
| 185 | + derivative_counts, |
| 186 | + flat_component, |
179 | 187 | ):
|
180 | 188 | """Generate a name for the psi table.
|
181 | 189 |
|
@@ -293,26 +301,33 @@ def permute_quadrature_quadrilateral(points, reflections=0, rotations=0):
|
293 | 301 |
|
294 | 302 |
|
295 | 303 | def build_optimized_tables(
|
296 |
| - quadrature_rule, |
297 |
| - cell, |
298 |
| - integral_type, |
299 |
| - entity_type, |
300 |
| - modified_terminals, |
301 |
| - existing_tables, |
302 |
| - use_sum_factorization, |
303 |
| - is_mixed_dim, |
304 |
| - rtol=default_rtol, |
305 |
| - atol=default_atol, |
306 |
| -): |
| 304 | + quadrature_rule: QuadratureRule, |
| 305 | + cell: ufl.Cell, |
| 306 | + integral_type: str, |
| 307 | + entity_type: entity_types, |
| 308 | + modified_terminals: ModifiedTerminal, |
| 309 | + existing_tables: dict[str, np.ndarray], |
| 310 | + use_sum_factorization: bool, |
| 311 | + is_mixed_dim: bool, |
| 312 | + rtol: float = default_rtol, |
| 313 | + atol: float = default_atol, |
| 314 | +) -> dict[ModifiedTerminal, UniqueTableReferenceT]: |
307 | 315 | """Build the element tables needed for a list of modified terminals.
|
308 | 316 |
|
309 |
| - Input: |
310 |
| - entity_type - str |
311 |
| - modified_terminals - ordered sequence of unique modified terminals |
312 |
| - FIXME: Document |
313 |
| -
|
314 |
| - Output: |
315 |
| - mt_tables - dict(ModifiedTerminal: table data) |
| 317 | + Args: |
| 318 | + quadrature_rule: The quadrature rule relating to the tables. |
| 319 | + cell: The cell type of the domain the tables will be used with. |
| 320 | + entity_type: On what entity (vertex,edge,facet,cell) the tables are evaluated at. |
| 321 | + integral_type: The type of integral the tables are used for. |
| 322 | + modified_terminals: ordered sequence of unique modified terminals |
| 323 | + existing_tables: Register of tables that already exist and reused. |
| 324 | + use_sum_factorization: Use sum factorization for tensor product elements. |
| 325 | + is_mixed_dim: Mixed dimensionality of the domain. |
| 326 | + rtol: Relative tolerance for comparing tables. |
| 327 | + atol: Absolute tolerance for comparing tables. |
| 328 | +
|
| 329 | + Returns: |
| 330 | + mt_tables - Dictionary mapping each modified terminal to the a unique table reference. |
316 | 331 | """
|
317 | 332 | # Add to element tables
|
318 | 333 | analysis = {}
|
|
0 commit comments