Hi-PACE / hipace

Highly efficient Plasma Accelerator Emulation, quasistatic particle-in-cell code
https://hipace.readthedocs.io
Other
51 stars 14 forks source link

Use makeParser from amrex::ParmParse #1143

Closed AlexanderSinn closed 1 week ago

AlexanderSinn commented 1 month ago

This PR replaces initParser with amrex::ParmParse::makeParser. The main difference is that the amrex version allows referencing different input parameters in addition to my_constants.

hipace.normalized_units = 1
electron.charge = if(hipace.normalized_units, 1, -q_e)

Additionally, IParser is now used for bool, int and Long like in amrex instead of the double Parser.

This PR however keeps the parsing function for vector/array types as they are stricter than the amrex versions (e.g. if 3 parameters are required the amrex ones would not give an error if 4+ are provided).

MaxThevenet commented 1 week ago

Thanks for this PR! Could you give an example for this statement (just in the PR description)?

The main difference is that the amrex version allows referencing different input parameters in addition to my_constants.