-
Notifications
You must be signed in to change notification settings - Fork 223
Add example of basic python input file #6149
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
base: development
Are you sure you want to change the base?
Conversation
particles.species_names = ("electrons",) | ||
|
||
electrons = Particles.newspecies("electrons") | ||
electrons.charge = -q_e |
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.
This will be slightly different behavior since the -q_e will be evaluated in the input file rather than in the C++ parameter parsing. This could also be
electrons.charge = "-q_e"
which would be evaluated in C++.
amr.max_level = 0 | ||
|
||
# Geometry | ||
geometry.dims = "3" |
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.
Because of the way this parameter is parsed, this must be a string.
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.
We could generalize libwarpx
to assume Cartesian, if an integer is passed. We already do this assumption/convention in the ParmParse:
geometry.dims = 1 # Cartesian
geometry.dims = 2 # Cartesian
geometry.dims = 3 # Cartesian
geometry.dims = RCYLINDER
geometry.dims = RSPHERE
geometry.dims = RZ
Discussed today in the developer meeting: We like both and will merge both this and #6149 for now, follow-up ideas are:
With those updates, the logic here will be a little less rough (e.g., see |
This PR adds an example using the lower level Python interface for WarpX. Here, the input parameters are set directly instead of by using the PICMI interface. This uses a fairly straightforward example to demonstrate the basic method. More advanced capabilities can be setup this way as well, for instance adding call backs to Python routines.
Related to #6149 and #5283