本文整理汇总了C++中EBISBox::getVoFs方法的典型用法代码示例。如果您正苦于以下问题:C++ EBISBox::getVoFs方法的具体用法?C++ EBISBox::getVoFs怎么用?C++ EBISBox::getVoFs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EBISBox
的用法示例。
在下文中一共展示了EBISBox::getVoFs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: velSave
void
EBCompositeMACProjector::
correctTangentialVelocity(EBFaceFAB& a_velocity,
const EBFaceFAB& a_gradient,
const Box& a_grid,
const EBISBox& a_ebisBox,
const IntVectSet& a_cfivs)
{
CH_TIME("EBCompositeMACProjector::correctTangentialVelocity");
int velDir = a_velocity.direction();
int gradDir = a_gradient.direction();
//veldir is the face on which the velocity lives
//graddir is the direction of the component
//and the face on which the mac gradient lives
CH_assert(velDir != gradDir);
CH_assert(a_velocity.nComp() == 1);
CH_assert(a_gradient.nComp() == 1);
//updating in place in fortran so we have to save a acopy
EBFaceFAB velSave(a_ebisBox, a_velocity.getCellRegion(), velDir, 1);
velSave.copy(a_velocity);
//interior box is the box where all of the stencil can be reached
//without going out of the domain
ProblemDomain domainBox = a_ebisBox.getDomain();
Box interiorBox = a_grid;
interiorBox.grow(1);
interiorBox &= domainBox;
interiorBox.grow(-1);
Box interiorFaceBox = surroundingNodes(interiorBox, velDir);
if (!interiorBox.isEmpty())
{
BaseFab<Real>& regVel = a_velocity.getSingleValuedFAB();
const BaseFab<Real>& regGrad = a_gradient.getSingleValuedFAB();
FORT_REGCORRECTTANVEL(CHF_FRA1(regVel,0),
CHF_CONST_FRA1(regGrad,0),
CHF_BOX(interiorFaceBox),
CHF_INT(velDir),
CHF_INT(gradDir));
}
//do only irregular and boundary cells pointwise
IntVectSet ivsIrreg = a_ebisBox.getIrregIVS(a_grid);
IntVectSet ivsGrid(a_grid);
ivsGrid -= interiorBox;
ivsGrid |= ivsIrreg;
FaceIterator faceit(ivsGrid, a_ebisBox.getEBGraph(), velDir, FaceStop::SurroundingWithBoundary);
for (faceit.reset(); faceit.ok(); ++faceit)
{
//average neighboring grads in grad dir direction
int numGrads = 0;
Real gradAve = 0.0;
const FaceIndex& velFace = faceit();
for (SideIterator sitVel; sitVel.ok(); ++sitVel)
{
const VolIndex& vofSide = velFace.getVoF(sitVel());
const IntVect& ivSide = vofSide.gridIndex();
//do not include stuff over coarse-fine interface and inside the domain
//cfivs includes cells just outside domain
if (!a_cfivs.contains(ivSide) && domainBox.contains(ivSide))
{
for (SideIterator sitGrad; sitGrad.ok(); ++sitGrad)
{
Vector<FaceIndex> gradFaces = a_ebisBox.getFaces(vofSide, gradDir, sitGrad());
for (int iface = 0; iface < gradFaces.size(); iface++)
{
if (!gradFaces[iface].isBoundary())
{
numGrads++;
gradAve += a_gradient(gradFaces[iface], 0);
}
}
}//end loop over gradient sides
}//end cfivs check
else
{
// inside coarse/fine interface or at domain boundary. extrapolate from neighboring vofs to get the gradient
const Side::LoHiSide inSide = flip(sitVel());
const VolIndex& inSideVof = velFace.getVoF(inSide);
const IntVect& inSideIV = inSideVof.gridIndex();
IntVect inSideFarIV = inSideIV;
inSideFarIV[velDir] += sign(inSide);
if (domainBox.contains(inSideIV) && domainBox.contains(inSideFarIV))
{
Vector<VolIndex> farVofs = a_ebisBox.getVoFs(inSideFarIV);
if (farVofs.size() == 1)
{
const VolIndex& inSideFarVof = farVofs[0];
for (SideIterator sitGrad; sitGrad.ok(); ++sitGrad)
{
//get the grad for the face adjoining inSideVof on the sitGrad side, in the gradDir direction
Vector<FaceIndex> gradFaces = a_ebisBox.getFaces(inSideVof , gradDir, sitGrad());
Vector<FaceIndex> gradFarFaces = a_ebisBox.getFaces(inSideFarVof, gradDir, sitGrad());
if ( (gradFaces.size() == 1) && (gradFarFaces.size() == 1) )
{
// if ( (!gradFaces[0].isBoundary()) && (!gradFarFaces[0].isBoundary()) )
// {
const Real& inSideGrad = a_gradient(gradFaces[0], 0);
//.........这里部分代码省略.........