-
Notifications
You must be signed in to change notification settings - Fork 37
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 MeshData
variant for refinement tagging
#1182
Open
acreyes
wants to merge
54
commits into
parthenon-hpc-lab:develop
Choose a base branch
from
acreyes:acreyes/meshdata-refinement
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 49 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
6814173
meshdata version of refinement tagging
acreyes 6df75e7
got initialization and vector indices working
acreyes 2fdc2ed
fix tensor indices
acreyes 5cb25b4
added CheckRefinementMesh to fine-advection example
acreyes 3ad74e1
cleaning up var names
acreyes 16a1c58
cleanup
acreyes 6e1b905
adding scatter view utilities
acreyes 2b6545c
scatterview version of refinement
acreyes ccf72b0
burgers-benchmark uses Tag<MeshData>
acreyes d7d536f
add hierarchial par
acreyes fa37fb9
cleanup includes
acreyes 401f412
missed one
acreyes 638e077
Update CHANGELOG.md
acreyes b6e0e6b
remove default level tag
acreyes 2b3f32a
default CheckRefineMesh to true
acreyes 622882d
respect amr_criteria max_level
acreyes 5b7863b
renaming delta_levels->amr_tags, mc->md
acreyes 06e0ade
fix refinement/bc order
acreyes 3cf589d
docs for CheckRefinementMesh
acreyes 7ea604c
move amr_tags array to mesh
acreyes d2a92b0
Merge branch 'develop' into acreyes/meshdata-refinement
Yurlungur dd4a652
adding comments for ScatterMax view
acreyes fe95b47
it compiles at least
jonahm-LANL 554a1d4
add easy machinery to register reflecting BCs
jonahm-LANL 781d032
changelog
acreyes c1beb9e
swarm bcs differetn from mesh bcs
jonahm-LANL 9e8b17f
use new input block
jonahm-LANL bcbc1c7
typo
jonahm-LANL b2a5e52
add error checking for swarm/mesh BC consistency
jonahm-LANL 46517ab
typo
jonahm-LANL f9313d3
phdf diff
jonahm-LANL 20abf5a
Register reflecting BCs for advection examples
jonahm-LANL 1408bf0
typo
jonahm-LANL 5b91a7a
silly backwards compatibility thing to make it so you don't have to s…
jonahm-LANL 382a6a7
working
lroberts36 4ee02c5
changelog
lroberts36 862c2a9
Make everything work
lroberts36 bd50d24
format
lroberts36 09464c2
maybe fix doc issue?
lroberts36 df06a50
Address CUDA MPI/ICP issue with Kokkos <=4.4.1 (#1189)
pgrete 511c77c
Jonah's fix for this CI issue
brryan 328dc33
CHANGELOG
brryan 5e657c0
Remove else from if constexpr when there are returns
adamdempsey90 dd928ab
Consolidate buffer packing functions with less atomics (#1199)
alexrlongne 0cbbdac
[Trivial] Fix type used for array init (#1170)
pgrete 01517f7
Leapfrog fix (#1206)
brryan 3ddbb9f
removing meshblock amr_criteria
acreyes 454324f
Merge remote-tracking branch 'upstream/develop' into acreyes/meshdata…
acreyes 9cdf3aa
Merge remote-tracking branch 'upstream/develop' into acreyes/meshdata…
acreyes ed3e16f
use pack.UpperBound(b) to check allocation
acreyes cc01266
Merge branch 'develop' into acreyes/meshdata-refinement
pgrete 5a2470b
Merge branch 'develop' into acreyes/meshdata-refinement
Yurlungur cc97120
remove meshblock first/second derivative from cpp
acreyes 9338c54
linting
acreyes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,31 +78,44 @@ std::shared_ptr<AMRCriteria> AMRCriteria::MakeAMRCriteria(std::string &criteria, | |
block_name + ": " + criteria); | ||
} | ||
|
||
AMRBounds AMRCriteria::GetBounds(const MeshBlockData<Real> *rc) const { | ||
auto ib = rc->GetBoundsI(IndexDomain::interior); | ||
auto jb = rc->GetBoundsJ(IndexDomain::interior); | ||
auto kb = rc->GetBoundsK(IndexDomain::interior); | ||
return AMRBounds(ib, jb, kb); | ||
} | ||
|
||
AmrTag AMRFirstDerivative::operator()(const MeshBlockData<Real> *rc) const { | ||
if (!rc->HasVariable(field) || !rc->IsAllocated(field)) { | ||
return AmrTag::same; | ||
void AMRFirstDerivative::operator()(MeshData<Real> *md, | ||
ParArray1D<AmrTag> &amr_tags) const { | ||
auto ib = md->GetBoundsI(IndexDomain::interior); | ||
auto jb = md->GetBoundsJ(IndexDomain::interior); | ||
auto kb = md->GetBoundsK(IndexDomain::interior); | ||
auto bnds = AMRBounds(ib, jb, kb); | ||
auto dims = md->GetMeshPointer()->resolved_packages->FieldMetadata(field).Shape(); | ||
int n5(0), n4(0); | ||
if (dims.size() > 2) { | ||
n5 = dims[1]; | ||
n4 = dims[2]; | ||
} else if (dims.size() > 1) { | ||
n5 = dims[0]; | ||
n4 = dims[1]; | ||
} | ||
auto bnds = GetBounds(rc); | ||
auto q = Kokkos::subview(rc->Get(field).data, comp6, comp5, comp4, Kokkos::ALL(), | ||
Kokkos::ALL(), Kokkos::ALL()); | ||
return Refinement::FirstDerivative(bnds, q, refine_criteria, derefine_criteria); | ||
const int idx = comp4 + n4 * (comp5 + n5 * comp6); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if we don't have a simpler way to get a flat index (I imagine there must be more places with thus use case but I don't recall offhand). |
||
Refinement::FirstDerivative(bnds, md, field, idx, amr_tags, refine_criteria, | ||
derefine_criteria, max_level); | ||
} | ||
|
||
AmrTag AMRSecondDerivative::operator()(const MeshBlockData<Real> *rc) const { | ||
if (!rc->HasVariable(field) || !rc->IsAllocated(field)) { | ||
return AmrTag::same; | ||
void AMRSecondDerivative::operator()(MeshData<Real> *md, | ||
ParArray1D<AmrTag> &amr_tags) const { | ||
auto ib = md->GetBoundsI(IndexDomain::interior); | ||
auto jb = md->GetBoundsJ(IndexDomain::interior); | ||
auto kb = md->GetBoundsK(IndexDomain::interior); | ||
auto bnds = AMRBounds(ib, jb, kb); | ||
auto dims = md->GetMeshPointer()->resolved_packages->FieldMetadata(field).Shape(); | ||
int n5(0), n4(0); | ||
if (dims.size() > 2) { | ||
n5 = dims[1]; | ||
n4 = dims[2]; | ||
} else if (dims.size() > 1) { | ||
n5 = dims[0]; | ||
n4 = dims[1]; | ||
} | ||
auto bnds = GetBounds(rc); | ||
auto q = Kokkos::subview(rc->Get(field).data, comp6, comp5, comp4, Kokkos::ALL(), | ||
Kokkos::ALL(), Kokkos::ALL()); | ||
return Refinement::SecondDerivative(bnds, q, refine_criteria, derefine_criteria); | ||
const int idx = comp4 + n4 * (comp5 + n5 * comp6); | ||
Refinement::SecondDerivative(bnds, md, field, idx, amr_tags, refine_criteria, | ||
derefine_criteria, max_level); | ||
} | ||
|
||
} // namespace parthenon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another way to check if a variable in a sparse pack is allocated, maybe using
n
similar toVariablePack::IsAllocated
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SparsePacks
only pack variables that are allocated, so the standard way to check if a field is allocated is to compare