aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2021-07-26 18:32:45 -0700
committerGravatar GitHub <noreply@github.com> 2021-07-26 18:32:45 -0700
commit2059fa7d75cd0557755b2797405e8864e897e07e (patch)
tree882186bd8806e3ce8ea80aa9eb85d7a9bea05ab3 /Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
parente86f39a07456e6a0d1a03c5a24116778b3cf0d19 (diff)
downloadWarpX-2059fa7d75cd0557755b2797405e8864e897e07e.tar.gz
WarpX-2059fa7d75cd0557755b2797405e8864e897e07e.tar.zst
WarpX-2059fa7d75cd0557755b2797405e8864e897e07e.zip
RZ PSATD: Multi-J Algorithm (#2111)
* RZ PSATD: Implement Multi-J Algorithm * Implement J_linear_in_time Option * Reduce Style Changes * Move Copy/Zero/Scale Functions to SpectralFieldDataRZ * Remove Unused Member m_n_rz_azimuthal_modes from SpectralSolverRZ * Fix CI -Werror Warnings * Implement Same Changes of #2116, Cleaning * Fix Bug: Pass Correct dt to SpectralSolverRZ * Add CI Test * CI Test: Set random_theta = 0, Update Benchmark * Remove random_theta from Inputs * Update Benchmark of multi_J_rz_psatd
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H37
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
index bf0d6b780..ec5fa4a83 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.H
@@ -64,6 +64,43 @@ class SpectralFieldDataRZ
amrex::MultiFab & tempHTransformedSplit,
const bool is_nodal_z);
+ /**
+ * \brief Copy spectral data from component \c src_comp to component \c dest_comp
+ * of \c fields
+ *
+ * \param[in] src_comp component of the source FabArray from which the data are copied
+ * \param[in] dest_comp component of the destination FabArray where the data are copied
+ */
+ void CopySpectralDataComp (const int src_comp, const int dest_comp)
+ {
+ // The last two arguments represent the number of components and
+ // the number of ghost cells to perform this operation
+ Copy(fields, fields, src_comp, dest_comp, n_rz_azimuthal_modes, 0);
+ }
+
+ /**
+ * \brief Set to zero the data on component \c icomp of \c fields
+ *
+ * \param[in] icomp component of the FabArray where the data are set to zero
+ */
+ void ZeroOutDataComp(const int icomp)
+ {
+ // The last argument represents the number of components to perform this operation
+ fields.setVal(0., icomp, n_rz_azimuthal_modes);
+ }
+
+ /**
+ * \brief Scale the data on component \c icomp of \c fields by a given scale factor
+ *
+ * \param[in] icomp component of the FabArray where the data are scaled
+ * \param[in] scale_factor scale factor to use for scaling
+ */
+ void ScaleDataComp(const int icomp, const amrex::Real scale_factor)
+ {
+ // The last argument represents the number of components to perform this operation
+ fields.mult(scale_factor, icomp, n_rz_azimuthal_modes);
+ }
+
void InitFilter (amrex::IntVect const & filter_npass_each_dir, bool const compensation,
SpectralKSpaceRZ const & k_space);