Skip to content

*Real FS* Mixed FS instantiation with >2 spaces fails when some FS is Real #862

@dorugeber

Description

@dorugeber
from firedrake import *

mesh = PeriodicUnitIntervalMesh(10)

V1 = FunctionSpace(mesh, "CG", 1)
V2 = TensorFunctionSpace(mesh, "CG", 1)
V3 = FunctionSpace(mesh, "Real", 0)
V = V2*V3  # lives
V = V1*V2*V1  # lives
V = V1*V2*V3  # dies

fails with

Traceback (most recent call last):
  File "bug.py", line 10, in <module>
    V = V1*V2*V3  # dies
  File "/home/andrew/firedrake/src/firedrake/firedrake/functionspaceimpl.py", line 203, in __mul__
    return MixedFunctionSpace((self, other))
  File "/home/andrew/firedrake/src/firedrake/firedrake/functionspace.py", line 258, in MixedFunctionSpace
    new = impl.MixedFunctionSpace(spaces, name=name)
  File "/home/andrew/firedrake/src/firedrake/firedrake/functionspaceimpl.py", line 529, in __init__
    self.comm = self.node_set.comm
  File "/home/andrew/firedrake/src/PyOP2/pyop2/utils.py", line 64, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/home/andrew/firedrake/src/firedrake/firedrake/functionspaceimpl.py", line 622, in node_set
    return op2.MixedSet(s.node_set for s in self._spaces)
  File "/home/andrew/firedrake/src/PyOP2/pyop2/backends.py", line 118, in __call__
    return t(*args, **kwargs)
  File "/home/andrew/firedrake/src/PyOP2/pyop2/caching.py", line 156, in __new__
    obj = make_obj()
  File "/home/andrew/firedrake/src/PyOP2/pyop2/caching.py", line 137, in make_obj
    obj.__init__(*args, **kwargs)
  File "/home/andrew/firedrake/src/PyOP2/pyop2/base.py", line 979, in __init__
    self.comm = reduce(lambda a, b: a if a is None else a.comm or b if b is None else b.comm, sets)
  File "/home/andrew/firedrake/src/PyOP2/pyop2/base.py", line 979, in <lambda>
    self.comm = reduce(lambda a, b: a if a is None else a.comm or b if b is None else b.comm, sets)
AttributeError: 'mpi4py.MPI.Intracomm' object has no attribute 'comm'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions