aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Diagnostics')
-rw-r--r--Source/Diagnostics/BTDiagnostics.cpp4
-rw-r--r--Source/Diagnostics/BackTransformedDiagnostic.cpp9
-rw-r--r--Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp7
-rw-r--r--Source/Diagnostics/Diagnostics.cpp3
-rw-r--r--Source/Diagnostics/SliceDiagnostic.cpp6
-rw-r--r--Source/Diagnostics/WarpXIO.cpp3
6 files changed, 23 insertions, 9 deletions
diff --git a/Source/Diagnostics/BTDiagnostics.cpp b/Source/Diagnostics/BTDiagnostics.cpp
index fadd97b0f..ae5c7a53b 100644
--- a/Source/Diagnostics/BTDiagnostics.cpp
+++ b/Source/Diagnostics/BTDiagnostics.cpp
@@ -1,5 +1,4 @@
#include "BTDiagnostics.H"
-
#include "BTD_Plotfile_Header_Impl.H"
#include "ComputeDiagFunctors/BackTransformFunctor.H"
#include "ComputeDiagFunctors/CellCenterFunctor.H"
@@ -7,6 +6,7 @@
#include "ComputeDiagFunctors/RhoFunctor.H"
#include "Diagnostics/Diagnostics.H"
#include "Diagnostics/FlushFormats/FlushFormat.H"
+#include "Parallelization/WarpXCommUtil.H"
#include "Utils/CoarsenIO.H"
#include "Utils/WarpXConst.H"
#include "Utils/WarpXUtil.H"
@@ -403,7 +403,7 @@ BTDiagnostics::PrepareFieldDataForOutput ()
AMREX_ALWAYS_ASSERT( icomp_dst == m_cellcenter_varnames.size() );
// fill boundary call is required to average_down (flatten) data to
// the coarsest level.
- m_cell_centered_data[lev]->FillBoundary(warpx.Geom(lev).periodicity() );
+ WarpXCommUtil::FillBoundary(*m_cell_centered_data[lev], warpx.Geom(lev).periodicity());
}
// Flattening out MF over levels
diff --git a/Source/Diagnostics/BackTransformedDiagnostic.cpp b/Source/Diagnostics/BackTransformedDiagnostic.cpp
index 171687942..17b59d3ae 100644
--- a/Source/Diagnostics/BackTransformedDiagnostic.cpp
+++ b/Source/Diagnostics/BackTransformedDiagnostic.cpp
@@ -7,6 +7,7 @@
*/
#include "BackTransformedDiagnostic.H"
+#include "Parallelization/WarpXCommUtil.H"
#include "Utils/WarpXConst.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "WarpX.H"
@@ -757,8 +758,10 @@ void BackTransformedDiagnostic::Flush (const Geometry& /*geom*/)
const int ncomp = lf_diags->m_data_buffer_->nComp();
MultiFab tmp(buff_ba, buff_dm, ncomp, 0);
+ tmp.setVal(0.0);
- tmp.ParallelCopy(*lf_diags->m_data_buffer_, 0, 0, ncomp);
+ WarpXCommUtil::ParallelCopy(tmp, *lf_diags->m_data_buffer_, 0, 0, ncomp,
+ IntVect(AMREX_D_DECL(0, 0, 0)), IntVect(AMREX_D_DECL(0, 0, 0)));
#ifdef WARPX_USE_HDF5
for (int comp = 0; comp < ncomp; ++comp) {
@@ -905,6 +908,7 @@ writeLabFrameData (const MultiFab* cell_centered_data,
tmp_slice_ptr = std::make_unique<MultiFab>(slice_ba,
lf_diags->m_data_buffer_->DistributionMap(),
ncomp, 0);
+ tmp_slice_ptr->setVal(0.0);
// slice is re-used if the t_lab of a diag is equal to
// that of the previous diag.
@@ -912,7 +916,8 @@ writeLabFrameData (const MultiFab* cell_centered_data,
// which has the dmap of the domain to
// tmp_slice_ptr which has the dmap of the
// data_buffer that stores the back-transformed data.
- tmp_slice_ptr->ParallelCopy(*slice, 0, 0, ncomp);
+ WarpXCommUtil::ParallelCopy(*tmp_slice_ptr, *slice, 0, 0, ncomp,
+ IntVect(AMREX_D_DECL(0, 0, 0)), IntVect(AMREX_D_DECL(0, 0, 0)));
lf_diags->AddDataToBuffer(*tmp_slice_ptr, i_lab,
map_actual_fields_to_dump);
tmp_slice_ptr = nullptr;
diff --git a/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp
index 78e070bfd..4af43b4b8 100644
--- a/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp
+++ b/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp
@@ -1,6 +1,7 @@
#include "BackTransformFunctor.H"
#include "Diagnostics/ComputeDiagFunctors/ComputeDiagFunctor.H"
+#include "Parallelization/WarpXCommUtil.H"
#include "Utils/WarpXConst.H"
#include "WarpX.H"
@@ -70,11 +71,13 @@ BackTransformFunctor::operator ()(amrex::MultiFab& mf_dst, int /*dcomp*/, const
// containing all ten components that were in the slice generated from m_mf_src.
std::unique_ptr< amrex::MultiFab > tmp_slice_ptr = nullptr;
tmp_slice_ptr = std::make_unique<MultiFab> ( slice_ba, mf_dst.DistributionMap(),
- slice->nComp(), 0 );
+ slice->nComp(), 0 );
+ tmp_slice_ptr->setVal(0.0);
// Parallel copy the lab-frame data from "slice" MultiFab with
// ncomp=10 and boosted-frame dmap to "tmp_slice_ptr" MultiFab with
// ncomp=10 and dmap of the destination Multifab, which will store the final data
- tmp_slice_ptr->ParallelCopy( *slice, 0, 0, slice->nComp() );
+ WarpXCommUtil::ParallelCopy(*tmp_slice_ptr, *slice, 0, 0, slice->nComp(),
+ IntVect(AMREX_D_DECL(0, 0, 0)), IntVect(AMREX_D_DECL(0, 0, 0)));
// Now we will cherry pick only the user-defined fields from
// tmp_slice_ptr to dst_mf
const int k_lab = m_k_index_zlab[i_buffer];
diff --git a/Source/Diagnostics/Diagnostics.cpp b/Source/Diagnostics/Diagnostics.cpp
index a6d85185c..9df599fa7 100644
--- a/Source/Diagnostics/Diagnostics.cpp
+++ b/Source/Diagnostics/Diagnostics.cpp
@@ -11,6 +11,7 @@
#include "FlushFormats/FlushFormatPlotfile.H"
#include "FlushFormats/FlushFormatSensei.H"
#include "Particles/MultiParticleContainer.H"
+#include "Parallelization/WarpXCommUtil.H"
#include "Utils/WarpXAlgorithmSelection.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "Utils/WarpXUtil.H"
@@ -318,7 +319,7 @@ Diagnostics::ComputeAndPack ()
// needed for contour plots of rho, i.e. ascent/sensei
if (m_format == "sensei" || m_format == "ascent") {
- m_mf_output[i_buffer][lev].FillBoundary(warpx.Geom(lev).periodicity());
+ WarpXCommUtil::FillBoundary(m_mf_output[i_buffer][lev], warpx.Geom(lev).periodicity());
}
}
}
diff --git a/Source/Diagnostics/SliceDiagnostic.cpp b/Source/Diagnostics/SliceDiagnostic.cpp
index 5e58f4163..185c560ae 100644
--- a/Source/Diagnostics/SliceDiagnostic.cpp
+++ b/Source/Diagnostics/SliceDiagnostic.cpp
@@ -8,6 +8,7 @@
#include "SliceDiagnostic.H"
#include "WarpX.H"
+#include "Parallelization/WarpXCommUtil.H"
#include <AMReX.H>
#include <AMReX_Array4.H>
@@ -25,6 +26,8 @@
#include <AMReX_MFIter.H>
#include <AMReX_MultiFab.H>
#include <AMReX_MultiFabUtil.H>
+#include <AMReX_PlotFileUtil.H>
+
#include <AMReX_Print.H>
#include <AMReX_REAL.H>
#include <AMReX_RealBox.H>
@@ -140,7 +143,8 @@ CreateSlice( const MultiFab& mf, const Vector<Geometry> &dom_geom,
// Copy data from domain to slice that has same cell size as that of //
// the domain mf. src and dst have the same number of ghost cells //
- smf->ParallelCopy(mf, 0, 0, ncomp,nghost,nghost);
+ amrex::IntVect nghost_vect(AMREX_D_DECL(nghost, nghost, nghost));
+ WarpXCommUtil::ParallelCopy(*smf, mf, 0, 0, ncomp,nghost_vect,nghost_vect);
// inteprolate if required on refined slice //
if (interpolate == 1 ) {
diff --git a/Source/Diagnostics/WarpXIO.cpp b/Source/Diagnostics/WarpXIO.cpp
index bf9aad1f5..4abd85faa 100644
--- a/Source/Diagnostics/WarpXIO.cpp
+++ b/Source/Diagnostics/WarpXIO.cpp
@@ -11,6 +11,7 @@
#include "FieldIO.H"
#include "Particles/MultiParticleContainer.H"
#include "Utils/CoarsenIO.H"
+#include "Parallelization/WarpXCommUtil.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "WarpX.H"
@@ -368,7 +369,7 @@ WarpX::GetCellCenteredData() {
const std::unique_ptr<MultiFab>& charge_density = mypc->GetChargeDensity(lev);
AverageAndPackScalarField( *cc[lev], *charge_density, dmap[lev], dcomp, ng );
- cc[lev]->FillBoundary(geom[lev].periodicity());
+ WarpXCommUtil::FillBoundary(*cc[lev], geom[lev].periodicity());
}
for (int lev = finest_level; lev > 0; --lev)