Skip to content

Conversation

@pdmullen
Copy link
Collaborator

Background

Description of Changes

Checklist

  • New features are documented
  • Tests added for bug fixes and new features
  • (@lanl.gov employees) Update copyright on changed files

@pdmullen pdmullen changed the title Draft: Debugging self-gravity Draft: Add Self-Gravity Dec 16, 2025
Comment on lines +150 to +155
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");
Copy link
Collaborator

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);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if (do_self_gravity)

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>>(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove MG.

@@ -0,0 +1,80 @@
//========================================================================================
// (C) (or copyright) 2023. Triad National Security, LLC. All rights reserved.
Copy link
Collaborator Author

@pdmullen pdmullen Dec 17, 2025

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 @@
//========================================================================================
Copy link
Collaborator Author

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...)

@pdmullen pdmullen changed the title Draft: Add Self-Gravity Add Self-Gravity Dec 17, 2025
Comment on lines +66 to +68
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);
Copy link
Collaborator

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?

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.

3 participants