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

Change in return type of getField() function in PETSc version 3.22.1 #268

Open
jcgraciosa opened this issue Nov 18, 2024 · 5 comments
Open
Assignees

Comments

@jcgraciosa
Copy link
Contributor

Branch tested: development
PETSc version: 3.22.1
Python version: 3.12.7
Issue description:

Accessing the swarm fields using getField() no longer returns the field of interest as an array.
Instead, it returns a tuple with the:

  • first element corresponding to the field of interest as an array and,
  • second element corresponding to the dimensions (I think).

I think this change may have a lot of effects moving forward.

To test:

import underworld3 as uw
mesh = uw.meshing.UnstructuredSimplexBox(minCoords=(0, 0), maxCoords=(1, 1), cellSize = 1/8)   
@NengLu
Copy link
Contributor

NengLu commented Nov 18, 2024

Yeah, I had a similar issue in #257.

@jcgraciosa
Copy link
Contributor Author

Apologies for the duplication! I assumed it was fixed.

@NengLu
Copy link
Contributor

NengLu commented Nov 18, 2024

Apologies for the duplication! I assumed it was fixed.

No worries, just close that one to follow on this.
Shall we make the changes now to follow their updates? Or stick to the old version like 3.21.5, if only temporarily?

@lmoresi
Copy link
Member

lmoresi commented Nov 18, 2024

If this is purely in Petsc4py, then you should intercept the call in python with a branch on the version number. If it is in the C code that we have wrapped then look at the compatibility code we use.

@jcgraciosa
Copy link
Contributor Author

As discussed with Julian and in line with Louis' comment, I'll create a wrapper method for handling the behaviour depending on the petsc4py version number.

@jcgraciosa jcgraciosa self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants