-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: VTXWriter outputs erroneous data in parallel when outputting collapsed space #2929
Comments
To me it looks like it relates to the fact that the ghosts are ordered differently in the collapsed space. import numpy as np
from mpi4py import MPI
import dolfinx
mesh = dolfinx.mesh.create_unit_square(
MPI.COMM_WORLD, 2, 2, ghost_mode=dolfinx.mesh.GhostMode.none)
V = dolfinx.fem.functionspace(mesh, ("Lagrange", 1, (2, )))
V0, _ = V.sub(0).collapse()
print(V.dofmap.index_map.ghosts,
V0.dofmap.index_map.ghosts) [1] [1]
[5 7 6 0] [0 5 7 6]
[6] [6] |
I think we agreed in #2881 that that was on purpose. |
I agree that in the case of using To me, this suggests that calling |
It's not clear to me that the ghost ordering is the problem. Re-mapping takes place when copying entries from the vector at dolfinx/cpp/dolfinx/fem/Function.h Line 126 in 227f1d3
|
As the issue shows, they are copied over in the correct order, ie, if you only write the collapsed function to file, the ordering is correct. However, if you write the parent space and collapsed sub space to the same file, we see that the dof maps are not the same, even if the Finite elements are the same (up to block size) and the dof layout is the same for both spaces. |
You can also see this with the PR that I have made, as it resolves the issues described here |
The root problem still hasn't been properly identified. Is it that |
Yes, VTXWriter assumes that the dofmaps are the same (as there is a 1-1 map between the mesh geometry dofs and the function dofs) there are thee ways of «fixing» this: |
The documentation specifies that the elements for the different functions must be the same, whereas the implementation requires that the element and the dofmap are the same. Immediate issues to be fixed are:
A second step could be:
It is best if this class imposes as few requirements as reasonably possible on the arguments. |
This means writing the mesh twice, or compute the permutation/mapping from one dofmap to the other, which I am not sure is worthwhile complexity. i still think this is something that should be fixed collapsed function space code. It is silly that we keep the same numbering for the local dofs, but not the ghosts. |
Summarize the issue
Using VTXWriter to output a DG function and one of its collapsed sub functions yields incorrect data in parallel.
How to reproduce the bug
The following MWE and attached paraview rendering illustrates the issue. The image is produced after running with 5 MPI processes.
Minimal Example (Python)
Output (Python)
No response
Version
0.7.2
DOLFINx git commit
No response
Installation
From source
Additional information
The text was updated successfully, but these errors were encountered: