17 std::string file, std::string func,
int line,
18 amrex::FabArray<amrex::BaseFab<T>> &a_mf,
int i,
int j,
int k,
int n)
21 for (amrex::MFIter mfi(a_mf); mfi.isValid(); ++mfi)
23 const amrex::Box& validbox = mfi.validbox();
24 const amrex::Box& box = mfi.grownnodaltilebox();
26 if (box.contains(amrex::IntVect(AMREX_D_DECL(i,j,0))))
28 const auto& arr = a_mf.const_array(mfi);
29 if (validbox.strictly_contains(i,j,k))
30 Util::ParallelMessage(file,func,line,
"inside: (",i,
",",j,
",",k,
") ",arr(i, j, k, n));
31 else if (validbox.contains(i,j,k))
32 Util::ParallelMessage(file,func,line,
"border: (",i,
",",j,
",",k,
") ",arr(i, j, k, n));
34 Util::ParallelMessage(file,func,line,
"ghost: (",i,
",",j,
",",k,
") ",arr(i, j, k, n));
41 std::string file, std::string func,
int line,
42 const amrex::MultiFab &a_mf,
int _i,
int _j,
int ,
int n,
45 const int t_notexist = 0;
46 const int t_inside = 1;
47 const int t_border = 2;
48 const int t_ghost = 3;
52 for (
int rank = 0; rank < amrex::ParallelDescriptor::NProcs() ; rank++)
54 amrex::ParallelDescriptor::Barrier();
55 if (rank != amrex::ParallelDescriptor::MyRankInTeam())
continue;
58 for (amrex::MFIter mfi(a_mf,
false); mfi.isValid(); ++mfi)
60 const amrex::Box& validbox = mfi.validbox();
61 const amrex::Box& box = mfi.grownnodaltilebox();
62 bool contains =
false;
64 std::vector<std::vector<Set::Scalar>> vals(2*pad + 1);
65 std::vector<std::vector<int>> types(2*pad + 1);
66 for (
auto & val : vals) val.resize(2*pad + 1,NAN);
67 for (
auto & type : types) type.resize(2*pad + 1,t_notexist);
69 for (
int I = 0; I <= 2*pad; I++)
71 for (
int J = 0; J <= 2*pad; J++)
73 int i = (_i - pad) + I;
74 int j = (_j - pad) + J;
76 if (box.contains(amrex::IntVect(AMREX_D_DECL(i,j,0))))
78 const auto& arr = a_mf.const_array(mfi);
79 vals[I][J] = arr(i,j,0,n);
80 if (validbox.strictly_contains(i,j,0)) types[I][J] = t_inside;
81 else if (validbox.contains(i,j,0)) types[I][J] = t_border;
82 else types[I][J] = t_ghost;
93 for (
int I = 0; I <= 2*pad; I++)
95 int i = (_i - pad) + I;
96 ss <<
"i=" << std::left << std::setw(13) << i;
101 for (
int J = 2*pad; J >= 0; J--)
103 int j = (_j - pad) + J;
105 std::stringstream ss;
107 for (
int I = 0; I <= 2*pad; I++)
113 ss << std::left << std::setw(15) << vals[I][J];
121 amrex::ParallelDescriptor::ReduceIntSum(hit);
128 std::string file, std::string func,
int line,
129 amrex::iMultiFab &a_mf,
int i,
int j,
int k,
int n)
132 for (amrex::MFIter mfi(a_mf); mfi.isValid(); ++mfi)
134 const amrex::Box& validbox = mfi.validbox();
135 const amrex::Box& box = mfi.grownnodaltilebox();
137 if (box.contains(amrex::IntVect(AMREX_D_DECL(i,j,0))))
139 const auto& arr = a_mf.const_array(mfi);
140 if (validbox.strictly_contains(i,j,k))
141 Util::ParallelMessage(file,func,line,
"inside: (",i,
",",j,
",",k,
") ",arr(i, j, k, n));
142 else if (validbox.contains(i,j,k))
143 Util::ParallelMessage(file,func,line,
"border: (",i,
",",j,
",",k,
") ",arr(i, j, k, n));
145 Util::ParallelMessage(file,func,line,
"ghost: (",i,
",",j,
",",k,
") ",arr(i, j, k, n));
171 std::string file, std::string func,
int line,
172 const amrex::MultiFab &mf, std::string desc=
"")
174 Compare(file,func,line,mf,desc,amrex::Box::TheUnitBox(),0);
void Compare(std::string file, std::string func, int line, const amrex::MultiFab &a_mf, std::string desc, amrex::Box domain, int)
AMREX_FORCE_INLINE void Probe(std::string file, std::string func, int line, amrex::FabArray< amrex::BaseFab< T > > &a_mf, int i, int j, int k, int n)