ComputationalRadiationPhysics / picongpu

Performance-Portable Particle-in-Cell Simulations for the Exascale Era :sparkles:
https://picongpu.readthedocs.io
Other
703 stars 217 forks source link

Python: Gas Profile Toolkit #1502

Open ax3l opened 8 years ago

ax3l commented 8 years ago

For initializing density (gas) profiles via pre-discretized HDF5 files, we should provide a small tool-set with primitives so one can create such profiles easily via scripts.

Example

import picongpu.density_profiles

# create container for atoms/volume in m^-3
rho = density_profiles.new()

# create general [0.:1] objects with density
s = density_profiles.sphere(r=5.e-6, c=[1.e-4, 1.e-4, 1.e-4])
g = density_profiles.gaussianSphere(r=5.e-6, sig=1e-6, c=[1.e-4, 1.e-4, 1.e-4])

# additional constructor arguments:
# - gradient list (max-"or" combined):
#      1D: line (linear, cubic, exponential, etc.),
#      2D: box-linear, sphere-linear, etc.
# - rotations

# append to container
#   example: reduce a gaussian "blob" by a central solid sphere "imprint"
rho = 1.e27 * g - 1.e26 * s

# discretize to cells
rho.discretize(dCells=[1.e-9, 1.e-9, 1.e-9], min=[0., 0., 0.])
rho.write(file="density.h5", name="e_gasProfile") # in openPMD base standard

This might be great for a picongpu-python repository with toolkits and scripts. Same should be possible for discretized laser field initialization.

ax3l commented 8 years ago

ccing @c0nsultant: this might be a quick two-day project we can hack

ax3l commented 8 years ago

ccing @Flamefire

ax3l commented 8 years ago

ccing @m-zacharias (Melanie Rödel)

PrometheusPi commented 8 years ago

great idea :+1: - for some reason I missed this issue till now

ax3l commented 8 years ago

issue collection migrated to deppp