本文整理汇总了C++中MultiGrid::distributed_grid_manager方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiGrid::distributed_grid_manager方法的具体用法?C++ MultiGrid::distributed_grid_manager怎么用?C++ MultiGrid::distributed_grid_manager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiGrid
的用法示例。
在下文中一共展示了MultiGrid::distributed_grid_manager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignSubsetsByInterfaceType
static void AssignSubsetsByInterfaceType(SubsetHandler& sh, MultiGrid& mg)
{
const int siNormal = 0;
const int siHMaster = 1;
const int siHSlave = 1 << 1;
const int siVMaster = 1 << 2;
const int siVSlave = 1 << 3;
const char* subsetNames[] = {"normal", "hmaster", "hslave", "hslave+hmaster",
"vmaster", "vmaster+hmaster", "vmaster+hslave",
"vmaster+hslave+hmaster", "vslave", "vslave+hmaster",
"vslave+hslave", "vslave+hslave+hmaster",
"vslave+vmaster", "vslave+vmaster+hmaster",
"vslave+vmaster+hslave", "vslave+vmaster+hmaster+hslave"};
for(int i = 0; i < 16; ++i)
sh.subset_info(i).name = subsetNames[i];
typedef typename Grid::traits<TElem>::iterator TIter;
for(TIter iter = mg.begin<TElem>(); iter != mg.end<TElem>(); ++iter){
int status = ES_NONE;
#ifdef UG_PARALLEL
DistributedGridManager* distGridMgr = mg.distributed_grid_manager();
if(distGridMgr)
status = distGridMgr->get_status(*iter);
#endif
int index = siNormal;
if(status & ES_H_MASTER)
index |= siHMaster;
if(status & ES_H_SLAVE)
index |= siHSlave;
if(status & ES_V_MASTER)
index |= siVMaster;
if(status & ES_V_SLAVE)
index |= siVSlave;
sh.assign_subset(*iter, index);
}
}