Skip to content

Conversation

@bprather
Copy link
Contributor

@bprather bprather commented Jul 24, 2024

This is a testing branch for moving KHARMA back atop Parthenon's develop branch. It seems to break a few minor things, and one major thing: the old BiCGSTAB solver KHARMA leverages for cleaning the magnetic field no longer works with new tasking.

However, Parthenon now has much more powerful geometric multigrid (GMG) solvers, and I've written a new magnetic field cleanup based on them which is faster and seemingly more reliable, but which more importantly supports SMR/AMR grids as we need for resizing INCITE simulations. (Note it doesn't support cell-centered fields, and likely not Dirichlet boundaries either)

Currently this breaks old stuff and is maybe slow, and there's more modernization (type-based variables & packs) that I want to throw in before merging.

If you happen to need to resize a simulation onto an SMR grid, though, this will do it!

Ben Prather added 7 commits July 23, 2024 15:33
* PtoU for face B field was zeroing dB on poles, not B, which was useless
* Parthenon now has a def SMALL which conflicted with our macro.
  Their version is *very* small though, so left ours in place.
The existing magnetic field cleanup invoked when resizing a
simulation uses a fork of Parthenon's old BiCGSTAB solver.
This is fine, but doesn't support SMR/AMR grids.

Parthenon's new multigrid solvers *do* support SMR grids,
So I've added a magnetic field cleanup which uses them.
As a bonus, they converge much faster and to seemingly
arbitrary precision.

The new cleanup does not support cell-centered B fields,
so the old one has been left in for now.  However,
it doesn't work in this branch due to the old solver breaking,
so it may as soon be eliminated as repaired, I'm not sure.
Stuff from testing GMG at scale: read enough zones to interpolate all
face-centered fields, better handle boundaries/ghosts.

GMG is slower than expected, probably due to single-level boundary
conditions (which amount to a different boundary per MG level),
but eventually converges to the divB < 1e-7 for 120M cells in 1/2hr on
a CPU, which we'll call a win.
Move to the actual, official parthenon `develop`.  We still carry
three patches, two of which are submitted upstream.  Not sure
the third is even necessary anymore, but best to carry it until we
can test everywhere.
@bprather bprather mentioned this pull request Aug 8, 2024
Ben Prather added 22 commits August 26, 2024 11:09
(And reconfigure the fix a bit to copy/allocate less)
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