FEniCS / ffcx

Next generation FEniCS Form Compiler for finite element forms
https://fenicsproject.org
Other
144 stars 38 forks source link

Restrict to set() of unique elements in `build_optimized_tables` #627

Closed conpierce8 closed 9 months ago

conpierce8 commented 10 months ago

Description of the issue

Calls to ufl.algorithms.sort_elements should be made with a set() to remove repeated entries from the elements list. This prevents ufl.utils.sorting.topological_sorting from performing unnecessary work.

Description of changes

This pull request updates build_optimized_tables with a call to set() to remove repeated entries from the elements list before calling sort_elements. This is consistent with the usage at https://github.com/FEniCS/ffcx/blob/main/ffcx/analysis.py#L99.