本文整理汇总了C++中ProblemDomain::refine方法的典型用法代码示例。如果您正苦于以下问题:C++ ProblemDomain::refine方法的具体用法?C++ ProblemDomain::refine怎么用?C++ ProblemDomain::refine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProblemDomain
的用法示例。
在下文中一共展示了ProblemDomain::refine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dblBufFine
void
EBCoarseAverage::define(const DisjointBoxLayout& a_dblFine,
const DisjointBoxLayout& a_dblCoar,
const EBISLayout& a_ebislFine,
const EBISLayout& a_ebislCoar,
const ProblemDomain& a_domainCoar,
const int& a_nref,
const int& a_nvar,
const EBIndexSpace* ebisPtr)
{
CH_TIME("EBCoarseAverage::define");
CH_assert(ebisPtr->isDefined());
ProblemDomain domainFine = a_domainCoar;
domainFine.refine(a_nref);
EBLevelGrid eblgFine;
EBLevelGrid eblgCoar = EBLevelGrid(a_dblCoar, a_ebislCoar, a_domainCoar);
EBLevelGrid eblgCoFi;
//check to see if the input layout is coarsenable.
//if so, proceed with ordinary drill
//otherwise, see if the layout covers the domain.
//if it does, we can use domainsplit
if (a_dblFine.coarsenable(a_nref))
{
eblgFine = EBLevelGrid(a_dblFine, a_ebislFine, domainFine);
m_useFineBuffer = false;
}
else
{
Box fineDomBox = refine(a_domainCoar.domainBox(), a_nref);
int numPtsDom = fineDomBox.numPts();
//no need for gathers here because the meta data is global
int numPtsLayout = 0;
for (LayoutIterator lit = a_dblFine.layoutIterator(); lit.ok(); ++lit)
{
numPtsLayout += a_dblFine.get(lit()).numPts();
}
bool coveringDomain = (numPtsDom == numPtsLayout);
if (coveringDomain)
{
m_useFineBuffer = true;
int maxBoxSize = 4*a_nref;
Vector<Box> boxes;
Vector<int> procs;
domainSplit(fineDomBox, boxes, maxBoxSize);
mortonOrdering(boxes);
LoadBalance(procs, boxes);
DisjointBoxLayout dblBufFine(boxes, procs);
eblgFine = EBLevelGrid(dblBufFine, domainFine, 2, eblgCoar.getEBIS());
}
else
{
pout() << "EBCoarseAverage::input layout is not coarsenable and does not cover the domain--bailing out" << endl;
MayDay::Error();
}
}
coarsen(eblgCoFi, eblgFine, a_nref);
define(eblgFine, eblgCoar, eblgCoFi, a_nref, a_nvar);
}