diff --git a/Source/Diagnostics/ComputeDiagFunctors/RecordingPlaneFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/RecordingPlaneFunctor.cpp index fdd55d62cde..3e7873b4d87 100644 --- a/Source/Diagnostics/ComputeDiagFunctors/RecordingPlaneFunctor.cpp +++ b/Source/Diagnostics/ComputeDiagFunctors/RecordingPlaneFunctor.cpp @@ -22,7 +22,7 @@ amrex::Real interp_to_slice (int i, int j, Real const w = z - Real(iz); #if (AMREX_SPACEDIM == 1) amrex::ignore_unused(i,j); - amrex::Abort("xxxxx todo"); + amrex::Abort("interp_to_slice: 1D not supported"); return 0; #elif (AMREX_SPACEDIM == 2) amrex::ignore_unused(j); @@ -33,8 +33,20 @@ amrex::Real interp_to_slice (int i, int j, src(i ,iz,0)*(Real(1.0)-w) + src(i ,iz+1,0)*w); } #else - amrex::Abort("xxxxx todo"); - return 0; + if (type.nodeCentered(0) && type.nodeCentered(1)) { + return src(i,j,iz)*(Real(1.0)-w) + src(i,j,iz+1)*w; + } else if (type.nodeCentered(0)) { + return Real(0.5)*((src(i,j-1,iz )+src(i,j,iz ))*(Real(1.0)-w) + + (src(i,j-1,iz+1)+src(i,j,iz+1))* w); + } else if (type.nodeCentered(1)) { + return Real(0.5)*((src(i-1,j,iz )+src(i,j,iz ))*(Real(1.0)-w) + + (src(i-1,j,iz+1)+src(i,j,iz+1))* w); + } else { + return Real(0.25)*((src(i-1,j-1,iz )+src(i,j-1,iz ) + + src(i-1,j ,iz )+src(i,j ,iz ))*(Real(1.0)-w) + + (src(i-1,j-1,iz+1)+src(i,j-1,iz+1) + + src(i-1,j ,iz+1)+src(i,j ,iz+1))* w); + } #endif } @@ -67,6 +79,8 @@ RecordingPlaneFunctor::operator() (amrex::MultiFab& mf_dst, const int dcomp, con amrex::Vector slice_to_full_ba_map; std::unique_ptr slice = AllocateSlice(slice_to_full_ba_map, slice_k); + // slice is cell-centered in z-direction and nodal in others. There is + // only one cell in the z-direction. for (auto& smf : m_arr_mf_src) { AMREX_ALWAYS_ASSERT(smf->nGrowVect().allGE(amrex::IntVect(1))); @@ -117,11 +131,7 @@ RecordingPlaneFunctor::PrepareFunctorData (int i_station, bool slice_in_domain, amrex::ignore_unused(i_station, slice_in_domain, zlocation, buffer_full); m_buffer_box = buffer_box; m_k_index = k_index; - if (slice_in_domain == true) { - m_slice_in_domain = 1; - } else { - m_slice_in_domain = 0; - } + m_slice_in_domain = slice_in_domain; } std::unique_ptr diff --git a/Source/Laser/LaserProfilesImpl/LaserProfileStationField.cpp b/Source/Laser/LaserProfilesImpl/LaserProfileStationField.cpp index 04607a6e4cf..63eef466767 100644 --- a/Source/Laser/LaserProfilesImpl/LaserProfileStationField.cpp +++ b/Source/Laser/LaserProfilesImpl/LaserProfileStationField.cpp @@ -1,5 +1,6 @@ #include "Laser/LaserProfiles.H" #include "WarpX.H" +#include "Utils/TextMsg.H" #include "Utils/WarpXConst.H" #include @@ -58,9 +59,9 @@ void StationFieldLaserProfile::update (amrex::Real t) amrex::VisMF::Read(mf, m_station_file+"/Level_0/buffer-" +std::to_string(m_ibuffer)); - amrex::Print() << "xxxxx LaserProfileStationField: reading " - << m_station_file+"/Level_0/buffer-"+std::to_string(m_ibuffer) - << "\n"; + std::string msg("LaserProfileStationField: reading "); + msg.append(m_station_file).append("/Level_0/buffer-").append(std::to_string(m_ibuffer)); + amrex::Print() << Utils::TextMsg::Info(msg); m_station_mf = std::make_unique (mf.boxArray(), mf.DistributionMap(), 1, 0); @@ -88,7 +89,7 @@ void StationFieldLaserProfile::update (amrex::Real t) m_station_mf.reset(); m_slice_fab.reset(); - amrex::Print() << "xxxxx LaserProfileStationField: no more data\n"; + amrex::Print() << Utils::TextMsg::Info("LaserProfileStationField: no more data"); return; }