You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to adapt mesh with variable (e.g. strain rate) after stokes solve. Most likely due to variable not being the velocity or pressure field. I'm currently on the latest development branch with PETSc v2.24.4 that is built with pragmatic, mmg & parmmg. Here is the error message:
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Argument out of range
[0]PETSC ERROR: Invalid field number 2; not in [0, 2)
[0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed before usage or a spelling mistake, etc!
Can you add more information so we can reproduce this - we're continually debugging this part of the code which is difficult to get right and changes quite a bit with petsc updates.
Fixed in PR #67 (merged to development). The adapt() method now destroys all old variable lvecs upfront before reinitializing, preventing stale field_id errors in _setup_ds(). The metric variable is also preserved through adaptation.
Activity
lmoresi commentedon Feb 24, 2026
Can you add more information so we can reproduce this - we're continually debugging this part of the code which is difficult to get right and changes quite a bit with petsc updates.
bknight1 commentedon Mar 2, 2026
Here's a basic example using the Stokes sinker, adapting based on the SR field:
Fix PETSc error in mesh.adapt() when extra MeshVariables exist
lmoresi commentedon Mar 3, 2026
Fixed in PR #67 (merged to development). The adapt() method now destroys all old variable lvecs upfront before reinitializing, preventing stale field_id errors in _setup_ds(). The metric variable is also preserved through adaptation.
bknight1 commentedon Mar 3, 2026
Confirmed working. Thanks, Louis
refactor(readability): Wave D mesh — Mesh.__init__ split, unified coo…