Skip to content
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

Topological dimension of vertex meshes is wrong #3521

Closed
jorgensd opened this issue Nov 20, 2024 · 0 comments · Fixed by #3523
Closed

Topological dimension of vertex meshes is wrong #3521

jorgensd opened this issue Nov 20, 2024 · 0 comments · Fixed by #3523
Labels
bug Something isn't working high-priority

Comments

@jorgensd
Copy link
Member

Summarize the issue

A mesh consisting of vertices gets topological dimension 1, instead of zero.
Most likely introduced in: #3512
Does work on 0.9.0

How to reproduce the bug

Run the following code

Minimal Example (Python)

from mpi4py import MPI
import dolfinx
import numpy as np
mesh = dolfinx.mesh.create_unit_cube(MPI.COMM_WORLD, 3,4,7, cell_type=dolfinx.cpp.mesh.CellType.tetrahedron,
                                         ghost_mode=dolfinx.cpp.mesh.GhostMode.shared_facet)
edim = 0
mesh.topology.create_entities(edim)
emap = mesh.topology.index_map(edim)
num_entities_on_proc = emap.size_local + emap.num_ghosts
subset_cells_local = np.arange(num_entities_on_proc, dtype=np.int32)
submesh, entity_to_parent, vertex_to_parent, _ = dolfinx.mesh.create_submesh(mesh, edim, subset_cells_local)
assert submesh.topology.dim == edim, f"{submesh.topology.dim} != {edim}"

Output (Python)

Traceback (most recent call last):
  File "/root/shared/dolfinx/python/test/unit/mesh/mwe.py", line 12, in <module>
    assert submesh.topology.dim == edim, f"{submesh.topology.dim} != {edim}"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1 != 0
root@dokken-XPS-9320:~/share

Version

main branch

DOLFINx git commit

a547191

Installation

No response

Additional information

No response

@jorgensd jorgensd added bug Something isn't working high-priority labels Nov 20, 2024
@jorgensd jorgensd linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant