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

enable explicit solver with SI units #499

Merged

Conversation

SeverinDiederichs
Copy link
Member

This PR enables the explicit solver with SI units.

In the explicit solver routine, all quantities are converted to normalized units, the field is solved in normalized units and then it is backtransformed to SI units (if run in SI units).

This can be tested with a script by @MaxThevenet which can be used in the blowout_wake example:

#! /usr/bin/env bash

HIPACE_EXECUTABLE=../../build/bin/hipace

rm -rf si_data
rm -rf normalized_data
# Run the simulation
mpiexec -n 2 $HIPACE_EXECUTABLE inputs_SI \
        hipace.file_prefix=si_data/ \
        hipace.bxby_solver=explicit \
        max_step=1

mpiexec -n 2 $HIPACE_EXECUTABLE inputs_normalized \
        hipace.file_prefix=normalized_data/ \
        hipace.bxby_solver=explicit \
        max_step=1

# Compare the result with theory
./analysis.py \
    --do-plot \
    --normalized-data normalized_data/ \
    --si-data si_data

To do so, all fixed weight calls must be removed from the analysis script.

By doing a more challenging test (increasing the beam density by a factor of 10, giving the beam an initial transverse momentum), normalized units and SI units agree to machine precision.

  • 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 unit system handling of both SI and normalized units options label May 12, 2021
@SeverinDiederichs SeverinDiederichs linked an issue May 17, 2021 that may be closed by this pull request
@MaxThevenet
Copy link
Member

could you resolve conflicts?

Copy link
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.

Looks great, thanks for fixing this!

@SeverinDiederichs SeverinDiederichs merged commit b12aa23 into Hi-PACE:development May 17, 2021
@SeverinDiederichs SeverinDiederichs deleted the clean_explicit_SI branch May 17, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit system handling of both SI and normalized units options
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement SI for the explicit solver
2 participants