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

Changing computation at inflow/outflow for tensor solve #1235

Merged
merged 9 commits into from
Aug 10, 2020

Conversation

OscarAntepara
Copy link
Contributor

Summary

Computation at inflow boundaries for the MLEBTensor and inflow/outflow for MLTensor has been changed.

Additional background

At outflow the tensor solve uses extrapolated values from the interior cell to the outflow face. At inflow, the tensor solve uses boundary data, evaluated at the face, that has been stored in the ghost cell next to the inflow face.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • are described in the proposed changes to the AMReX documentation, if appropriate

Copy link
Member

@WeiqunZhang WeiqunZhang left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just two minor comments.

Array2D<BoundCond,0,2*AMREX_SPACEDIM-1,0,AMREX_SPACEDIM-1> bct;
for (OrientationIter face; face; ++face) {
Orientation ori = face();
for (int icomp = 0; icomp < AMREX_SPACEDIM; ++icomp) {
Copy link
Member

Choose a reason for hiding this comment

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

It will be slightly more efficient to do

for (int icomp ...)
    for (OrientationIter ...)

Could you switch the looping order here at similar other places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!! I did the changes as suggested.

@WeiqunZhang WeiqunZhang merged commit b391885 into AMReX-Codes:development Aug 10, 2020
WeiqunZhang pushed a commit that referenced this pull request Aug 11, 2020
## Summary
Correcting tensor cross terms computation for periodic bcs

## Additional background
Fixing a bug introduced in PR #1235. Now it computes in the correct way the cross terms in the tensor solve for problems with periodic bcs. 

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [x] changes answers in the test suite to more than roundoff level
- [x] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
WeiqunZhang added a commit to WeiqunZhang/amrex that referenced this pull request Aug 13, 2020
ParmParse parameter eb2.extend_domain_face is now true by default.  The
reason for the change is that for most applications it's hard to imagine one
would want it to be false.  It will also solve the EB tensor solver issue
when there is a cut cell just outside the domain abutting a covered valid
cell.

Recent changes to the tensor solvers are incorrect and are reverted here.
They are incorrect because the ghost cells in the modified functions
actually have values at the cell centered.  Although the users put domain
face values in the ghost cells, that is not what the solver does.  The
solver stores the boundary values in boundary registers.  Before the stencil
is being applied, bc function is called to fill the ghost cells with
properly interpolated or extrapolated values so that the stencil operations
are just like working on normal interior cells.

Revert "Correcting tensor cross terms computation for periodic bcs (AMReX-Codes#1254)"
This reverts commit 1197adc.

Revert "Changing computation at inflow/outflow for tensor solve (AMReX-Codes#1235)"
This reverts commit b391885.

Revert "Changing computation at outflow for the EBTensor (AMReX-Codes#1187)"
This reverts commit 9cd5388.
WeiqunZhang added a commit that referenced this pull request Aug 14, 2020
## Summary

ParmParse parameter eb2.extend_domain_face is now true by default.  The
reason for the change is that for most applications it's hard to imagine one
would want it to be false.  It will also solve the EB tensor solver issue
when there is a cut cell just outside the domain abutting a covered valid
cell.

Recent changes to the tensor solvers are incorrect and are reverted here.
They are incorrect because the ghost cells in the modified functions
actually have values at the cell centered.  Although the users put domain
face values in the ghost cells, that is not what the solver does.  The
solver stores the boundary values in boundary registers.  Before the stencil
is being applied, bc function is called to fill the ghost cells with
properly interpolated or extrapolated values so that the stencil operations
are just like working on normal interior cells.

Revert "Correcting tensor cross terms computation for periodic bcs (#1254)"
This reverts commit 1197adc.

Revert "Changing computation at inflow/outflow for tensor solve (#1235)"
This reverts commit b391885.

Revert "Changing computation at outflow for the EBTensor (#1187)"
This reverts commit 9cd5388.

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [x] changes answers in the test suite to more than roundoff level
- [x] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
dwillcox pushed a commit to dwillcox/amrex that referenced this pull request Oct 3, 2020
…1235)

## Summary
Computation at inflow boundaries for the MLEBTensor and inflow/outflow for MLTensor has been changed.

## Additional background
At outflow the tensor solve uses extrapolated values from the interior cell to the outflow face. At inflow, the tensor solve uses boundary data, evaluated at the face, that has been stored in the ghost cell next to the inflow face.

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [x] changes answers in the test suite to more than roundoff level
- [x] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
dwillcox pushed a commit to dwillcox/amrex that referenced this pull request Oct 3, 2020
…es#1254)

## Summary
Correcting tensor cross terms computation for periodic bcs

## Additional background
Fixing a bug introduced in PR AMReX-Codes#1235. Now it computes in the correct way the cross terms in the tensor solve for problems with periodic bcs. 

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [x] changes answers in the test suite to more than roundoff level
- [x] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
dwillcox pushed a commit to dwillcox/amrex that referenced this pull request Oct 3, 2020
## Summary

ParmParse parameter eb2.extend_domain_face is now true by default.  The
reason for the change is that for most applications it's hard to imagine one
would want it to be false.  It will also solve the EB tensor solver issue
when there is a cut cell just outside the domain abutting a covered valid
cell.

Recent changes to the tensor solvers are incorrect and are reverted here.
They are incorrect because the ghost cells in the modified functions
actually have values at the cell centered.  Although the users put domain
face values in the ghost cells, that is not what the solver does.  The
solver stores the boundary values in boundary registers.  Before the stencil
is being applied, bc function is called to fill the ghost cells with
properly interpolated or extrapolated values so that the stencil operations
are just like working on normal interior cells.

Revert "Correcting tensor cross terms computation for periodic bcs (AMReX-Codes#1254)"
This reverts commit 1197adc.

Revert "Changing computation at inflow/outflow for tensor solve (AMReX-Codes#1235)"
This reverts commit b391885.

Revert "Changing computation at outflow for the EBTensor (AMReX-Codes#1187)"
This reverts commit 9cd5388.

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [x] changes answers in the test suite to more than roundoff level
- [x] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
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