Skip to content

Commit 7b4e181

Browse files
committed
output: fix bug in checking whether data needs to be projected
1 parent 2a8aea3 commit 7b4e181

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

firedrake/output.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,13 @@ def __init__(self, filename, project_output=False, comm=None, mode="w",
420420
def _prepare_output(self, function, max_elem):
421421
from firedrake import FunctionSpace, VectorFunctionSpace, \
422422
TensorFunctionSpace, Function, Projector, Interpolator
423+
from tsfc.finatinterface import create_element as create_finat_element
423424

424425
name = function.name()
425426
# Need to project/interpolate?
426-
# If space is not the max element, we can do so.
427-
if function.ufl_element == max_elem:
427+
# If space is not the max element, we must do so.
428+
finat_elem = function.function_space().finat_element
429+
if finat_elem == create_finat_element(max_elem):
428430
return OFunction(array=get_array(function),
429431
name=name, function=function)
430432
# OK, let's go and do it.

0 commit comments

Comments
 (0)