restriction_map is not working if all cells came from the same processor

Issue #7 new
Francesco Ballarin created an issue

Dear cbcpost developers,

I am interested in the creation of submeshes in parallel using your create_submesh utility and in mapping DOFs from the original function space to one on the submesh.

I attach a script bug_restriction_map.py (run with two processors) which shows that the restriction_map is not working properly if all cells of the submesh came from the same processor (and distribute_meshdata moved one of them to a different processor in create_submesh)

The error is:

Traceback (most recent call last):
  File "bug_restriction_map.py", line 21, in <module>
    restriction_map(V, submesh_V)
  File "cbcpost/lib/python2.7/site-packages/cbcpost-2016.1.0-py2.7.egg/cbcpost/utils/restriction_map.py", line 93, in restriction_map
    coordsb = Vb.tabulate_dof_coordinates().reshape(Nb, D)
ValueError: total size of new array must be unchanged

Indeed,

Process 0: Global dofs of Vb: [0 1 2 3 4]
# in the next line, len(V.tabulate_dof_coordinates()) vs N*D
Process 0: V space: 46 vs 46
# in the next line, len(Vb.tabulate_dof_coordinates()) vs Nb*D
Process 0: Vb space: 10 vs 10

Process 1: Global dofs of V: [ 5  6  7  8  9 10 11 12 13 14 15 16 17 18 19]
# in the next line, len(V.tabulate_dof_coordinates()) vs N*D
Process 1: V space: 52 vs 52
# in the next line, len(Vb.tabulate_dof_coordinates()) vs Nb*D
Process 1: Vb space: 32 vs 30 # WRONG !!

restriction_map works fine if all processors had at least one cell (uncomment line 9 of my script)

Do you have any suggestion?

Thanks,

Francesco

Comments (1)

  1. Log in to comment