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

Restore the prune function to Ordinate_Space. #477

Merged
merged 4 commits into from
Sep 19, 2018

Conversation

kgbudge
Copy link
Contributor

@kgbudge kgbudge commented Sep 18, 2018

The prune function of Ordinate_Space always returns true, and on this basis it was removed from the class. However, this is a virtual function that is nontrivially overridden by Galerkin_Ordinate_Space, and its removal changes the solution slightly in one of the Capsaicin benchmarks.

The difference is quite small, but until I can better recall why this was done in the first place, I suggest we restore the Ordinate_Space::prune function and restore the if-test using prune.

Status

This is overridden by Galerkin_Ordinate_Space and this changes the solution slightly in one of the Capsaicin benchmarks.
@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #477 into develop will increase coverage by <.1%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           develop    #477     +/-   ##
=========================================
+ Coverage     91.8%   91.8%   +<.1%     
=========================================
  Files          375     375             
  Lines        17472   17476      +4     
=========================================
+ Hits         16045   16054      +9     
+ Misses        1427    1422      -5

@KineticTheory
Copy link
Collaborator

@kgbudge There were testing issues on ccscs2 (not your fault). I'll restart the tests.

Copy link
Collaborator

@KineticTheory KineticTheory left a comment

Choose a reason for hiding this comment

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

Overall this looks fine. However, I would like to see a unit test addition that covers the new code in Ordinate_Space.hh and a new test case that covers the code block that can be activated by prune()==false in Ordinate_Space.cc (see review comments for details).

// member function prune() always returns true?
// if (l <= Lmax || !prune()) {
if (l <= Lmax) {
if (l <= Lmax || !prune()) {
if (l > Lmax) {
Lmax = l;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you provide a test case that covers this branch for this block of code?

        if (l > Lmax) {
          Lmax = l;
          moments_per_order_.resize(Lmax + 1, 0U);
        }

This seems like a corner case and I don't understand what conditions would lead us here.

src/quadrature/Ordinate_Space.hh Show resolved Hide resolved
@KineticTheory
Copy link
Collaborator

@kgbudge It looks like the added function virtual bool prune() const from Ordinate_Space.hh remains uncovered. Can you make it pure virtual or add a test?

@KineticTheory KineticTheory merged commit d9086b3 into lanl:develop Sep 19, 2018
@kgbudge kgbudge deleted the prune_galerkin branch September 20, 2018 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants