Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: Test GEM #3987

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
--install defcon \
--install gadopt \
--install asQ \
--package-branch fiat pbrubeck/simplify-indexed \
--package-branch ufl pbrubeck/remove-component-tensors \
|| (cat firedrake-install.log && /bin/false)

- name: Install test dependencies
Expand Down
11 changes: 6 additions & 5 deletions tsfc/fem.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,15 +641,13 @@ def fiat_to_ufl(fiat_dict, order):

@translate.register(Argument)
def translate_argument(terminal, mt, ctx):
argument_multiindex = ctx.argument_multiindices[terminal.number()]
sigma = tuple(gem.Index(extent=d) for d in mt.expr.ufl_shape)
element = ctx.create_element(terminal.ufl_element(), restriction=mt.restriction)

def callback(entity_id):
finat_dict = ctx.basis_evaluation(element, mt, entity_id)
# Filter out irrelevant derivatives
filtered_dict = {alpha: table
for alpha, table in finat_dict.items()
filtered_dict = {alpha: finat_dict[alpha]
for alpha in finat_dict
if sum(alpha) == mt.local_derivatives}

# Change from FIAT to UFL arrangement
Expand All @@ -658,13 +656,16 @@ def callback(entity_id):
# A numerical hack that FFC used to apply on FIAT tables still
# lives on after ditching FFC and switching to FInAT.
return ffc_rounding(square, ctx.epsilon)

table = ctx.entity_selector(callback, mt.restriction)
if ctx.use_canonical_quadrature_point_ordering:
quad_multiindex = ctx.quadrature_rule.point_set.indices
quad_multiindex_permuted = _make_quad_multiindex_permuted(mt, ctx)
mapper = gem.node.MemoizerArg(gem.optimise.filtered_replace_indices)
table = mapper(table, tuple(zip(quad_multiindex, quad_multiindex_permuted)))
return gem.ComponentTensor(gem.Indexed(table, argument_multiindex + sigma), sigma)

argument_multiindex = ctx.argument_multiindices[terminal.number()]
return gem.partial_indexed(table, argument_multiindex)


@translate.register(TSFCConstantMixin)
Expand Down
Loading