Local dimensions of dofmap views are not available

Issue #635 new
Jan Blechta created an issue

Following code shows (even sequentially) that subdofmap.index_map().size(IndexMap.MapSize_FOO) does not give the actual dimensions of the subdofmap. It could be useful having such a possibility.

NOTE: This feature was probably never available. In DOLFIN 1.6.0 subdofmap.local_dimension("foo") suffers with the same drawback.

from __future__ import print_function
from dolfin import *

mesh = UnitSquareMesh(4, 4)
rank = MPI.rank(mesh.mpi_comm())

V = VectorFunctionSpace(mesh, "Lagrange", 2)
spaces = [V, V.sub(0), V.sub(1)]

print(rank, [X.dofmap().global_dimension() for X in spaces])
print(rank, [X.dofmap().index_map().size(IndexMap.MapSize_OWNED) for X in spaces])
print(rank, [X.dofmap().index_map().size(IndexMap.MapSize_UNOWNED) for X in spaces])
print(rank, [X.dofmap().index_map().size(IndexMap.MapSize_ALL) for X in spaces])
print(rank, [X.dofmap().index_map().size(IndexMap.MapSize_GLOBAL) for X in spaces])

Comments (3)

  1. Jan Blechta reporter

    @garth-wells, aren't there any plans for separating dofmap views from dofmap? If yes, that would be good occasion to fix it (say by overloading [Sub]DofMap::local_dimension() if there were inheritance).

  2. Prof Garth Wells

    @blechta Note sure yet. Need to look closely at how large the common interface would be.

    Maybe we should throw an error when accessing the index map for a subspace.

  3. Jan Blechta reporter

    throw an error

    I'm not sure. subdofmap.index_map().local_to_global is still useful and has a good meaning. Maybe just document better what DofMap::index_map() is.

  4. Log in to comment