Skip to content
Snippets Groups Projects
Commit 8e660433 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Some fixes

parent 2a3e1df3
No related branches found
No related tags found
No related merge requests found
......@@ -225,11 +225,11 @@ def determine_accumulation_space(expr, number, measure, idims=None):
# Extract information on the finite element
from ufl.functionview import select_subelement
subel = select_subelement(ma.argexpr.ufl_element(), ma.component)
subel = select_subelement(ma.argexpr.ufl_element(), ma.tree_path)
# And generate a local function space for it!
from dune.perftool.pdelab.spaces import name_lfs, name_lfs_bound, lfs_child, lfs_iname
lfs = name_lfs(ma.argexpr.ufl_element(), ma.restriction, ma.component)
lfs = name_lfs(ma.argexpr.ufl_element(), ma.restriction, ma.tree_path)
from dune.perftool.generation import valuearg
from loopy.types import NumpyType
valuearg(lfs, dtype=NumpyType("str"))
......
......@@ -91,6 +91,8 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
accum_index = None
if visitor.indices:
accum_index = visitor.indices[0]
if accterm.argument.index:
accum_index = accterm.argument.index[0]._value
jacobian_inames = tuple()
if accterm.is_jacobian:
......
......@@ -35,6 +35,12 @@ class ModifiedArgument(Record):
reference=reference,
)
@property
def tree_path(self):
if self.component:
return self.component
else:
return self.index
class ModifiedTerminalTracker(MultiFunction):
""" A multifunction base that defines handler for
......
""" Loop unrolling transformation in ufl
NB: Doing this in UFL is not the best level of abstractions to do this.
However, for the sum factorization code paths, there are some adavantages
However, for the sum factorization code paths, there are some advantages
in traversing unrolled expression trees.
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment