Skip to content

Commit 427cb3c

Browse files
committed
Merge branch 'dev' into update_perftests
2 parents b7eee37 + 7807bed commit 427cb3c

File tree

23 files changed

+1301
-126
lines changed

23 files changed

+1301
-126
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ o/
77
tmp_build_dir/
88
AMReX_buildInfo.cpp
99
Backtrace.*
10+
*.vth
11+
*.sw[opqrs]
12+
*.png

Docs/source/latex_theory/Boosted_frame/Boosted_frame.tex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ \subsection{Numerical Stability and alternate formulation in a Galilean frame}
142142
For instance, NCI-specific corrections include periodically smoothing
143143
the electromagnetic field components \cite{Martinscpc10},
144144
using a special time step \cite{VayAAC2010,Vayjcp2011} or
145-
applying a wide-band smoothing of the current components \cite{
146-
VayAAC2010,Vayjcp2011,VayPOPL2011}. Another set of mitigation methods
145+
applying a wide-band smoothing of the current components \cite{VayAAC2010,Vayjcp2011,VayPOPL2011}. Another set of mitigation methods
147146
involve scaling the deposited
148147
currents by a carefully-designed wavenumber-dependent factor
149148
\cite{GodfreyJCP2014_FDTD,GodfreyIEEE2014} or slightly modifying the

Docs/source/running_cpp/parameters.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,20 @@ Laser initialization
339339
``laser.profile_focal_distance`` in the laboratory frame, and use ``warpx.gamma_boost``
340340
to automatically perform the conversion to the boosted frame.
341341

342+
* ``laser.stc_direction`` (`3 floats`) optional (default `1. 0. 0.`)
343+
Direction of laser spatio-temporal couplings.
344+
See definition in Akturk et al., Opt Express, vol 12, no 19 (2014).
345+
342346
* ``laser.zeta`` (`float`; in meters.seconds) optional (default `0.`)
343-
Spatial chirp at focus in the ``x`` direction. See definition in
347+
Spatial chirp at focus in direction ``laser.stc_direction``. See definition in
344348
Akturk et al., Opt Express, vol 12, no 19 (2014).
345349

346350
* ``laser.beta`` (`float`; in seconds) optional (default `0.`)
347-
Angular dispersion (or angular chirp) at focus in the ``x`` direction.
351+
Angular dispersion (or angular chirp) at focus in direction ``laser.stc_direction``.
348352
See definition in Akturk et al., Opt Express, vol 12, no 19 (2014).
349353

350354
* ``laser.phi2`` (`float`; in seconds**2) optional (default `0.`)
351-
Temporal chirp at focus in the ``x`` direction.
355+
Temporal chirp at focus.
352356
See definition in Akturk et al., Opt Express, vol 12, no 19 (2014).
353357

354358
Numerics and algorithms
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
In situ Visualization with SENSEI
2+
=================================
3+
SENSEI is a light weight framework for in situ data analysis. SENSEI's data
4+
model and API provide uniform access to and run time selection of a diverse set
5+
of visualization and analysis back ends including VisIt Libsim, ParaView
6+
Catalyst, VTK-m, Ascent, ADIOS, Yt, and Python.
7+
8+
SENSEI uses an XML file to select and configure one or more back ends at run
9+
time. Run time selection of the back end via XML means one user can access
10+
Catalyst, another Libsim, yet another Python with no changes to the code.
11+
12+
Compiling with GNU Make
13+
-----------------------
14+
For codes making use of AMReX's build system add the following variable to the
15+
code's main :code:`GNUmakefile`.
16+
17+
.. code-block:: bash
18+
19+
USE_SENSEI_INSITU = TRUE
20+
21+
When set, AMReX's make files will query environment variables for the lists of
22+
compiler and linker flags, include directories, and link libraries. These lists
23+
can be quite elaborate when using more sophisticated back ends, and are best
24+
set automatically using the :code:`sensei_config` command line tool that should
25+
be installed with SENSEI. Prior to invoking make use the following command to
26+
set these variables:
27+
28+
.. code-block:: bash
29+
30+
source sensei_config
31+
32+
Typically, the :code:`sensei_config` tool is in the users PATH after loading
33+
the desired SENSEI module. After configuring the build environment with
34+
:code:`sensei_config`, proceed as usual.
35+
36+
.. code-block:: bash
37+
38+
make -j4 -f GNUmakefile
39+
40+
ParmParse Configuration
41+
-----------------------
42+
Once an AMReX code has been compiled with SENSEI features enabled, it will need
43+
to be enabled and configured at runtime. This is done using ParmParse input file.
44+
The following 3 ParmParse parameters are used:
45+
46+
.. code-block:: python
47+
48+
insitu.int = 2
49+
insitu.start = 0
50+
insitu.config = render_iso_catalyst_2d.xml
51+
52+
:code:`insitu.int` turns in situ processing on or off and controls how often
53+
data is processed. :code:`insitu.start` controls when in situ processing
54+
starts. :code:`insitu.config` points to the SENSEI XML file which selects and
55+
configures the desired back end.
56+
57+
Obtaining SENSEI
58+
-----------------
59+
SENSEI is hosted on Kitware's Gitlab site at https://gitlab.kitware.com/sensei/sensei
60+
It's best to checkout the latest release rather than working on the master branch.
61+
62+
To ease the burden of wrangling back end installs SENSEI provides two platforms
63+
with all dependencies pre-installed, a VirtualBox VM, and a NERSC Cori
64+
deployment. New users are encouraged to experiment with one of these.
65+
66+
67+
SENSEI VM
68+
~~~~~~~~~
69+
The SENSEI VM comes with all of SENSEI's dependencies and the major back ends
70+
such as VisIt and ParaView installed. The VM is the easiest way to test things
71+
out. It also can be used to see how installs were done and the environment
72+
configured.
73+
74+
NERSC Cori
75+
~~~~~~~~~~
76+
SENSEI is deployed at NERSC on Cori. The NERSC deployment includes the major
77+
back ends such as ParaView Catalyst, VisIt Libsim, and Python.

Docs/source/visualization/visualization.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Visualizing the simulation results
77
yt
88
visit
99
picviewer
10+
sensei
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# stop_time = 1.12966840205e-10
2+
amrex.v=1
3+
max_step = 2500
4+
amr.n_cell = 64 256
5+
6+
amr.max_grid_size = 4096
7+
amr.blocking_factor = 16
8+
9+
# Maximum level in hierarchy (for now must be 0, i.e., one level in total)
10+
amr.max_level = 1
11+
amr.plot_file = "plotfiles/plt"
12+
amr.plot_int = 200
13+
14+
warpx.fine_tag_lo = -2.e-6 -15.e-6
15+
warpx.fine_tag_hi = 2.e-6 -7.e-6
16+
17+
18+
# Geometry
19+
geometry.coord_sys = 0 # 0: Cartesian
20+
geometry.is_periodic = 0 0 # Is periodic?
21+
geometry.prob_lo = -30.e-6 -20.e-6 # physical domain
22+
geometry.prob_hi = 30.e-6 0.e-6
23+
24+
# Verbosity
25+
warpx.verbose = 1
26+
warpx.plot_raw_fields = 1
27+
warpx.do_dive_cleaning = 0
28+
warpx.use_filter = 1
29+
warpx.do_pml = 1
30+
warpx.do_subcycling = 0
31+
warpx.refine_plasma = 0
32+
warpx.plot_raw_fields = 1
33+
warpx.plot_raw_fields_guards = 1
34+
warpx.plot_finepatch = 1
35+
warpx.plot_crsepatch = 1
36+
warpx.n_current_deposition_buffer = 0
37+
warpx.n_field_gather_buffer = 0
38+
39+
# Algorithms
40+
algo.current_deposition = 0
41+
algo.charge_deposition = 0
42+
algo.field_gathering = 0
43+
algo.particle_pusher = 0
44+
algo.maxwell_fdtd_solver = "ckc"
45+
46+
# CFL
47+
warpx.cfl = .9999
48+
particles.nspecies = 4
49+
particles.species_names = driver beam plasma_e plasma_p
50+
51+
# interpolation
52+
interpolation.nox = 3
53+
interpolation.noy = 3
54+
interpolation.noz = 3
55+
56+
#
57+
# The driver species information
58+
#
59+
60+
driver.charge = -q_e
61+
driver.mass = m_e
62+
driver.injection_style = "gaussian_beam"
63+
driver.x_rms = 3.e-6
64+
driver.y_rms = 3.e-6
65+
driver.z_rms = .2e-6
66+
driver.x_m = 0.
67+
driver.y_m = 0.
68+
driver.z_m = -3.e-6
69+
driver.npart = 10000
70+
driver.q_tot = -1.e-10
71+
driver.profile = "constant"
72+
driver.density = 5.e24 # number of particles per m^3
73+
driver.momentum_distribution_type = "gaussian"
74+
driver.ux_m = 0.0
75+
driver.uy_m = 0.0
76+
driver.uz_m = 1e6
77+
driver.uz_th = 0.
78+
#driver.ux_th = 2.
79+
#driver.uy_th = 2.
80+
#driver.uz_th = 20000.
81+
driver.zinject_plane = 0.
82+
driver.rigid_advance = true
83+
driver.projected = true
84+
driver.focused = false
85+
86+
#
87+
# The beam species information
88+
#
89+
90+
beam.charge = -q_e
91+
beam.mass = m_e
92+
beam.injection_style = "gaussian_beam"
93+
beam.x_rms = .1e-6
94+
beam.y_rms = .1e-6
95+
beam.z_rms = .2e-6
96+
beam.x_m = 0.
97+
beam.y_m = 0.
98+
beam.z_m = -11.e-6
99+
beam.npart = 10000
100+
beam.q_tot = -1.e-12
101+
beam.profile = "constant"
102+
beam.density = 1.e24
103+
beam.momentum_distribution_type = "gaussian"
104+
beam.ux_m = 0.0
105+
beam.uy_m = 0.0
106+
beam.uz_m = 20.
107+
beam.u_th = 0.
108+
109+
#
110+
# The plasma species information
111+
#
112+
113+
plasma_e.charge = -q_e
114+
plasma_e.mass = m_e
115+
plasma_e.injection_style = "NUniformPerCell"
116+
plasma_e.xmin = -15.e-6
117+
plasma_e.xmax = 15.e-6
118+
plasma_e.ymin = -15.e-6
119+
plasma_e.ymax = 15.e-6
120+
plasma_e.zmin = 0.e-6
121+
plasma_e.profile = "constant"
122+
plasma_e.density = 1.e25
123+
plasma_e.num_particles_per_cell_each_dim = 2 2
124+
plasma_e.momentum_distribution_type = "constant"
125+
plasma_e.ux = 0.0
126+
plasma_e.uy = 0.0
127+
plasma_e.uz = 0.0
128+
129+
130+
plasma_p.charge = q_e
131+
plasma_p.mass = m_p
132+
plasma_p.injection_style = "NUniformPerCell"
133+
plasma_p.xmin = -15.e-6
134+
plasma_p.xmax = 15.e-6
135+
plasma_p.ymin = -15.e-6
136+
plasma_p.ymax = 15.e-6
137+
plasma_p.zmin = 0.e-6
138+
plasma_p.profile = "constant"
139+
plasma_p.density = 1.e25
140+
plasma_p.num_particles_per_cell_each_dim = 2 2
141+
plasma_p.momentum_distribution_type = "constant"
142+
plasma_p.ux = 0.0
143+
plasma_p.uy = 0.0
144+
plasma_p.uz = 0.0
145+
146+
# Moving window
147+
warpx.do_moving_window = 1
148+
warpx.moving_window_dir = z
149+
warpx.moving_window_v = 1. # in units of the speed of light
150+
151+
# Particle Injection
152+
warpx.do_plasma_injection = 1
153+
warpx.num_injected_species = 2
154+
warpx.injected_plasma_species = 2 3

GNUmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ EBASE = main
2424

2525
USE_PYTHON_MAIN = FALSE
2626

27+
USE_SENSEI_INSITU = FALSE
28+
2729
WarpxBinDir = Bin
2830

2931
USE_PSATD = FALSE

Regression/WarpX-tests.ini

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ compareParticles = 0
251251
[LaserAcceleration]
252252
buildDir = .
253253
inputFile = Examples/Physics_applications/laser_acceleration/inputs.3d
254-
runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=32 32 256 max_step=100 electrons.zmin=0.e-6
254+
runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=32 32 256 max_step=100 electrons.zmin=0.e-6 warpx.serialize_ics=1
255255
dim = 3
256256
restartTest = 0
257257
useMPI = 1
@@ -261,12 +261,26 @@ numthreads = 2
261261
compileTest = 0
262262
doVis = 0
263263
compareParticles = 1
264-
particleTypes = electrons beam
264+
particleTypes = electrons
265+
266+
[subcyclingMR]
267+
buildDir = .
268+
inputFile = Examples/Tests/subcycling/inputs.2d
269+
runtime_params = warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0
270+
dim = 2
271+
restartTest = 0
272+
useMPI = 1
273+
numprocs = 2
274+
useOMP = 1
275+
numthreads = 2
276+
compileTest = 0
277+
doVis = 0
278+
compareParticles = 0
265279

266280
[LaserAccelerationMR]
267281
buildDir = .
268282
inputFile = Examples/Physics_applications/laser_acceleration/inputs.2d
269-
runtime_params = amr.max_level=1 max_step=100
283+
runtime_params = amr.max_level=1 max_step=100 warpx.serialize_ics=1
270284
dim = 2
271285
restartTest = 0
272286
useMPI = 1
@@ -281,7 +295,7 @@ particleTypes = electrons beam
281295
[PlasmaAccelerationMR]
282296
buildDir = .
283297
inputFile = Examples/Physics_applications/plasma_acceleration/inputs.2d
284-
runtime_params = amr.max_level=1 amr.n_cell=32 512 max_step=100 plasma_e.zmin=-200.e-6
298+
runtime_params = amr.max_level=1 amr.n_cell=32 512 max_step=100 plasma_e.zmin=-200.e-6 warpx.serialize_ics=1 warpx.do_dynamic_scheduling=0
285299
dim = 2
286300
restartTest = 0
287301
useMPI = 1

Source/LaserParticleContainer.H

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ private:
5252
amrex::Vector<amrex::Real> position;
5353
amrex::Vector<amrex::Real> nvec;
5454
amrex::Vector<amrex::Real> p_X;
55+
amrex::Vector<amrex::Real> stc_direction;
56+
5557
long pusher_algo = -1;
5658
amrex::Real e_max = std::numeric_limits<amrex::Real>::quiet_NaN();
5759
amrex::Real wavelength = std::numeric_limits<amrex::Real>::quiet_NaN();
@@ -72,6 +74,7 @@ private:
7274
amrex::Real zeta = 0.;
7375
amrex::Real beta = 0.;
7476
amrex::Real phi2 = 0.;
77+
amrex::Real theta_stc = 0.;
7578

7679
// parse_field_function profile
7780
int parser_instance_number = 0;

Source/LaserParticleContainer.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies)
5757
pp.get("profile_duration", profile_duration);
5858
pp.get("profile_t_peak", profile_t_peak);
5959
pp.get("profile_focal_distance", profile_focal_distance);
60+
stc_direction = p_X;
61+
pp.queryarr("stc_direction", stc_direction);
6062
pp.query("zeta", zeta);
6163
pp.query("beta", beta);
6264
pp.query("phi2", phi2);
@@ -113,6 +115,22 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies)
113115

114116
p_Y = CrossProduct(nvec, p_X); // The second polarization vector
115117

118+
s = 1.0/std::sqrt(stc_direction[0]*stc_direction[0] + stc_direction[1]*stc_direction[1] + stc_direction[2]*stc_direction[2]);
119+
stc_direction = { stc_direction[0]*s, stc_direction[1]*s, stc_direction[2]*s };
120+
dp = std::inner_product(nvec.begin(), nvec.end(), stc_direction.begin(), 0.0);
121+
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(std::abs(dp) < 1.0e-14,
122+
"stc_direction is not perpendicular to the laser plane vector");
123+
124+
// Get angle between p_X and stc_direction
125+
// in 2d, stcs are in the simulation plane
126+
#if AMREX_SPACEDIM == 3
127+
theta_stc = acos(stc_direction[0]*p_X[0] +
128+
stc_direction[1]*p_X[1] +
129+
stc_direction[2]*p_X[2]);
130+
#else
131+
theta_stc = 0.;
132+
#endif
133+
116134
#if AMREX_SPACEDIM == 3
117135
u_X = p_X;
118136
u_Y = p_Y;
@@ -419,7 +437,7 @@ LaserParticleContainer::Evolve (int lev,
419437
warpx_gaussian_laser( &np, plane_Xp.data(), plane_Yp.data(),
420438
&t_lab, &wavelength, &e_max, &profile_waist, &profile_duration,
421439
&profile_t_peak, &profile_focal_distance, amplitude_E.data(),
422-
&zeta, &beta, &phi2 );
440+
&zeta, &beta, &phi2, &theta_stc );
423441
}
424442

425443
if (profile == laser_t::Harris) {

0 commit comments

Comments
 (0)