Skip to content
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

Pulsar remove managed memory allocation #78

Draft
wants to merge 124 commits into
base: Pulsar_Development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
56487d8
adding pulsar as a compiler option
RevathiJambunathan Jan 14, 2020
d3f38b2
Adding pulsar input and reading pulsar parameters using Don's PR
RevathiJambunathan Jan 15, 2020
efefcc2
adding input file for pulsar
RevathiJambunathan Jan 15, 2020
5b82539
whitespace style fix
RevathiJambunathan Jan 15, 2020
c28bf7c
moved vis from pulsar file to tools
RevathiJambunathan Jan 15, 2020
556430f
scaling notebook to detemine inputs for pulsar
RevathiJambunathan Jan 15, 2020
8f7a505
removing unwanted file
RevathiJambunathan Jan 15, 2020
082ea43
added external E and B fields and the appropriate input parameters
RevathiJambunathan Jan 17, 2020
f7f38f9
EOL whitespace
RevathiJambunathan Jan 17, 2020
ab5f2bb
seeting up bounds for pulsar surface
RevathiJambunathan Jan 17, 2020
e7c13d6
pushing changes for comparison
RevathiJambunathan Jan 18, 2020
0057ca3
particles injected below surface, dipole magnetic field inside and ou…
RevathiJambunathan Jan 21, 2020
a2d091f
add particles based on analytical surface charge density
RevathiJambunathan Jan 22, 2020
1072fbe
using local Er and Er_cor to compute particle introduction
RevathiJambunathan Jan 23, 2020
c911e9f
fixing particle injection with local Er that includes Er_external
RevathiJambunathan Jan 23, 2020
3fe5f39
changes to pulsar
RevathiJambunathan Jan 23, 2020
3a13a42
michel and li efields inside and outside star. Particle injection rho_GJ
RevathiJambunathan Jan 23, 2020
fb94124
making changes suggested in the review
RevathiJambunathan Jan 22, 2020
9f3907a
removing EOL whitespace
RevathiJambunathan Jan 22, 2020
71263c6
cleaning
RevathiJambunathan Jan 23, 2020
4c03986
adding input parameters to toggle rho gj scaling, ninjection, maxden
RevathiJambunathan Jan 24, 2020
48d1a68
removing unwanted insidePulsarBound function
RevathiJambunathan Jan 24, 2020
4e0e106
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
7c033b3
Turn on inputs parameter to damp internal E-field for the pulsar setup.
dwillcox Jan 21, 2020
274ad57
Separate out cartesian ijk -> spherical radius into a utility functio…
dwillcox Jan 21, 2020
dcd1d8d
Rename damping function, damp in domain [0, R_star-dR_star]. Normaliz…
dwillcox Jan 22, 2020
2a52a9f
Add PulsarParm::Omega(t) function that returns omega(t) depending on …
dwillcox Jan 23, 2020
93e87c7
Add comments to distinguish different kinds of momentum injections. A…
dwillcox Jan 24, 2020
f92237e
Change form of damping function to tanh(damping_scale * (r/R_star-1))…
dwillcox Jan 24, 2020
bb6a12d
Add scale factor for damping internal E-field to the inputs file.
dwillcox Jan 24, 2020
bf9cc10
Add a python script for making plots and a gif from a set of plotfiles.
dwillcox Jan 24, 2020
64af47b
Remove PulsarEBField from PulsarParameters.cpp after a rebase mistake.
dwillcox Jan 24, 2020
0e10b5f
Default the momentum initialization to 0.
dwillcox Jan 24, 2020
e1e0fff
Swap tabs for spaces.
dwillcox Jan 24, 2020
ff96a08
Ran the style commands suggested by Travis CI to remove trailing whit…
dwillcox Jan 24, 2020
16d6993
Rename pulsar analysis scripts to make the WarpX style checker happy.
dwillcox Jan 24, 2020
aace0ea
fixing an error in rho_GJ calculation
RevathiJambunathan Jan 24, 2020
ffdfea3
Upsating GetPosition() based on recent changes in master branch
RevathiJambunathan Mar 10, 2020
0cb9603
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
bfd0e3f
Separate out cartesian ijk -> spherical radius into a utility functio…
dwillcox Jan 21, 2020
21a52de
Rename damping function, damp in domain [0, R_star-dR_star]. Normaliz…
dwillcox Jan 22, 2020
ea14d50
Add PulsarParm::Omega(t) function that returns omega(t) depending on …
dwillcox Jan 23, 2020
bdf8ee3
Change form of damping function to tanh(damping_scale * (r/R_star-1))…
dwillcox Jan 24, 2020
cd59aab
Add a python script for making plots and a gif from a set of plotfiles.
dwillcox Jan 24, 2020
b724bcb
Undo line removal.
dwillcox Mar 13, 2020
a2edc1f
Undo removal of newline.
dwillcox Mar 13, 2020
aeae465
fix compilation error
RevathiJambunathan Jun 25, 2020
2badefb
some more compilation error
RevathiJambunathan Jun 25, 2020
8c0931b
Calling External E and B for pulsar from GetExternal functions
RevathiJambunathan Jun 25, 2020
fabcd99
a few fixes in the getexternalEB and addplasma to ensure test works
RevathiJambunathan Jul 9, 2020
54ea2eb
include staggering
RevathiJambunathan Jul 9, 2020
004d898
damp b field and include staggering. fix compilation errors
RevathiJambunathan Jul 9, 2020
33bc560
fixed Ecell
RevathiJambunathan Jul 23, 2020
f978cf6
removing particles if inside R_Star
RevathiJambunathan Jul 23, 2020
0896e14
recent input file
RevathiJambunathan Jul 23, 2020
2ec3342
eol fix
RevathiJambunathan Jul 23, 2020
4d596f7
Pulsar add external eb (#39)
RevathiJambunathan Jan 27, 2021
5e42e3d
update input file to reflect diag.intervals to align with WarpX
RevathiJambunathan Jan 27, 2021
2763c27
fix typo in quering pulsar input parameter
RevathiJambunathan Jan 27, 2021
e8a70d9
arguments passed to insidePulsarBound must be rmin and rmax
RevathiJambunathan Jan 30, 2021
76be7ab
fix bug by removing semicolon
RevathiJambunathan Feb 4, 2021
a3e151c
spherical to cartesian missing phi term. benign for analytical fields
RevathiJambunathan Feb 26, 2021
eae1650
corotatingE must have Rstar
RevathiJambunathan Mar 2, 2021
9f7fe2d
add cor E and dipole B and changes for single particle test
RevathiJambunathan Apr 1, 2021
3a94115
add particle every timestep
Apr 17, 2021
92b0df5
add option to perform single particle test
RevathiJambunathan Apr 22, 2021
e3f87ea
fix bug in line that compares radius with max radius for enforcing E …
RevathiJambunathan Apr 22, 2021
bc47612
call redistribute right after particle injection
RevathiJambunathan Apr 22, 2021
d55994c
remove unusued coord type for Ext fields
RevathiJambunathan May 13, 2021
e02b486
Add conversion from cartesian to spherical coord
RevathiJambunathan May 13, 2021
d8312f2
Add Fr Ftheta Fphi EdotB and PoyntingVector diags
RevathiJambunathan May 13, 2021
0485e8e
DampBdipole between inner and outer rings
RevathiJambunathan May 14, 2021
7a920ca
different in theory and sim inside star
RevathiJambunathan May 24, 2021
cfe958a
print to file
RevathiJambunathan May 27, 2021
c5706da
add managed vector and store diags
RevathiJambunathan Jun 1, 2021
8145b6d
add new input for continuous injection
RevathiJambunathan Jun 1, 2021
5b9eb61
Merge branch 'Pulsar_DebugTheorySim' of https://github.com/RevathiJam…
RevathiJambunathan Jun 1, 2021
2e31e2d
delete aos host function not required
RevathiJambunathan Jun 1, 2021
c222726
local additions to track theory and sim results for single charge and…
RevathiJambunathan Aug 3, 2021
61cc940
ensure new diags work with dynamic load balancing, diff src and dst d…
RevathiJambunathan Aug 12, 2021
b979971
fix thetamin and max, macro
RevathiJambunathan Sep 9, 2021
81735c6
Adding pulsar input and reading pulsar parameters using Don's PR
RevathiJambunathan Jan 15, 2020
46dd4cc
added external E and B fields and the appropriate input parameters
RevathiJambunathan Jan 17, 2020
b7b1b0f
seeting up bounds for pulsar surface
RevathiJambunathan Jan 17, 2020
759d5e0
particles injected below surface, dipole magnetic field inside and ou…
RevathiJambunathan Jan 21, 2020
7e7b3e0
using local Er and Er_cor to compute particle introduction
RevathiJambunathan Jan 23, 2020
7c4721e
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
a6480d7
Damp electric fields internal to the pulsar when compiling with PULSA…
dwillcox Jan 21, 2020
14241da
Calling External E and B for pulsar from GetExternal functions
RevathiJambunathan Jun 25, 2020
559924b
a few fixes in the getexternalEB and addplasma to ensure test works
RevathiJambunathan Jul 9, 2020
d67454b
eol fix
RevathiJambunathan Jul 23, 2020
0e0c5e4
Pulsar add external eb (#39)
RevathiJambunathan Jan 27, 2021
51c91ff
add cor E and dipole B and changes for single particle test
RevathiJambunathan Apr 1, 2021
dc69d97
add particle every timestep
Apr 17, 2021
8765b77
add option to perform single particle test
RevathiJambunathan Apr 22, 2021
4a3c8dd
fix bug in line that compares radius with max radius for enforcing E …
RevathiJambunathan Apr 22, 2021
b1ecb0c
call redistribute right after particle injection
RevathiJambunathan Apr 22, 2021
1baf334
remove unusued coord type for Ext fields
RevathiJambunathan May 13, 2021
34f3e6f
Add conversion from cartesian to spherical coord
RevathiJambunathan May 13, 2021
e8ea763
Add Fr Ftheta Fphi EdotB and PoyntingVector diags
RevathiJambunathan May 13, 2021
615d9f0
DampBdipole between inner and outer rings
RevathiJambunathan May 14, 2021
ea5b1f0
fix compilation error after rebase with Pulsar_Development
RevathiJambunathan Sep 10, 2021
66ba2fd
Apply suggestions from code review
RevathiJambunathan Sep 11, 2021
47b59db
fix duplication. particles injected before PIC loop, and removed at t…
RevathiJambunathan Sep 11, 2021
7be619b
fix conflicts after merge with origin Pulsar_BCCor branch
RevathiJambunathan Sep 15, 2021
7359f46
fix conflicts
RevathiJambunathan Sep 15, 2021
962505d
commenting out functions not in use
RevathiJambunathan Sep 15, 2021
cf03ef0
using ramp_omega_time and omegastar as arguments in function call, in…
RevathiJambunathan Sep 15, 2021
d416acf
removing managed memory and adding pulsar as a class
RevathiJambunathan Oct 7, 2021
49d828f
clean up commented lines
RevathiJambunathan Oct 7, 2021
157fb76
static variables instead of get-return
RevathiJambunathan Oct 8, 2021
768cc1c
ifdef PULSAR
RevathiJambunathan Oct 8, 2021
99e5555
add turn off field gather feature
RevathiJambunathan Oct 8, 2021
5a9a06e
fix errors to compile with PULSAR=FALSE
RevathiJambunathan Oct 8, 2021
63edf7b
remove unused variable
RevathiJambunathan Oct 8, 2021
817344f
unused variable warning
RevathiJambunathan Oct 8, 2021
973ab7c
unused variable warning
RevathiJambunathan Oct 8, 2021
b20fb8d
BC user interface
RevathiJambunathan Oct 14, 2021
0d07401
add capability to inject plasma from user-defined injection time
RevathiJambunathan Oct 20, 2021
5303bdc
Merge branch 'Pulsar_RemoveManagedMemoryAllocation' of https://github…
RevathiJambunathan Oct 20, 2021
b6dc497
fix single particle injection time
RevathiJambunathan Oct 27, 2021
09a6d88
add surface integral for field reduction
RevathiJambunathan Nov 10, 2021
d5f1cac
tab from style check
RevathiJambunathan Nov 18, 2021
837210a
fix eol
RevathiJambunathan Nov 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 33 additions & 20 deletions Examples/Physics_applications/pulsar/inputs.corotating.3d.PM
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@
#################################
####### GENERAL PARAMETERS ######
#################################
max_step = 50000
max_step = 1
amr.n_cell = 128 128 128
amr.max_grid_size = 128
amr.blocking_factor = 128
amr.max_level = 0
geometry.coord_sys = 0 # 0: Cartesian
geometry.is_periodic = 0 0 0 # Is periodic?
geometry.prob_lo = 0.0 0.0 0.0
geometry.prob_lo = 0 0 0
geometry.prob_hi = 180000 180000 180000

boundary.field_lo = pml pml pml
boundary.field_hi = pml pml pml

#################################
############ NUMERICS ###########
#################################
Expand All @@ -31,28 +33,25 @@ warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.use_filter = 1
warpx.cfl = .95
warpx.do_pml = 1
my_constants.pi = 3.141592653589793
my_constants.dens = 5.544e6
my_constants.xc = 90000
my_constants.yc = 90000
my_constants.zc = 90000
my_constants.r_star = 12000
my_constants.r_star = 12032
my_constants.omega = 6245.676
my_constants.c = 299792458.
my_constants.B_star = 8.0323e-6 # magnetic field of NS (T)
my_constants.dR = 1400
my_constants.dR = 1406.25
my_constants.to = 2.e-4
interpolation.nox = 3
interpolation.noy = 3
interpolation.noz = 3
algo.particle_shape = 3


#################################
############ PLASMA #############
#################################
particles.nspecies = 2
particles.species_names = plasma_e plasma_p
#particles.nspecies = 2
#particles.species_names = plasma_e plasma_p

plasma_e.charge = -q_e
plasma_e.mass = m_e
Expand All @@ -61,7 +60,6 @@ plasma_e.profile = parse_density_function
plasma_e.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
plasma_e.num_particles_per_cell_each_dim = 4 4 4
plasma_e.momentum_distribution_type = parse_momentum_function

## Inject stationary pairs
plasma_e.momentum_function_ux(x,y,z) = "0.0"
plasma_e.momentum_function_uy(x,y,z) = "0.0"
Expand All @@ -77,7 +75,6 @@ plasma_p.profile = parse_density_function
plasma_p.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
plasma_p.num_particles_per_cell_each_dim = 4 4 4
plasma_p.momentum_distribution_type = parse_momentum_function

## Inject stationary pairs
plasma_p.momentum_function_ux(x,y,z) = "0.0"
plasma_p.momentum_function_uy(x,y,z) = "0.0"
Expand All @@ -88,8 +85,8 @@ plasma_p.density_min = 1E0

diagnostics.diags_names = plt chk
plt.diag_type = Full
plt.intervals = 20
plt.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE
plt.intervals = 1
plt.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE Er Etheta Ephi Br Btheta Bphi EdotB Sx Sy Sz

chk.format = checkpoint
chk.diag_type = Full
Expand All @@ -106,11 +103,11 @@ pulsar.ramp_omega_time = 0.0 # time over which to ramp up NS angular
pulsar.center_star = 90000 90000 90000
pulsar.R_star = 12032 # radius of NS (m)
pulsar.B_star = 8.0323e-6 # magnetic field of NS (T)
pulsar.dR = 1400 # thickness on the surface of the pulsar
pulsar.dR = 1406.25 # thickness on the surface of the pulsar
# consistency requires dR = my_constants.dR
pulsar.verbose = 0 # [0/1]: turn on verbosity for debugging print statements
pulsar.EB_external = 1 # [0/1]: to apply external E and B
pulsar.E_external_monopole = 0 # [0/1]
pulsar.EB_external = 0 # [0/1]: to apply external E and B
pulsar.E_external_monopole = 1 # [0/1]
pulsar.EB_corotating_maxradius = 12032 # The radius where E-field changes from corotating
# inside the star to quadrapole outside.
# Default is R_star. (r<=cor_radius) i.e. the includes
Expand All @@ -126,7 +123,7 @@ pulsar.max_particle_absorption_radius = 12032 # Maximum radius within which pa
# deleted every timestep.
# Default is Rstar
pulsar.rhoGJ_scale = 1e0 # scaling down of rho_GJ
pulsar.damp_EB_internal = 1 # Damp internal electric field
pulsar.damp_EB_internal = 0 # Damp internal electric field
pulsar.damp_EB_radius = 12032 # The radius within which EB should be damped.
# default is r_star (damping will include this radius)
pulsar.damping_scale = 1000.0 # Damping scale factor for internal electric field
Expand All @@ -137,4 +134,20 @@ pulsar.max_nodepos_radius = 0. # radius within which particle deposition
pulsar.turnoff_plasmaEB_gather = 0 # (0/1) 0 is default. always gather
# 1 for no gather of self-consistent fields
pulsar.max_nogather_radius = 0. # radius within which self-consistent field gather
# is turned off
pulsar.init_dipoleBfield = 1 # default is 1
pulsar.init_corotatingEfield = 1 # default
pulsar.corotatingE_maxradius = 16250.75 # default is Rstar
pulsar.enforceDipoleB_maxradius = 12032 # default is Rstar
pulsar.enforceCorotatingE = 1 # default 1
pulsar.enforceDipoleB = 1 # default 1
pulsar.singleParticleTest = 0 # default 0, if 1, then a particle pair will be introduced.
# Single particle position/momentum will need to be specified
pulsar.DampBDipoleInRing = 0
pulsar.Bdamping_scale = 10000
pulsar.LimitDipoleBInit = 0 # if 1 then Bdipole is iniialization only in a smaller region
pulsar.DipoleB_init_maxradius = 12032 # read if LimitBdipole is 1
pulsar.use_theoreticalEB = 0
pulsar.theory_max_rstar = 100000
pulsar.EnforceTheoreticalEBInGrid = 1
pulsar.AddExternalMonopoleOnly = 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Description:
#
# This inputs file sets up a NS with these properties:
# - E = -(omega*R)[cross]B inside the NS
# - external E and B outside the star
#
# See the "Pulsar Setup" section at the end for the options
#
# This initializes the electrons and positrons with a corotating momentum function.
# Based on the pulsar_type = "active" or "dead", particles are injected continuously or
# until rho_GJ is reached

#################################
####### GENERAL PARAMETERS ######
#################################
max_step = 20000
amr.n_cell = 256 256 256
amr.max_grid_size = 128
amr.blocking_factor = 128
amr.max_level = 0
geometry.coord_sys = 0 # 0: Cartesian
geometry.is_periodic = 0 0 0 # Is periodic?
geometry.prob_lo = 0.0 0.0 0.0
geometry.prob_hi = 180000 180000 180000

#################################
############ NUMERICS ###########
#################################
#algo.maxwell_fdtd_solver = yee
warpx.verbose = 1
warpx.do_dive_cleaning = 0
warpx.use_filter = 1
warpx.cfl = .95
warpx.do_pml = 1
my_constants.pi = 3.141592653589793
my_constants.dens = 5.544e6
my_constants.xc = 90000
my_constants.yc = 90000
my_constants.zc = 90000
my_constants.r_star = 12000
my_constants.omega = 6245.676
my_constants.c = 299792458.
my_constants.B_star = 8.0323e-6 # magnetic field of NS (T)
my_constants.dR = 1400
my_constants.to = 2.e-4
interpolation.nox = 3
interpolation.noy = 3
interpolation.noz = 3


#################################
############ PLASMA #############
#################################
particles.nspecies = 2
particles.species_names = plasma_e plasma_p

plasma_e.charge = -q_e
plasma_e.mass = m_e
plasma_e.injection_style = "singleparticle"
plasma_e.single_particle_pos = 90000. 103000. 90000.
plasma_e.single_particle_vel = 0. 0. 0.
plasma_e.single_particle_weight = 1.
#plasma_e.profile = parse_density_function
#plasma_e.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
#plasma_e.num_particles_per_cell_each_dim = 4 4 4
#plasma_e.momentum_distribution_type = parse_momentum_function
#
### Inject stationary pairs
#plasma_e.momentum_function_ux(x,y,z) = "0.0"
#plasma_e.momentum_function_uy(x,y,z) = "0.0"
### uz is always 0 for the injection methods above
#plasma_e.momentum_function_uz(x,y,z) = "0.0"
#plasma_e.do_continuous_injection = 0
#plasma_e.density_min = 1E0

plasma_p.charge = q_e
plasma_p.mass = m_e
plasma_p.injection_style = "singleparticle"
plasma_p.single_particle_pos = 90000. 103000. 90000.
plasma_p.single_particle_vel = 0. 0. 0.
plasma_p.single_particle_weight = 1.
#plasma_p.profile = parse_density_function
#plasma_p.density_function(x,y,z) = "( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=(r_star)) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens"
#plasma_p.num_particles_per_cell_each_dim = 4 4 4
#plasma_p.momentum_distribution_type = parse_momentum_function
#
### Inject stationary pairs
#plasma_p.momentum_function_ux(x,y,z) = "0.0"
#plasma_p.momentum_function_uy(x,y,z) = "0.0"
### uz is always 0 for the injection methods above
#plasma_p.momentum_function_uz(x,y,z) = "0.0"
#plasma_p.do_continuous_injection = 0
#plasma_p.density_min = 1E0

diagnostics.diags_names = plt chk
plt.diag_type = Full
plt.intervals = 50
plt.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz part_per_cell rho divE rho_plasma_e rho_plasma_p

chk.format = checkpoint
chk.diag_type = Full
chk.intervals = 1000

#################################
######### PULSAR SETUP ##########
#################################
pulsar.pulsarType = "dead" # [dead/active]: sets particle injection type
pulsar.omega_star = 6245.676 # angular velocity of NS (rad/s)
pulsar.ramp_omega_time = 0.0 # time over which to ramp up NS angular velocity (s)
# if ramp_omega_time < 0, omega = omega_star for any t
# consistency requires ramp_omega_time = my_constants.to
pulsar.center_star = 90000 90000 90000
pulsar.R_star = 12032 # radius of NS (m)
pulsar.B_star = 8.0323e-6 # magnetic field of NS (T)
pulsar.dR = 1400 # thickness on the surface of the pulsar
# consistency requires dR = my_constants.dR
pulsar.verbose = 0 # [0/1]: turn on verbosity for debugging print statements
pulsar.EB_external = 0 # [0/1]: to apply external E and B
pulsar.E_external_monopole = 0 # [0/1]
pulsar.EB_corotating_maxradius = 12032 # The radius where E-field changes from corotating
# inside the star to quadrapole outside.
# Default is R_star. (r<=cor_radius) i.e. the includes
# the r specified in the input
pulsar.max_ndens = 5.54e6 # max ndens == ndens used in initializing density
pulsar.Ninj_fraction = 0.2 # fraction of sigma injected
pulsar.ModifyParticleWeight = 1 # (0/1) the fractional injection is achieved
# by modifying particle weight if 1
# by modifying num_ppc if 0
pulsar.particle_inj_rmin = 10632 # default is Rstar-dR (consistent with density function above)
pulsar.particle_inj_rmax = 12032 # default is Rstar (consistent with density function)
pulsar.max_particle_absorption_radius = 12032 # Maximum radius within which particles are
# deleted every timestep.
# Default is Rstar
pulsar.rhoGJ_scale = 1e0 # scaling down of rho_GJ
pulsar.damp_EB_internal = 0 # Damp internal electric field
pulsar.damp_EB_radius = 12032 # The radius within which EB should be damped.
# default is r_star (damping will include this radius)
pulsar.damping_scale = 1000.0 # Damping scale factor for internal electric field
pulsar.turnoffdeposition = 0 # (0/1) 0 for depositing (default)
# 1 for no deposition
pulsar.max_nodepos_radius = 0. # radius within which particle deposition for j/rho
# is turned off. (r<=max_radius)
pulsar.turnoff_plasmaEB_gather = 0 # (0/1) 0 is default. always gather
# 1 for no gather of self-consistent fields
pulsar.max_nogather_radius = 0. # radius within which self-consistent field gather
pulsar.init_dipoleBfield = 1 # default is 1
pulsar.init_corotatingEfield = 1 # default
pulsar.corotatingE_maxradius = 12032 # default is Rstar
pulsar.enforceDipoleB_maxradius = 12032 # default is Rstar
pulsar.enforceCorotatingE = 1 # default 1
pulsar.enforceDipoleB = 1 # default 1
3 changes: 3 additions & 0 deletions Source/Diagnostics/ComputeDiagFunctors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ target_sources(WarpX
PartPerCellFunctor.cpp
PartPerGridFunctor.cpp
BackTransformFunctor.cpp
SphericalComponentFunctor.cpp
EdotBFunctor.cpp
PoyntingVectorFunctor.cpp
)
31 changes: 31 additions & 0 deletions Source/Diagnostics/ComputeDiagFunctors/EdotBFunctor.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef WARPX_EDOTBFUNCTOR_H_
#define WARPX_EDOTBFUNCTOR_H_

#include "ComputeDiagFunctor.H"

class
EdotBFunctor final : public ComputeDiagFunctor
{
public:
EdotBFunctor ( const amrex::MultiFab * const Ex_src,
const amrex::MultiFab * const Ey_src,
const amrex::MultiFab * const EZ_src,
const amrex::MultiFab * const Bx_src,
const amrex::MultiFab * const By_src,
const amrex::MultiFab * const Bz_src,
const int lev,
const amrex::IntVect crse_ratio,
int ncomp = 1);
virtual void operator() (amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer=0*/) const override;
void ComputeEdotB(amrex::MultiFab& mf_dst, int dcomp) const;
private:
amrex::MultiFab const * const m_Ex_src = nullptr;
amrex::MultiFab const * const m_Ey_src = nullptr;
amrex::MultiFab const * const m_Ez_src = nullptr;
amrex::MultiFab const * const m_Bx_src = nullptr;
amrex::MultiFab const * const m_By_src = nullptr;
amrex::MultiFab const * const m_Bz_src = nullptr;
int m_lev;
};

#endif
Loading