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

Small: Fix bug in sparse packs that include fluxes #1088

Merged
merged 4 commits into from
May 23, 2024

Conversation

lroberts36
Copy link
Collaborator

@lroberts36 lroberts36 commented May 23, 2024

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

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

@lroberts36 lroberts36 added the bug Something isn't working label May 23, 2024
@lroberts36 lroberts36 changed the title Fix bug in sparse packs that include fluxes Small: Fix bug in sparse packs that include fluxes May 23, 2024
Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

LGTM

@lroberts36 lroberts36 enabled auto-merge May 23, 2024 03:17
Copy link
Collaborator

@pgrete pgrete left a 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)

Comment on lines 216 to +222
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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@lroberts36 lroberts36 merged commit 22b5159 into develop May 23, 2024
49 checks passed
@Yurlungur Yurlungur deleted the lroberts36/fix-sparse-pack-fluxes branch May 23, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants