本文整理汇总了C++中DisjointBoxLayout::procID方法的典型用法代码示例。如果您正苦于以下问题:C++ DisjointBoxLayout::procID方法的具体用法?C++ DisjointBoxLayout::procID怎么用?C++ DisjointBoxLayout::procID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisjointBoxLayout
的用法示例。
在下文中一共展示了DisjointBoxLayout::procID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testBox
// new define
void
LevelFluxRegisterEdge::define(
const DisjointBoxLayout& a_dbl,
const DisjointBoxLayout& a_dblCoarse,
const ProblemDomain& a_dProblem,
int a_nRefine,
int a_nComp)
{
m_isDefined = true;
CH_assert(a_nRefine > 0);
CH_assert(a_nComp > 0);
CH_assert(!a_dProblem.isEmpty());
m_nComp = a_nComp;
m_nRefine = a_nRefine;
m_domainCoarse = coarsen(a_dProblem, a_nRefine);
CH_assert (a_dblCoarse.checkPeriodic(m_domainCoarse));
// allocate copiers
m_crseCopiers.resize(SpaceDim*2);
SideIterator side;
// create a Vector<Box> of the fine boxes which also includes periodic images,
// since we don't really care about the processor layouts, etc
Vector<Box> periodicFineBoxes;
CFStencil::buildPeriodicVector(periodicFineBoxes, a_dProblem, a_dbl);
// now coarsen these boxes...
for (int i=0; i<periodicFineBoxes.size(); i++)
{
periodicFineBoxes[i].coarsen(m_nRefine);
}
for (int idir=0 ; idir<SpaceDim; ++idir)
{
for (side.begin(); side.ok(); ++side)
{
// step one, build fineBoxes, flux register boxes
// indexed by the fine level but in the coarse index
// space
DisjointBoxLayout fineBoxes,tmp;
// first create coarsened dbl, then compute flux register boxes
// adjacent to coarsened fine boxes
coarsen(tmp, a_dbl, m_nRefine);
if (side() == Side::Lo)
{
adjCellLo(fineBoxes, tmp, idir,1);
}
else
{
adjCellHi(fineBoxes, tmp, idir,1);
}
// now define the FluxBoxes of fabFine on this DisjointBoxLayout
m_fabFine[index(idir, side())].define(fineBoxes, a_nComp);
LayoutData<Vector<Vector<IntVectSet> > >& ivsetsVect
= m_refluxLocations[index(idir, side())];
ivsetsVect.define(a_dblCoarse);
LayoutData<Vector<DataIndex> >& mapsV =
m_coarToCoarMap[index(idir, side())];
mapsV.define(a_dblCoarse);
DisjointBoxLayout coarseBoxes = a_dblCoarse;
DataIterator dit = a_dblCoarse.dataIterator();
for (dit.begin(); dit.ok(); ++dit)
{
unsigned int thisproc = a_dblCoarse.procID(dit());
if (thisproc == procID())
{
ivsetsVect[DataIndex(dit())].resize(SpaceDim);
}
const Box& coarseBox = a_dblCoarse[dit()];
int count = 0;
for (int i=0; i<periodicFineBoxes.size(); i++)
{
Box regBox;
if (side() == Side::Lo)
{
regBox = adjCellLo(periodicFineBoxes[i], idir, 1);
}
else
{
regBox = adjCellHi(periodicFineBoxes[i], idir, 1);
}
// do this little dance in order to ensure that
// we catch corner cells which might be in different
// boxes.
Box testBox(regBox);
testBox.grow(1);
testBox.grow(idir,-1);
if (testBox.intersectsNotEmpty(coarseBox))
{
testBox &= coarseBox;
++count;
unsigned int proc = a_dblCoarse.procID(dit());
//.........这里部分代码省略.........