-
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
Small: Fix bug in sparse packs that include fluxes #1088
Conversation
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.
LGTM
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.
LGTM (given the limitations of my understanding of the internals of the sparse packs)
if (pv->IsSet(Metadata::Face)) { | ||
pack.pack_h_(0, b, idx).topological_element = | ||
TopologicalElement::E1; | ||
TopologicalElement::F1; | ||
pack.pack_h_(1, b, idx).topological_element = | ||
TopologicalElement::E2; | ||
TopologicalElement::F2; | ||
pack.pack_h_(2, b, idx).topological_element = | ||
TopologicalElement::E3; | ||
TopologicalElement::F3; |
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.
Was this a true bug?
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.
It was, but I don't think anyone code has actually used this information.
if (desc.with_fluxes) { | ||
pack.flx_idx_ = 1; | ||
if (contains_face_with_fluxes) { | ||
leading_dim += 5; |
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.
5 because of the face itself and 4 edges/fluxes?
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.
leading_dim
starts at 1, so this makes it 6. When a face has fluxes, the face itself has 3 components and the edge flux has 3 components.
PR Summary
This PR fixes sparse packs so that they will correctly include generalized fluxes for face and edge centered fields. Previously, the fluxes were only included in the pack if the field was a cell centered field.
PR Checklist