Skip to content

Commit 7164d8c

Browse files
authored
Fix real return type (#728)
1 parent 712a57d commit 7164d8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ffcx/codegeneration/expression_generator.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,13 @@ def generate_partition(self, symbol, F, mode):
365365
vexpr = L.ufl_to_lnodes(v, *vops)
366366

367367
is_cond = isinstance(v, ufl.classes.Condition)
368-
dtype = L.DataType.BOOL if is_cond else L.DataType.SCALAR
368+
is_real = isinstance(v, ufl.classes.Real)
369+
if is_cond:
370+
dtype = L.DataType.BOOL
371+
elif is_real:
372+
dtype = L.DataType.REAL
373+
else:
374+
dtype = L.DataType.SCALAR
369375

370376
j = len(intermediates)
371377
vaccess = L.Symbol(f"{symbol.name}_{j}", dtype=dtype)

0 commit comments

Comments
 (0)