Skip to content

Fix multi-material SolCx tutorial runtime cleanup and validation wording - #1226

Open
ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:fix/multimaterial-solcx-runtime
Open

ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:fix/multimaterial-solcx-runtime

Conversation

@ss2098

@ss2098 ss2098 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix standalone execution of the multi-material SolCx tutorial and clarify its numerical validation.

Changes

  • Replace deprecated swarm.points accesses with swarm.coords.
  • Scope PyVista visualization objects inside a function.
  • Explicitly close the plotter.
  • Release simulation objects before standalone interpreter shutdown while retaining objects for interactive notebook inspection.
  • Make IPython detection optional.
  • Correct documentation that previously described numerical equivalence as analytical SolCx validation.
  • Remove unsupported performance and broad accuracy claims.

Reproduction

The original example completed both Stokes solves but emitted deprecated API warnings and ignored destructor exceptions at interpreter shutdown.

The issue was reproduced on macOS arm64 with Python 3.12, PETSc 3.25, and the Underworld3 Pixi runtime.

Validation

The original and corrected complete examples were executed independently using an isolated Pixi environment built from the target development branch.

Validation required:

  • Successful Python compilation.
  • Successful execution of both Stokes formulations.
  • Identical reported velocity and pressure diagnostics.
  • Identical reported L2 differences and relative-error diagnostics.
  • Zero process exit code.
  • No deprecated swarm warnings, Python tracebacks, ignored destructor exceptions, PETSc errors, or MPI aborts in the corrected execution.
  • Exactly one intended tutorial file staged.
  • Successful Git whitespace checks.

Scope

No modifications to Underworld3 solver-core, PETSc, MPI, constitutive equations, or discretization settings.

The comparison demonstrates agreement between two numerical viscosity formulations. It does not establish convergence against the analytical SolCx solution.

Validation covers single-process standalone execution. Multi-rank execution and interactive notebook behavior were not independently tested.

@ss2098
ss2098 requested a review from lmoresi as a code owner November 17, 2026 00:19

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant