UGGrid: loadBalance with targetProcessors and handler fails for element data
Description
uggrid.hh allows to loadBalance a mesh with targetProcessors, fromLevel and a dataHandle as argument
loadBalance (const std::vector<Rank>& targetProcessors, unsigned int fromLevel, DataHandle& dataHandle)
this method fails when the handler contains only element data.
Proposal
The code for element data is commented in gather and scatter method
// gather element data
// UGLBGatherScatter::template gather<0>(this->leafGridView(), dataHandle);
// gather node data
UGLBGatherScatter::template gather<dim>(this->leafGridView(), dataHandle); #endif`
...
// scatter element data
// UGLBGatherScatter::template scatter<0>(this->leafGridView(), dataHandle);
// scatter node data
UGLBGatherScatter::template scatter<dim>(this->leafGridView(), dataHandle);
the loadBalance method that only uses the handle
bool loadBalance (DataHandle& dataHandle)
checks if the handle contains node/element data.
// gather element data
if (dataHandle.contains(dim, 0))
UGLBGatherScatter::template gather<0>(this->leafGridView(), dataHandle);
// gather node data
if (dataHandle.contains(dim,dim))
UGLBGatherScatter::template gather<dim>(this->leafGridView(), dataHandle);
...
// scatter element data
if (dataHandle.contains(dim, 0))
UGLBGatherScatter::template scatter<0>(this->leafGridView(), dataHandle);
// scatter node data
if (dataHandle.contains(dim,dim))
UGLBGatherScatter::template scatter<dim>(this->leafGridView(), dataHandle);
changing the scatter and gather methods accordingly worked for me.