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

Adds StatusAcceptsRFactor #94

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cadaverous-lives
Copy link
Collaborator

@cadaverous-lives cadaverous-lives commented Dec 13, 2023

Mainly adds the function braid_StatusAcceptsRFactor which allows the user to query XBraid whether the function braid_StepStatusSetRFactor will actually take effect after this step or not. This gives users a simple way to compute error estimates only when absolutely necessary for refinement in time.

I am absolutely open to changing the name of this function if you don't find "accepts rfactor" to be intuitive, but I wanted to get a PR here before I forgot about this feature again.

Here is the implementation of this function:

braid_Int
braid_StatusAcceptsRFactor(braid_Status status)
{
   braid_Int level  = _braid_StatusElt(status, level);
   braid_Int caller = _braid_StatusElt(status, calling_function);
   /* Only accept rfactors in FRestrict on the fine-grid */
   return ((caller == braid_ASCaller_FRestrict || caller == braid_ASCaller_FASResidual) && (level == 0));
}

@cadaverous-lives cadaverous-lives changed the title Function to query XBraid status abouth whether refinement will be accepted during s Function to query XBraid status abouth whether refinement will be accepted during Step Dec 13, 2023
@cadaverous-lives cadaverous-lives changed the title Function to query XBraid status abouth whether refinement will be accepted during Step Adds StatusAcceptsRFactor Dec 13, 2023
@cadaverous-lives
Copy link
Collaborator Author

This should probably include logic to check whether the max_refine limit has been reached, right?

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