Skip to content

Avoiding issues when propagating a laser with dt=0 #1219

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

Open
wants to merge 16 commits into
base: development
Choose a base branch
from
1 change: 1 addition & 0 deletions examples/blowout_wake/inputs_SI
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ max_step = 0
diagnostic.output_period = 1

hipace.depos_order_xy = 2
hipace.dt = 1.e-6/clight

boundary.field = Dirichlet
boundary.particle = Periodic
Expand Down
1 change: 1 addition & 0 deletions examples/blowout_wake/inputs_normalized
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ amr.max_level = 0
max_step = 0
diagnostic.output_period = 1

hipace.dt = 1/clight
hipace.depos_order_xy = 2

boundary.field = Dirichlet
Expand Down
2 changes: 1 addition & 1 deletion examples/laser_ionization/inputs_laser_ionization
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
max_step = 0
hipace.dt = 0
hipace.dt = 10.e-6/clight
hipace.verbose = 3

amr.n_cell = 50 50 50
Expand Down
2 changes: 2 additions & 0 deletions src/laser/MultiLaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ MultiLaser::AdvanceSlice (const int islice, const Fields& fields, amrex::Real dt

if (!UseLaser(islice)) return;

AMREX_ALWAYS_ASSERT_WITH_MESSAGE(dt>0, "Cannot use dt=0 or dt<0 with laser");

Hipace::m_num_laser_cells_updated += m_slice_box.d_numPts();

InterpolateChi(fields, geom_field_lev0);
Expand Down
34 changes: 17 additions & 17 deletions tests/checksum/benchmarks_json/blowout_wake.2Rank.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"lev=0": {
"Bx": 1090.713964339,
"By": 1090.713964339,
"Bz": 31.667907950938,
"ExmBy": 1647.1039663567,
"EypBx": 1647.1039663567,
"Ez": 1403.6070905859,
"Psi": 2132.3248879604,
"Sx": 3061.9838214617,
"Sy": 3061.9838214617,
"chi": 405683.18832868,
"jx": 1077.3968452158,
"jx_beam": 0.0,
"jy": 1077.3968452158,
"jy_beam": 0.0,
"Bx": 1090.7154900517,
"By": 1090.7154422643,
"Bz": 31.667398575322,
"ExmBy": 1647.107987011,
"EypBx": 1647.1081910522,
"Ez": 1403.6094478169,
"Psi": 2132.3355039045,
"Sx": 3061.986135111,
"Sy": 3061.9861100545,
"chi": 405683.17903507,
"jx": 1077.3961376759,
"jx_beam": 9.9270072350142e-11,
"jy": 1077.3971049505,
"jy_beam": 9.9270070959291e-11,
"jz_beam": 799.24438903362,
"rhomjz": 3938.2517311491
"rhomjz": 3938.2515666667
},
"beam": {
"charge": 7448.0,
Expand All @@ -24,8 +24,8 @@
"x": 3871.0,
"y": 3871.0,
"z": 21897.12,
"ux": 0.0,
"uy": 0.0,
"ux": 2.3556092993799e-06,
"uy": 2.3556093051022e-06,
"uz": 14896000.0,
"w": 799.24448893917
}
Expand Down
36 changes: 18 additions & 18 deletions tests/checksum/benchmarks_json/reset.2Rank.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"lev=0": {
"Bx": 1090.6435784789,
"By": 1090.6435784789,
"Bz": 31.672432358345,
"ExmBy": 1646.9810972817,
"EypBx": 1646.9810972817,
"Ez": 1403.4429508832,
"Psi": 2132.0850072334,
"Sx": 3061.9089975082,
"Sy": 3061.9089975082,
"chi": 405683.282164,
"jx": 1077.3232567856,
"jx_beam": 0.0,
"jy": 1077.3232567856,
"jy_beam": 0.0,
"Bx": 1090.6413080929,
"By": 1090.6412063521,
"Bz": 31.672811205069,
"ExmBy": 1646.9770739969,
"EypBx": 1646.9770456234,
"Ez": 1403.4313773122,
"Psi": 2132.0751054606,
"Sx": 3061.9079220281,
"Sy": 3061.9078930139,
"chi": 405683.28357349,
"jx": 1077.3190684908,
"jx_beam": 1.9854032540597e-10,
"jy": 1077.3188464065,
"jy_beam": 1.9854032267884e-10,
"jz_beam": 799.24438903362,
"rhomjz": 3938.1190949076
"rhomjz": 3938.1157251251
},
"beam": {
"charge": 7448.0,
Expand All @@ -24,9 +24,9 @@
"x": 3871.0,
"y": 3871.0,
"z": 21897.12,
"ux": 0.0,
"uy": 0.0,
"uz": 14896000.0,
"ux": 4.7111116218863e-06,
"uy": 4.7111115383888e-06,
"uz": 14896000.000001,
"w": 799.24448893917
}
}
Loading