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 a helper function that returns the fine grid dx #2599

Closed
wants to merge 3 commits into from

Conversation

zingale
Copy link
Member

@zingale zingale commented Oct 3, 2023

this is for the case when we need dx before the level hierarchy is setup, like in problem_initialize.H

PR summary

PR motivation

PR checklist

  • test suite needs to be run on this PR
  • this PR will change answers in the test suite to more than roundoff level
  • all newly-added functions have docstrings as per the coding conventions
  • the CHANGES file has been updated, if appropriate
  • if appropriate, this change is described in the docs

this is for the case when we need dx before the level hierarchy
is setup, like in problem_initialize.H
@zingale
Copy link
Member Author

zingale commented Oct 3, 2023

closes #669

@maxpkatz
Copy link
Member

maxpkatz commented Oct 6, 2023

I think I am confused about whether we still need this. At this point, problem_initialize() is called in Castro::initMFs(), which is done in the Castro constructor after the Amr object has been created, so the geometry object on all levels should already be populated.

@zingale
Copy link
Member Author

zingale commented Oct 6, 2023

Oh. Then how do I get the fine level dx?

@WeiqunZhang
Copy link
Member

If you make problem_initialize a member function of Castro, you can get the Geometry on the max_level with this->parent->Geom(this->parent->maxLevel()). You can also change the interface of the function and pass this to problem_initialize(Castro const*), if you don't want to make it a member function. It's basically the same thing. A member function has this as a hidden argument.

@WeiqunZhang
Copy link
Member

Another possibility is to store a pointer to Amr after it's created in main.cpp as a global variable. Then you can access it from anywhere.

@zingale
Copy link
Member Author

zingale commented Oct 7, 2023

closing in favor of #2608

@zingale zingale closed this Oct 7, 2023
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