Skip to content

Commit

Permalink
Correct shapes for Variables representing Real coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Jul 9, 2021
1 parent ce60c8e commit 831e03e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tsfc/kernel_interface/firedrake.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ def prepare_coefficient(coefficient, name, scalar_type, interior_facet=False):
funarg = coffee.Decl(scalar_type, coffee.Symbol(name),
pointers=[("restrict",)],
qualifiers=["const"])

expression = gem.reshape(gem.Variable(name, (None,)),
value_size = coefficient.ufl_element().value_size()
expression = gem.reshape(gem.Variable(name, (value_size,)),
coefficient.ufl_shape)

return funarg, expression
Expand Down
5 changes: 3 additions & 2 deletions tsfc/kernel_interface/firedrake_loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,9 @@ def prepare_coefficient(coefficient, name, scalar_type, interior_facet=False):

if coefficient.ufl_element().family() == 'Real':
# Constant
funarg = lp.GlobalArg(name, dtype=scalar_type, shape=(coefficient.ufl_element().value_size(),))
expression = gem.reshape(gem.Variable(name, (None,)),
value_size = coefficient.ufl_element().value_size()
funarg = lp.GlobalArg(name, dtype=scalar_type, shape=(value_size,))
expression = gem.reshape(gem.Variable(name, (value_size,)),
coefficient.ufl_shape)

return funarg, expression
Expand Down

0 comments on commit 831e03e

Please sign in to comment.