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

Move Minmod implementation into a .tpp file #1429

Merged
merged 4 commits into from Mar 15, 2019

Conversation

fmahebert
Copy link
Contributor

Proposed changes

  • Move the implementation of the Minmod limiter from a .cpp file to a .tpp file. The extra work to "type erase" neighbor data so that it could be used in a template-free function in the .cpp file becomes unnecessary, and so is removed.
  • Add explicit instantiations of the Minmod limiter for relevant systems (Burgers and ValenciaDivClean). These explicit instantiations should allow the compile-time implementation not to further bog down the compilation of executables.

Types of changes:

  • Bugfix
  • New feature### Further comments

Component:

  • Code
  • Documentation
  • Build system
  • Continuous integration

Code review checklist

  • The PR passes all checks, including unit tests, clang-tidy and IWYU.
    For instructions on how to perform the CI checks locally refer to the Dev
    guide on the Travis CI
    .
  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.

Copy link
Member

@nilsdeppe nilsdeppe left a comment

Choose a reason for hiding this comment

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

I just have one topic for design discussion, but over all I'm happy with this.

@@ -6,6 +6,7 @@ set(LIBRARY Burgers)
set(LIBRARY_SOURCES
Equations.cpp
Fluxes.cpp
Minmod.cpp
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should generalize this to LimiterInstantiations.cpp and instantiate all limiters there?

Copy link
Contributor Author

@fmahebert fmahebert Mar 14, 2019

Choose a reason for hiding this comment

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

As I see it: the advantages to grouping the instantiations into a single file are (a) having fewer files and (b) making it easier to see what limiters are available for each system; the downside is having to re-instantiate all limiters when one limiter changes. Are there other considerations that I am missing?

At the moment I do not have a strong opinion on the matter, so I am happy to make the change if you prefer it. Just let me know what you think 🙂

Copy link
Member

Choose a reason for hiding this comment

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

Those are the only two things I can think of. Given that the number of limiters we will have will be < 10 (or at least given the current literature it seems unlikely to exceed 10) I think having separate files so that the compilation can be parallelized better is a good thing :)

@kidder kidder merged commit 41e6cb8 into sxs-collaboration:develop Mar 15, 2019
@fmahebert fmahebert deleted the move_minmod_tpp branch April 1, 2019 01:39
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

3 participants