-
Notifications
You must be signed in to change notification settings - Fork 12
Add Self-Gravity #113
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
base: develop
Are you sure you want to change the base?
Add Self-Gravity #113
Conversation
| if (pin->DoesBlockExist("gravity/self")) { | ||
| count++; | ||
| gtype = GravityType::self; | ||
| block_name = "gravity/self"; | ||
| PARTHENON_REQUIRE(coords == Coordinates::cartesian, | ||
| "Self-gravity currently only supports Cartesian coordinates"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to its own node <selfgravity>. A few reasons: (1) it's only Cartesian unlike the other ones, (2) it complicates gravity's Initialize and (3) we have to be able to have both self-gravity and point mass gravity on at the same time.
| const Real bdt = integrator->beta[stage - 1] * integrator->dt; | ||
|
|
||
| // Compute gravitational potential | ||
| if (do_gravity) Gravity::SolvePoisson(tc, pmesh); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (do_self_gravity)
src/gravity/gravity.cpp
Outdated
| psolver = | ||
| std::make_shared<parthenon::solvers::BiCGSTABSolver<PoissEq, preconditioner_t>>( | ||
| "base", "phi", "rhs", pin, block_name, PoissEq(pin, block_name)); | ||
| // psolver = std::make_shared<parthenon::solvers::MGSolver<PoissEq, prolongator_t>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove MG.
src/gravity/poisson_driver.cpp
Outdated
| @@ -0,0 +1,80 @@ | |||
| //======================================================================================== | |||
| // (C) (or copyright) 2023. Triad National Security, LLC. All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledge parthenon poisson_gmg example
| @@ -0,0 +1,113 @@ | |||
| //======================================================================================== | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this pgen isn't quite up-to-par... also need more formal testing (e.g., Jeans linear waves, Spitzer sheet, etc...)
| const Real xp = coords.template Xc<dir>(k + koff, j + joff, i + ioff); | ||
| const Real xc = coords.template Xc<dir>(k, j, i); | ||
| const Real xm = coords.template Xc<dir>(k - koff, j - joff, i - ioff); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use our coordinates object here and elsewhere in this file?
Background
Description of Changes
Checklist