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

BUG: PETSc interface change has broken VertexOnlyMesh #3998

Open
dham opened this issue Jan 28, 2025 · 0 comments
Open

BUG: PETSc interface change has broken VertexOnlyMesh #3998

dham opened this issue Jan 28, 2025 · 0 comments
Labels

Comments

@dham
Copy link
Member

dham commented Jan 28, 2025

Describe the bug
This change to PETSc has changed the interface to DMSwarm such that the cell ID field has changed.

Steps to Reproduce

Using current Firedrake and PETSc main:

from firedrake import *
msh = UnitSquareMesh(5,5)
VOM = VertexOnlyMesh(msh, vertexcoords=msh.coordinates.dat.data, redundant=False)

Produces:

   3880     # NOTE ensure that swarm.restoreField is called for each field too!
   3881     swarm_coords = swarm.getField("DMSwarmPIC_coor").reshape((num_vertices, gdim))
-> 3882     swarm_parent_cell_nums = swarm.getField("DMSwarm_cellid").ravel()
   3883     field_parent_cell_nums = swarm.getField("parentcellnum").ravel()
   3884     field_reference_coords = swarm.getField("refcoord").reshape((num_vertices, tdim))

petsc4py/PETSc/DMSwarm.pyx in petsc4py.PETSc.DMSwarm.getField()

Error: error code 83
[0] DMSwarmGetField() at /tmp/petsc-src/src/dm/impls/swarm/swarm.c:1663
[0] DMSwarmDataBucketGetDMSwarmDataFieldByName() at /tmp/petsc-src/src/dm/impls/swarm/data_bucket.c:172
[0] Cannot find DMSwarmDataField with name DMSwarm_cellid

Additional behaviour

It appears that the cell id is no longer stored in the hard-coded name "DMSwarm_cellid" but instead the name has to be accessed programatically. It's not clear how to do that from Python (and the interface may not have been exposed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant