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

TagBoxArray::hasTags #1274

Merged
merged 1 commit into from
Aug 18, 2020
Merged

Conversation

WeiqunZhang
Copy link
Member

Summary

In #1258, TagBoxArray::numtags was removed. However, IAMR still needs it.
So a new function, hasTags, is added for IAMR.

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

In AMReX-Codes#1258, TagBoxArray::numtags was removed.  However, IAMR still needs it.
So a new function, hasTags, is added for IAMR.
@WeiqunZhang
Copy link
Member Author

Please make the following change in IAmR

diff --git a/Source/NavierStokesBase.cpp b/Source/NavierStokesBase.cpp
index db08de3..ca575ef 100644
--- a/Source/NavierStokesBase.cpp
+++ b/Source/NavierStokesBase.cpp
@@ -2367,11 +2367,7 @@ NavierStokesBase::manual_tags_placement (TagBoxArray&    tags,
                 // Only refine if there are already tagged cells in the outflow
                 // region
                 //
-                bool hasTags = false;
-                for (MFIter tbi(tags); !hasTags && tbi.isValid(); ++tbi)
-                    if (tags[tbi].numTags(outflowBox) > 0)
-                        hasTags = true;
-               ParallelAllReduce::Or(hasTags, ParallelContext::CommunicatorSub());
+                bool hasTags = tags.hasTags(outflowBox);
                 if (hasTags)
                     tags.setVal(BoxArray(&outflowBox,1),TagBox::SET);
            }

@drummerdoc
Copy link
Member

Change made to IAMR.

@drummerdoc drummerdoc merged commit f71d122 into AMReX-Codes:development Aug 18, 2020
WeiqunZhang added a commit to WeiqunZhang/amrex that referenced this pull request Aug 18, 2020
The typo was introduced in AMReX-Codes#1274.
@WeiqunZhang WeiqunZhang mentioned this pull request Aug 18, 2020
5 tasks
atmyers pushed a commit that referenced this pull request Aug 18, 2020
The typo was introduced in #1274.
@WeiqunZhang WeiqunZhang deleted the numtags branch September 20, 2020 20:29
dwillcox pushed a commit to dwillcox/amrex that referenced this pull request Oct 3, 2020
In AMReX-Codes#1258, TagBoxArray::numtags was removed.  However, IAMR still needs it.
So a new function, hasTags, is added for IAMR.
dwillcox pushed a commit to dwillcox/amrex that referenced this pull request Oct 3, 2020
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.

None yet

2 participants