forked from ECP-WarpX/WarpX
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
memaster
with latest upstream/development (#169)
* Moving Frame Field Probe Functionality (ECP-WarpX#2996) * DRAFT for Moving Frame * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Adds m_last_compute_step * Generalized SetParticlePosition, semicolons and formatting * Update Source/Diagnostics/ReducedDiags/FieldProbe.H Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Moved particle push before calculations. Condensed stuff. * Fixed Velocity, added start and stop time functionality * Documentation * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Empty-Commit * Fixed ParallelFor from review * FP moving window in laser_acceleration 1d, 2d, 3d test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Line detector instead of point Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Refactoring: More General Interfaces (ECP-WarpX#2991) * Refactoring: More General Interfaces (J, rho) * Refactoring: More General Interfaces (E, B) * Refactoring: More General Interfaces (rho) * Fix const Correctness * Fix const Correctness (continued) * Fix Bugs * Refactoring: More General Interfaces (averaged E, averaged B) * LoadBalanceCosts: num_cells & num_macro_particles (ECP-WarpX#3019) * Examples: LBC in Laser-Ion Example * LoadBalanceCosts: num_cells & num_macro_particles * Fix Script: Wrong Header Counting Spliced out the first to columns twice. * Fix Script: Blocking Factor The script did not work if a direction only had one block * Fix Script: 2D/3D There is no generic way from the data we write to find this out, without breaking corner cases such as one-block in one direction. * LoadBalanceCosts: Fix Unused Vars in Script Leftover to ECP-WarpX#3019 * Semicoarsening in electrostatic solvers (ECP-WarpX#3024) * Semicoarsening in electrostatic solvers Enable semicoarsening in electrostatic solvers if the problem is anisotropic due to relativistic beam and/or anisotropic cell spacing. * Update relativistic_space_charge_initialization benchmark * AMReX: Update to latest commit (ECP-WarpX#3021) * Added PlasmaLens class to PICMI (ECP-WarpX#3025) * Added PlasmaLens class to PICMI * Added CI test * Added PICMI input file * Fixed the output dir for the CI test * Add `_plt` to Output File Prefix Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Minor fixes removing warnings from MSVC C++ (ECP-WarpX#3022) * Fix MPI Signal Handling on Perlmutter (ECP-WarpX#3029) * Fix: `MPI_CXX_BOOL` -> `MPI_BYTE` C99 types were aded in MPI-2.2, while Cray's MPICH fork in version 8.1.13 defines `MPI_CXX_BOOL` to `MPI_DATATYPE_NULL` on Perlmutter. We could use `MPI_C_BOOL`, which is technically a `_Bool` from [<cstdbool>](https://en.cppreference.com/w/cpp/header/cstdbool) (deprecated: C++17; removed: C++20) - or we simply do a static assert on `sizeof(bool)` and communicate as a `MPI_BYTE` or `MPI_CHAR`. * Signals: Do no MPI Comms if none is configured * Docs: Link and Explain Allowed Signal Values * Review Comments & Style * Extend `do_pml_Lo/Hi` to MR Levels (ECP-WarpX#2890) * Vay Deposition: Fix SyncCurrent, FFTs (ECP-WarpX#3012) * Implemented the BCK fallback for the ECT solver (ECP-WarpX#3016) * Implemented the BCK fallback for the ECT solver * Ignored an unused variable * Bug fix * Fix issue with preprocessor directive * Added comments * Implemented suggestions from code review * Fixed tilebox * Improved warning * Using WarpX::RecordWarning instead of amrex::Print() * Ignoring RZ * Improving comment * Bug Fix * Lowered warning priority * Ignoring low priority warnings in ECT tests Co-authored-by: lgiacome <lorenzo.giacome@cern.ch> * No longer use a while loop in driving the simulation (#167) * add persistent flag for whether a terminate signal was received that can be read by python * handle checkpointing through sim_control * change terminateFlag from type int to bool * fix unintended changes to changelog * specify terminateFlag return type * code cleanup * revert upstream changes * remove use of while loop to run simulation * changes requested during PR review Co-authored-by: Tiberius Rheaume <35204125+TiberiusRheaume@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov> Co-authored-by: David Grote <grote1@llnl.gov> Co-authored-by: Lorenzo Giacomel <47607756+lgiacome@users.noreply.github.com> Co-authored-by: lgiacome <lorenzo.giacome@cern.ch>
- Loading branch information
Showing
60 changed files
with
1,107 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pywarpx import picmi | ||
|
||
# Physical constants | ||
c = picmi.constants.c | ||
q_e = picmi.constants.q_e | ||
|
||
# Number of time steps | ||
max_steps = 84 | ||
|
||
# Number of cells | ||
nx = 16 | ||
ny = 16 | ||
nz = 16 | ||
|
||
# Physical domain | ||
xmin = -1. | ||
xmax = 1. | ||
ymin = -1. | ||
ymax = 1. | ||
zmin = 0. | ||
zmax = 2. | ||
|
||
# Create grid | ||
grid = picmi.Cartesian3DGrid(number_of_cells = [nx, ny, nz], | ||
lower_bound = [xmin, ymin, zmin], | ||
upper_bound = [xmax, ymax, zmax], | ||
lower_boundary_conditions = ['dirichlet', 'dirichlet', 'dirichlet'], | ||
upper_boundary_conditions = ['dirichlet', 'dirichlet', 'dirichlet'], | ||
lower_boundary_conditions_particles = ['absorbing', 'absorbing', 'absorbing'], | ||
upper_boundary_conditions_particles = ['absorbing', 'absorbing', 'absorbing']) | ||
|
||
# Particles | ||
vel_z = 0.5*c | ||
multiparticles_distribution = picmi.ParticleListDistribution(x = [0.05, 0.], | ||
y = [0., 0.04], | ||
z = [0.05, 0.05], | ||
ux = [0., 0.], | ||
uy = [0., 0.], | ||
uz = [vel_z, vel_z], | ||
weight = [1., 1.]) | ||
|
||
electrons = picmi.Species(particle_type = 'electron', | ||
name = 'electrons', | ||
initial_distribution = multiparticles_distribution) | ||
|
||
# Plasma lenses | ||
plasma_lenses = picmi.PlasmaLens(period = 0.5, | ||
starts = [0.1, 0.11, 0.12, 0.13], | ||
lengths = [0.1, 0.11, 0.12, 0.13], | ||
strengths_E = [600000., 800000., 600000., 200000.], | ||
strengths_B = [0.0, 0.0, 0.0, 0.0]) | ||
|
||
# Electromagnetic solver | ||
solver = picmi.ElectromagneticSolver(grid = grid, | ||
method = 'Yee', | ||
cfl = 0.7) | ||
|
||
# Diagnostics | ||
part_diag1 = picmi.ParticleDiagnostic(name = 'diag1', | ||
period = max_steps, | ||
species = [electrons], | ||
data_list = ['ux', 'uy', 'uz'], | ||
write_dir = '.', | ||
warpx_file_prefix = 'Python_plasma_lens_plt') | ||
|
||
# Set up simulation | ||
sim = picmi.Simulation(solver = solver, | ||
max_steps = max_steps, | ||
verbose = 1, | ||
particle_shape = 'linear', | ||
warpx_serialize_initial_conditions = 1, | ||
warpx_do_dynamic_scheduling = 0) | ||
|
||
# Add plasma electrons | ||
sim.add_species(electrons, layout = None) | ||
|
||
# Add the plasma lenses | ||
sim.add_applied_field(plasma_lenses) | ||
|
||
# Add diagnostics | ||
sim.add_diagnostic(part_diag1) | ||
|
||
# Write input file that can be used to run with the compiled version | ||
#sim.write_input_file(file_name = 'inputs_3d_picmi') | ||
|
||
# Advance simulation until last time step | ||
sim.step(max_steps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.