Skip to content

Commit c9c6419

Browse files
authored
Remove field probe raw_fields option (#4074)
* Remove field probe raw_fields option * Fix error message * Remove unused variables * Remove more unused variables
1 parent 29d7068 commit c9c6419

File tree

3 files changed

+11
-37
lines changed

3 files changed

+11
-37
lines changed

Docs/source/usage/parameters.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,14 +2655,11 @@ Reduced Diagnostics
26552655
the value of the Poynting Vector :math:`|S|` of the electromagnetic fields,
26562656
at mesh refinement levels from 0 to :math:`n`, at point (:math:`x`, :math:`y`, :math:`z`).
26572657

2658-
Note: the norms are always interpolated to the measurement point before they are written
2659-
to file. The electromagnetic field components are interpolated to the measurement point
2660-
by default, but can they be saved as non-averaged by setting
2661-
``<reduced_diags_name>.raw_fields = true``, in which case the raw fields for the cell
2662-
containing the measurement point are saved. In RZ geometry, this only saves the
2663-
0'th azimuthal mode component of the fields.
2658+
The fields are always interpolated to the measurement point.
26642659
The interpolation order can be set by specifying ``<reduced_diags_name>.interp_order``,
2665-
otherwise it is set to ``1``.
2660+
defaulting to ``1``.
2661+
In RZ geometry, this only saves the
2662+
0'th azimuthal mode component of the fields.
26662663
Integrated electric and magnetic field components can instead be obtained by specifying
26672664
``<reduced_diags_name>.integrate == true``.
26682665
In a *moving window* simulation, the FieldProbe can be set to follow the moving frame by specifying ``<reduced_diags_name>.do_moving_window_FP = 1`` (default 0).

Source/Diagnostics/ReducedDiags/FieldProbe.H

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ private:
109109
//! particle shape used for field gather
110110
int interp_order = 1;
111111

112-
//! Judges whether to gather raw fields or interpolated data
113-
bool raw_fields = false;
114-
115112
//! Judges whether to follow a moving window
116113
bool do_moving_window_FP = false;
117114

Source/Diagnostics/ReducedDiags/FieldProbe.cpp

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,15 @@ FieldProbe::FieldProbe (std::string rd_name)
135135
);
136136
}
137137
pp_rd_name.query("integrate", m_field_probe_integrate);
138-
pp_rd_name.query("raw_fields", raw_fields);
139138
utils::parser::queryWithParser(pp_rd_name, "interp_order", interp_order);
140139
pp_rd_name.query("do_moving_window_FP", do_moving_window_FP);
141140

141+
bool raw_fields;
142+
const bool raw_fields_specified = pp_rd_name.query("raw_fields", raw_fields);
143+
if (raw_fields_specified) {
144+
WARPX_ABORT_WITH_MESSAGE("The field probe raw_fields options is obsolete. To get the equivalent, set interp_order = 0");
145+
}
146+
142147
if (WarpX::gamma_boost > 1.0_rt)
143148
{
144149
ablastr::warn_manager::WMRecordWarning(
@@ -372,8 +377,6 @@ void FieldProbe::ComputeDiags (int step)
372377
// loop over refinement levels
373378
for (int lev = 0; lev < nLevel; ++lev)
374379
{
375-
const amrex::Geometry& gm = warpx.Geom(lev);
376-
const auto prob_lo = gm.ProbLo();
377380
amrex::Real const dt = WarpX::GetInstance().getdt(lev);
378381
// Calculates particle movement in moving window sims
379382
amrex::Real move_dist = 0.0;
@@ -455,18 +458,6 @@ void FieldProbe::ComputeDiags (int step)
455458
}
456459
if( ProbeInDomain() )
457460
{
458-
const auto cell_size = gm.CellSizeArray();
459-
const int i_probe = static_cast<int>(amrex::Math::floor((x_probe - prob_lo[0]) / cell_size[0]));
460-
#if defined(WARPX_DIM_1D_Z)
461-
const int j_probe = 0;
462-
const int k_probe = 0;
463-
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
464-
const int j_probe = static_cast<int>(amrex::Math::floor((z_probe - prob_lo[1]) / cell_size[1]));
465-
const int k_probe = 0;
466-
#elif defined(WARPX_DIM_3D)
467-
const int j_probe = static_cast<int>(amrex::Math::floor((y_probe - prob_lo[1]) / cell_size[1]));
468-
const int k_probe = static_cast<int>(amrex::Math::floor((z_probe - prob_lo[2]) / cell_size[2]));
469-
#endif
470461
const auto &arrEx = Ex[pti].array();
471462
const auto &arrEy = Ey[pti].array();
472463
const auto &arrEz = Ez[pti].array();
@@ -501,7 +492,6 @@ void FieldProbe::ComputeDiags (int step)
501492
// Temporarily defining modes and interp outside ParallelFor to avoid GPU compilation errors.
502493
const int temp_modes = WarpX::n_rz_azimuthal_modes;
503494
const int temp_interp_order = interp_order;
504-
const bool temp_raw_fields = raw_fields;
505495
const bool temp_field_probe_integrate = m_field_probe_integrate;
506496

507497
// Interpolating to the probe positions for each particle
@@ -514,17 +504,7 @@ void FieldProbe::ComputeDiags (int step)
514504
amrex::ParticleReal Bxp = 0._prt, Byp = 0._prt, Bzp = 0._prt;
515505

516506
// first gather E and B to the particle positions
517-
if (temp_raw_fields)
518-
{
519-
Exp = arrEx(i_probe, j_probe, k_probe);
520-
Eyp = arrEy(i_probe, j_probe, k_probe);
521-
Ezp = arrEz(i_probe, j_probe, k_probe);
522-
Bxp = arrBx(i_probe, j_probe, k_probe);
523-
Byp = arrBy(i_probe, j_probe, k_probe);
524-
Bzp = arrBz(i_probe, j_probe, k_probe);
525-
}
526-
else
527-
doGatherShapeN(xp, yp, zp, Exp, Eyp, Ezp, Bxp, Byp, Bzp,
507+
doGatherShapeN(xp, yp, zp, Exp, Eyp, Ezp, Bxp, Byp, Bzp,
528508
arrEx, arrEy, arrEz, arrBx, arrBy, arrBz,
529509
Extype, Eytype, Eztype, Bxtype, Bytype, Bztype,
530510
dx_arr, xyzmin_arr, lo, temp_modes,

0 commit comments

Comments
 (0)