Skip to content

Conversation

@bprather
Copy link
Contributor

This is an attempt at writing a ray-traced imaging code directly into KHARMA.

The initial target is "offline" imaging: ray-tracing of existing output files and analytic models e.g. the thin disk. This is more or less working in this PR, although loading could be more straightforward (currently, imaging a dump requires "restarting" from it, which comes with a host of Parthenon idiosyncracies). With some tweaking around parameter parsing, this could be a drop-in replacement for ipole in some contexts.

Eventually, the goal is coincident imaging, integrated into the KHARMA step -- this is both a compelling science case in and of itself (true slow light imaging), and a jumping off point for monte carlo and MOC radiative transfer in KHARMA.

Ben Prather added 30 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.
(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