aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FullDiagnostics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Diagnostics/FullDiagnostics.cpp')
-rw-r--r--Source/Diagnostics/FullDiagnostics.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Diagnostics/FullDiagnostics.cpp b/Source/Diagnostics/FullDiagnostics.cpp
index 6f214b4d7..d00720a54 100644
--- a/Source/Diagnostics/FullDiagnostics.cpp
+++ b/Source/Diagnostics/FullDiagnostics.cpp
@@ -393,13 +393,15 @@ FullDiagnostics::InitializeFieldFunctors (int lev)
m_all_field_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.get_pointer_current_fp(lev, 2), lev, m_crse_ratio);
} else if ( m_varnames[comp] == "rho" ){
if ( WarpX::do_back_transformed_diagnostics ) {
-#ifdef WARPX_USE_PSATD
- // rho_new is stored in component 1 of rho_fp when using PSATD
- amrex::MultiFab* rho_new = new amrex::MultiFab(*warpx.get_pointer_rho_fp(lev), amrex::make_alias, 1, 1);
- m_all_field_functors[lev][comp] = std::make_unique<CellCenterFunctor>(rho_new, lev, m_crse_ratio);
-#else
- m_all_field_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.get_pointer_rho_fp(lev), lev, m_crse_ratio);
-#endif
+ if ( WarpX::maxwell_solver_id == MaxwellSolverAlgo::PSATD ) {
+ // rho_new is stored in component 1 of rho_fp when using PSATD
+ amrex::MultiFab *rho_new = new amrex::MultiFab(*warpx.get_pointer_rho_fp(lev), amrex::make_alias,
+ 1, 1);
+ m_all_field_functors[lev][comp] = std::make_unique<CellCenterFunctor>(rho_new, lev, m_crse_ratio);
+ } else {
+ m_all_field_functors[lev][comp] = std::make_unique<CellCenterFunctor>(warpx.get_pointer_rho_fp(lev),
+ lev, m_crse_ratio);
+ }
}
else {
// Initialize rho functor to dump total rho