You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following function in my LBM_FVM class, which is supposed to get data from a specific cell (i, j) across different refinement levels. I want it to get data from the fineset level first.
but it sometimes give a "zero" value, i am not sure what had happed.
`double LBM_FVM::GetCellData(amrex::Vector<amrex::MultiFab>& data, int i, int j)
{
IntVect cell(i, j);
for(int i=finestLevel(); i>=0; i--)
{
auto v = amrex::get_cell_data(data[i], cell);
auto const& ba = data[i].boxArray();
bool test = ba.intersects(Box(cell, cell, ba.ixType()), 0);
if (test)
{
auto const& ba = data[i].boxArray();
auto isects = ba.intersections(Box(cell, cell, ba.ixType()));
int root = data[i].DistributionMap()[isects[0].first];
if (ParallelDescriptor::MyProc() != root) v.resize(1);
ParallelDescriptor::Bcast(v.data(), v.size(), root);
return v[0];
}
}
return -1; // or some error value if cell not found
}
`
The text was updated successfully, but these errors were encountered:
I think the data buffer in MPI Bcast should be equal size in all processors. And v is better to be a temporal vector with a copy of data you want to bcast, other than the data reference from MFI. Therefore, the following resize is not proper.
if (ParallelDescriptor::MyProc() != root) v.resize(1);
ParallelDescriptor::Bcast(v.data(), v.size(), root);
I have the following function in my LBM_FVM class, which is supposed to get data from a specific cell (i, j) across different refinement levels. I want it to get data from the fineset level first.
but it sometimes give a "zero" value, i am not sure what had happed.
The text was updated successfully, but these errors were encountered: