Skip to content

Enable longitudinal refinement#574

Merged
MaxThevenet merged 17 commits into
Hi-PACE:developmentfrom
SeverinDiederichs:mr_long_refinement_new
Sep 8, 2021
Merged

Enable longitudinal refinement#574
MaxThevenet merged 17 commits into
Hi-PACE:developmentfrom
SeverinDiederichs:mr_long_refinement_new

Conversation

@SeverinDiederichs
Copy link
Copy Markdown
Member

@SeverinDiederichs SeverinDiederichs commented Jul 28, 2021

This PR enables longitudinal refinement for the refined level. It is a clean re-opening of #565.
It is based on #572 and should only be reviewed after #572 is merged

Longitudinal is done in the following way:

The beam is binned per level. In the loop over the slices of the coarse grid, a sub-loop over the refined grid is done. For a refinement ratio of 4, 4 sub-slices are calculated.

  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@SeverinDiederichs SeverinDiederichs added the mesh refinement anything related to mesh refinement label Jul 28, 2021
@MaxThevenet
Copy link
Copy Markdown
Member

Thanks for this PR!
Oops some conflicts appeared, do you think you could fix them?

Copy link
Copy Markdown
Member

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Just have 1 style comment, which applies to a few places in the code.

Comment thread src/fields/Fields.cpp Outdated
if (pos < patch_lo || pos > patch_hi) continue;
}

amrex::MultiFab::Copy( // shift Bx, By
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure this is safe across compilers and configurations. Instead of

f( // comment
    a, b);

Could you do one of these?

f( /* comment */
    a, b);
// comment
f(
    a, b);

@MaxThevenet MaxThevenet merged commit deb1c76 into Hi-PACE:development Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mesh refinement anything related to mesh refinement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants