Closed ztdepztdep closed 3 months ago
amrex::printCell( my_multifab, amrex::IntVect(50,90));
(for 2d)
https://amrex-codes.github.io/amrex/doxygen/namespaceamrex.html#a376ff66b5e6a76d195cace00df41d05e
amrex::printCell( my_multifab, amrex::IntVect(50,90));
(for 2d)https://amrex-codes.github.io/amrex/doxygen/namespaceamrex.html#a376ff66b5e6a76d195cace00df41d05e
How to monitor its value , i.e. assign the value at (50,90) to a variable,then broadcast it to all the other processs.
#include <AMReX_MultiFabUtil.H>
MultiFab mf(...);
IntVect cell(....);
auto v = amrex::get_cell_data(mf, cell);
auto const& ba = mf.boxArray();
auto isects = ba.intersections(Box(cell,cell,ba.ixType()));
int root = mf.DistributionMap()[isects[0].first];
if (ParallelDescriptor::MyProc() != root) {
v.resize(mf.nComp());
}
ParallelDescriptor::Bcast(v.data(), v.size() , root);
Note that there might be typos.
I'm working with a Multifab data structure and I want to monitor the value at index (50, 90). However, there's a possibility that this particular index might not be present in the I/O processor. My question is: Can I still output the value using print functions, even if the index is missing?