Skip to content

Conversation

@lmoresi
Copy link
Member

@lmoresi lmoresi commented Jul 29, 2025

We had to lift the joss-submission branch to the current PETSc / UW3 versions.
All revisions to the papers etc have been brought forward.

lmoresi and others added 30 commits March 26, 2025 21:49
Links to docs / API docs
link to API docs
The 3.23 petsc viewer for vtk is not recognised by pyvista. This is an alternative strategy that generates the unstructured mesh directly from dmplex. It is less general than the PETSc version in that it assumes the same element type everywhere (which is always true in uw3)
We changed the output in debugging / verbose mode and so one test was failing. It's not a great test because it just checks the output never changes. This will currently work but it is sensitive to the number of solvers instantiated during the test - should replace this with regular expression checking.
Simple functions to check if a point is within a simplex by computing barycentric coordinates. I'm using a different strategy at the moment, but these functions are worth keeping for when we need those coordinates.
Mostly a results of insisting that the `black` formatter gets run across the source before committing.
`black` formatter for this pyx file too
Add _ to some functions that do not need to be advertised
Adding a "BASIC_Swarm" type. Currently a clone of the standard (PIC) swarm but without any cell_id references. I keep the same (PETSc) field name for the coordinates as in the PIC swarm for compatibility.

The swarm now has a `migrate` function which handles the communication using kdtree based redistribution and kdtree based checking of processor ownership

Currently missing: an equivalent of the cell-by-cell `populate` method which would still be useful even in the absence of PIC functionality
Note: in PETSc 3.23.x, the PIC swarm interface has changed and it is no longer possible to access the CellID from petsc4py. Failing tests are now expected in standard swarms and nodal-point swarms. The goal is to make the BASIC swarm the default and use PIC only when necessary (never ?)
Not sure if I have caught all the interface changes, but the ones in the tests I have found / fixed
Removed commented-out and unused code blocks for clarity. Updated KDTree method calls to use the 'query' interface with appropriate arguments, improving consistency and potentially performance.
Added comprehensive docstrings to Swarm and UW_Swarm classes, clarifying their usage, parameters, and methods. Renamed BASIC_Swarm to UW_Swarm and updated its documentation. Introduced NodalPointBasicSwarm as a nodal swarm implementation based on UW_Swarm. Updated kdtree query usage and removed obsolete comments and code.
Introducing a NodalPointUWSwarm which uses the new BASIC swarm in place of the PIC version. Adjusted the ddt semi-Lagrange solver to use this and checking that it works with advection/diffusion.

Updated the uw.function.evaluate to do this:

  - check points that are in / out of the domain
  - use the petsc interpolation for points in the domain
  - use evalf rbf extrapolation for points outside the domain.

Adding an over-ride _evalf argument for the adv-diffusion solve to force the extrapolation / rbf everywhere.

This is a placeholder commit. There are still bits of string hanging out of the code and random print statements.

L
Rewrite of the uw.function.evaluate code. Now the code will check for points inside the domain and use PETSc interpolation for those. Points outside the domain are computed using the rbf_interpolation code which is perfectly happy to extrapolate wildly. This prevents crashes we were seeing with NodalPointSwarms / Semi-Lagrangian computations (particularly in curved domains).

Rather than exposing the evalf as a separate function, we now supply an argument to the evaluate method. We might want to change the name to rbf or something intuitive / meaningful.

Also had to rewrite the meshVariable / sympy printing code for each of the two functions as there were massive problems with the way the caching worked. I hope this is now fixed but, anyway, very strange that we did not see that bug appearing before
Why ?????

Because we did not code all the functions and so I wanted to have them back to make sure we don't lose the necessary code
Advection routines: evalf option is now just a flag passed in rather than a separate branch.
Joss submission branch - bring changes into dev.
julesghub and others added 20 commits July 24, 2025 12:57
Swarm rework dev merged - pull all development branch changes back into the swarm rework for synchronisation and testing.
Some small corrections to PR #2
Some rewriting of the internal solver documentation in response to JOSS reviews.

Updating notebooks to current codebase (e.g. evalf -> evaluate with rbf argument).

Improving adaptivity example
The usual siphon of Development into Main
Changes to notebooks and documentation - push through to dev / main so that the API builds etc reflect the updates.
Development - synchronise changes to documentation / JOSS
@lmoresi lmoresi merged commit e1fc97d into joss-submission Jul 29, 2025
5 checks passed
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.

4 participants