-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conflicts from merging with develop
- Loading branch information
Showing
18 changed files
with
1,087 additions
and
446 deletions.
There are no files selected for viewing
113 changes: 113 additions & 0 deletions
113
benchmarks/tst3d_14_electron_sphere_field_initialization.py
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,113 @@ | ||
###### Namelist for the field initialization of an electron sphere in AM geometry | ||
|
||
import math | ||
|
||
|
||
dx = 1. | ||
dtrans = 1. | ||
dt = 0.8*dx | ||
nx = 128 | ||
ntrans = 128 | ||
Lx = nx * dx | ||
Ltrans = ntrans*dtrans | ||
npatch_x = 8 | ||
npatch_trans = 8 | ||
|
||
# Sphere density | ||
n0 = 1. | ||
|
||
# Sphere position and Radius | ||
R_sphere = 20. | ||
center_sphere = nx*dx/2. | ||
|
||
|
||
# normalized density of a sphere with uniform density | ||
def nsphere_(x,y,z): | ||
r_sq = (y-Ltrans/2.)**2+(z-Ltrans/2.)**2 | ||
if ( (x-center_sphere)**2+r_sq < R_sphere**2 ): | ||
return n0 | ||
else: | ||
return 0. | ||
|
||
Main( | ||
geometry = "3Dcartesian", | ||
|
||
interpolation_order = 2, | ||
|
||
timestep = dt, | ||
simulation_time = 1.*dt, | ||
|
||
cell_length = [dx, dtrans, dtrans], | ||
grid_length = [ Lx, Ltrans, Ltrans], | ||
|
||
|
||
number_of_patches = [npatch_x,npatch_trans,npatch_trans ], | ||
|
||
clrw = nx/npatch_x, | ||
|
||
EM_boundary_conditions = [ | ||
["silver-muller","silver-muller"], | ||
["silver-muller","silver-muller"], | ||
["silver-muller","silver-muller"], | ||
], | ||
|
||
solve_poisson = True, | ||
poisson_max_iteration = 50000, | ||
print_every = 100, | ||
|
||
random_seed = smilei_mpi_rank | ||
) | ||
|
||
|
||
|
||
Species( | ||
name = "electronSphere", | ||
position_initialization = "regular", | ||
momentum_initialization = "cold", | ||
particles_per_cell = 8, | ||
c_part_max = 1.0, | ||
mass = 1.0, | ||
charge = -1.0, | ||
charge_density = nsphere_, | ||
mean_velocity = [0.0, 0.0, 0.0], | ||
pusher = "boris", | ||
time_frozen = 0.0, | ||
boundary_conditions = [ | ||
["remove", "remove"], | ||
["remove", "remove"], | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
|
||
|
||
list_fields = ['Ex','Ey','Ez','Rho'] | ||
|
||
|
||
DiagFields( | ||
every = 20, | ||
fields = list_fields | ||
) | ||
|
||
DiagProbe( | ||
every = 10, | ||
origin = [0., Main.grid_length[1]/2., Main.grid_length[2]/2.], | ||
corners = [ | ||
[Main.grid_length[0], Main.grid_length[1]/2., Main.grid_length[2]/2.] | ||
], | ||
number = [nx], | ||
fields = list_fields | ||
) | ||
|
||
DiagProbe( | ||
every = 10, | ||
origin = [0., 0., Main.grid_length[2]/2.], | ||
corners = [ | ||
[Main.grid_length[0], 0., Main.grid_length[2]/2.], | ||
[0., Main.grid_length[1], Main.grid_length[2]/2.], | ||
], | ||
number = [nx, ntrans], | ||
fields = list_fields | ||
) | ||
|
||
|
96 changes: 96 additions & 0 deletions
96
benchmarks/tstAM_13_electron_sphere_field_initialization.py
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,96 @@ | ||
###### Namelist for the field initialization of an electron sphere in AM geometry | ||
|
||
import math | ||
|
||
|
||
dx = 1. | ||
dtrans = 1. | ||
dt = 0.8*dx | ||
nx = 128 | ||
ntrans = 64 | ||
Lx = nx * dx | ||
Ltrans = ntrans*dtrans | ||
npatch_x = 8 | ||
npatch_r = 8 | ||
|
||
# Sphere density | ||
n0 = 1. | ||
|
||
# Sphere position and Radius | ||
R_sphere = 20. | ||
center_sphere = nx*dx/2. | ||
|
||
|
||
# normalized density of a sphere with uniform density | ||
def nsphere_(x,r): | ||
if ( (x-center_sphere)**2+r**2 < R_sphere**2 ): | ||
return n0 | ||
else: | ||
return 0. | ||
|
||
Main( | ||
geometry = "AMcylindrical", | ||
|
||
interpolation_order = 2, | ||
|
||
timestep = dt, | ||
simulation_time = 1.*dt, | ||
|
||
cell_length = [dx, dtrans], | ||
grid_length = [ Lx, Ltrans], | ||
|
||
number_of_AM = 1, | ||
|
||
number_of_patches = [npatch_x,npatch_r ], | ||
|
||
clrw = nx/npatch_x, | ||
|
||
EM_boundary_conditions = [ | ||
["silver-muller","silver-muller"], | ||
["buneman","buneman"], | ||
], | ||
|
||
solve_poisson = True, | ||
poisson_max_iteration = 50000, | ||
print_every = 100, | ||
|
||
random_seed = smilei_mpi_rank | ||
) | ||
|
||
|
||
|
||
Species( | ||
name = "electronSphere", | ||
position_initialization = "regular", | ||
momentum_initialization = "cold", | ||
particles_per_cell = 20, | ||
c_part_max = 1.0, | ||
mass = 1.0, | ||
charge = -1.0, | ||
charge_density = nsphere_, | ||
mean_velocity = [0.0, 0.0, 0.0], | ||
pusher = "boris", | ||
time_frozen = 0.0, | ||
boundary_conditions = [ | ||
["remove", "remove"], | ||
["reflective", "remove"], | ||
], | ||
) | ||
|
||
|
||
|
||
list_fields = ['Ex','Ey','Ez','Bx','By','Bz','Rho','Jx','Jy'] | ||
|
||
DiagFields( | ||
every = 200, | ||
# fields = list_fields | ||
) | ||
|
||
|
||
DiagProbe( | ||
every = 200, | ||
origin = [0., -ntrans*dtrans,0.], | ||
corners = [ [nx*dx,-ntrans*dtrans,0.], [0,ntrans*dtrans,0.] ], | ||
number = [nx, 2*ntrans] | ||
) | ||
|
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.