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

Add Subycling Support #297

Closed
wants to merge 9 commits into from
Closed

Add Subycling Support #297

wants to merge 9 commits into from

Conversation

lwJi
Copy link
Contributor

@lwJi lwJi commented Jul 27, 2024

  1. update CarpetX to support subcycling time steping

  2. add Subcycling Thorn

    • provide subcycling.hxx which implement the subcyling algorithm of Peter McCorquodale and Phillip Colella (2011)
    • provide flag isrmbndry to identify refinement boundary of ghost points
  3. add TestSubycling Thorn

@lwJi lwJi requested review from eschnett and rhaas80 July 27, 2024 15:03
Copy link
Member

@rhaas80 rhaas80 left a comment

Choose a reason for hiding this comment

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

Seems like the test case is good for development but too large for a regression test, see: https://docs.einsteintoolkit.org/et-docs/Adding_a_test_case

{
} no


Copy link
Member

Choose a reason for hiding this comment

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

what's the reason for making it restricted? Should there be any other thorn that accesses it? ODESolvers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. And also for those evolution thorns, they will need a flag to determine if they want allocate memories for ks or not.

@@ -1755,6 +1771,12 @@ int Evolve(tFleshConfig *config) {

CycleTimelevels(cctkGH);

cctkGH->cctk_timefac = (use_subcycling_wip) ? std::pow(2, min_level) : 1;
Copy link
Member

Choose a reason for hiding this comment

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

parens are superfluous

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@@ -0,0 +1,9 @@
Cactus Code Thorn Subcycling
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather have separate pull requests for the CarpetX infrastructure and this code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's required for the unit test. It's difficult to come up a new unit test just test the change in CarpetX. Or we can take that the change we made in CarpetX didn't break any of the old unit test as a good 'unit test' :)

grid.loop_ghosts_device<0, 0, 0>(
grid.nghostzones,
[=] CCTK_DEVICE(const Loop::PointDesc &p) CCTK_ATTRIBUTE_ALWAYS_INLINE {
isrmbndry(p.I) = (level_neighbor(p.I) == cctk_level) ? 0 : 1;
Copy link
Member

Choose a reason for hiding this comment

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

this also flags points that are restricted into as refinement boundaries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this only flags points that are restricted into as refinement boundaries

// Default: vertex-centred
index = {0, 0, 0};
} else if (iret >= 0) {
assert(iret == Loop::dim);
Copy link
Member

Choose a reason for hiding this comment

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

this may benefit (here and in the source in CapretX) from a better error message since this error is user triggerable when they say eg centering={cc}

const CCTK_REAL dtc, const CCTK_REAL xsi, const CCTK_INT stage) {
assert(stage > 0 && stage <= 4);

CCTK_REAL r = 0.5; // ratio between coarse and fine cell size (2 to 1 MR case)
Copy link
Member

Choose a reason for hiding this comment

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

cite the paper describing the method and the equations you are using

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

{
"standing wave" :: "Standing wave"
"Gaussian" :: "Gaussian"
} "standing wave"
Copy link
Member

Choose a reason for hiding this comment

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

You need both? These are just copied from wavetoy, yes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I just copied from wavetoy

@@ -0,0 +1,9 @@
Cactus Code Thorn TestSubcycling
Copy link
Member

Choose a reason for hiding this comment

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

does this need a specific thorn? Ie does the client thorn for subcycling in time have to be aware of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess you were talking about thorn Subcycling here. No, the client thorn need not to be aware of it. But I thought this will be modulated if we separate it from CarpetX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, if you are implementing RK4 yourself instead of using ODESovler, then your thorn should be aware of Subcycling

@lwJi lwJi closed this Jul 29, 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