-
Notifications
You must be signed in to change notification settings - Fork 17
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
openPMD: read input beam from HDF5 file #285
Conversation
… and beam.input_file = PATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks! Just one formatting point: for the preprocessor directives, could you remove the indentation for all of them (I wrote a suggestion just for one of them)? Just to be consistent with the rest of the code.
git grep " #"
will show you where these directives are indented.
@@ -289,10 +289,10 @@ InitBeamFromFileHelper (std::string input_file, | |||
const amrex::Geometry& geom, | |||
const amrex::Real n_0) | |||
{ | |||
HIPACE_PROFILE("BeamParticleContainer::InitParticles"); | |||
|
|||
#ifdef HIPACE_USE_OPENPMD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifdef HIPACE_USE_OPENPMD | |
#ifdef HIPACE_USE_OPENPMD |
There was a problem hiding this 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!
Small tweaks: manly to use make_constants_SI() function instead of hard-coded variables.
This PR implements functionality to use a HDF5 file as a beam input.
To compile use:
Use the file (e.g. beam_00000.h5 ) with
The Beam has to be in iteration 0 of the file. The physical quantities (r ,u ,q, m) can be named arbitrarily, however the corresponding units have to be correct. The coordinate Axis are assumed to be named x y z or X Y Z.
If not it is possible to specify new names with
to map file coordinates x1 x2 x3 to Hipace coordinates x y z. This can also be used to swap coordinates (e.g. x and z)
Since Beam Particle mass is currently not used it is optional in the file, but if specified the ratio Charge / Mass has to match that of Electrons.
In /tools the python script write_beam.py can be used to write a beam file which matches the Beam created by a fixed_weight Blowout wake from the examples.
If normalized Units are used then the plasma density must be specified:
const
isconst
)