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

PETSc XZHermiteSpline #2917

Open
wants to merge 14 commits into
base: next
Choose a base branch
from
Open

PETSc XZHermiteSpline #2917

wants to merge 14 commits into from

Conversation

ZedThree
Copy link
Member

Continues #2858 pulling out a separate class for PetscXZHermiteSpline that was started in #2651

This does have a working implementation, but I've tried to switch it the existing PetscMatrix wrapper, and unfortunately I've gone wrong somewhere -- probably at the boundaries.

Double unfortunately, I really don't have much time to spend digging into this. @dschwoerer Maybe you want to take a look?

bendudson and others added 10 commits February 3, 2024 11:14
Reduce duplication by moving some overloads to the base class.
Optimised build was omitting XZInterpolation factory registrations.
* next: (194 commits)
  invert_laplace: Fix outer boundary metrics
  Apply clang-format changes
  Apply clang-format changes
  Apply suggestions from code review
  Fix missed adios
  Prefer ADIOS2 over ADIOS in more cases
  Update tests/unit/test_extras.hxx
  Apply clang-format changes
  Silence warning about assignment in `if` statement
  Fix some short identifiers
  Make a couple of implicit casts explicit
  CI: Suppress some warnings about short identifiers
  Move some static functions to anonymous namespace
  CI: Remove deprecated clang-tidy option
  Include header for `BoutReal`; remove unused header
  Apply clang-format
  Add options to set Butcher tables by name
  Simplify SUNDIALS cmake
  Switch to [[maybe_unused]]
  Apply suggestions from code review
  ...
Currently gives pretty bad results, not sure why
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
src/mesh/interpolation/petsc_hermite_spline_xz.cxx Outdated Show resolved Hide resolved
tests/integrated/test-interpolate/test_interpolate.cxx Outdated Show resolved Hide resolved
@boutproject boutproject deleted a comment from github-actions bot May 30, 2024
@ZedThree ZedThree marked this pull request as ready for review May 30, 2024 16:57
@ZedThree
Copy link
Member Author

Ok, I have managed to convert this to use the PetscMatrix interface. I need to spend a lot of time faffing about with GlobalIndexer and realised the source of my pain: it can only convert indices that are both local to and owned by the current process. For the interpolation here, we want to deal with indices that are on other processes. And because PetscMatrix wants to convert local indices to global ones, we need to first convert the global index of the (x, z) offsets into local ones, and then convert those to global indices.

So I've implemented a new GlobalIndexer subclass that will probably only work for very simple parallel decompositions, but can convert e.g. negative local indices into global ones. That gets an index converter that is actually pretty straightforward and can be used with PetscMatrix, which then allows a pretty clean implementation in our new interpolation!

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Although `getGlobal` is only valid for local indices, unfortunately
`isLocal` calls `getGlobal`, so we can't actually check!
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@ZedThree ZedThree changed the title WIP: PETSc XZHermiteSpline PETSc XZHermiteSpline May 31, 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

Successfully merging this pull request may close these issues.

2 participants