当前位置: 首页>>代码示例>>C++>>正文


C++ DisjointBoxLayout::size方法代码示例

本文整理汇总了C++中DisjointBoxLayout::size方法的典型用法代码示例。如果您正苦于以下问题:C++ DisjointBoxLayout::size方法的具体用法?C++ DisjointBoxLayout::size怎么用?C++ DisjointBoxLayout::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DisjointBoxLayout的用法示例。


在下文中一共展示了DisjointBoxLayout::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: coarsen

// ---------------------------------------------------------
void
NodeCoarseAverage::define(const DisjointBoxLayout& a_gridsFine,
                          const DisjointBoxLayout& a_gridsCoarse,
                          int a_numcomps,
                          int a_refRatio,
                          const ProblemDomain& a_domainFine)
{
  m_refRatio = a_refRatio;
  m_numcomps = a_numcomps;
  m_domainCoarse = coarsen(a_domainFine, m_refRatio);

  // DisjointBoxLayout::coarsen()
  coarsen(m_coarsenedGrids, a_gridsFine, m_refRatio);
  m_coarsenedFine.define(m_coarsenedGrids, m_numcomps);

  IntVect extent = (a_refRatio/2) * IntVect::Unit;
  m_refbox = Box(-extent, extent);
  m_weights.define(m_refbox, 1);
  FORT_NODEAVERAGE_GETWEIGHTS(CHF_FRA(m_weights),
                              CHF_CONST_INT(m_refRatio));

  if (m_verbose)
    cout << "IBN NodeCoarseAverage on "
         << m_domainCoarse.domainBox().size()
         << ", from "
         << m_coarsenedGrids.size() << " coarsened grids to "
         << a_gridsCoarse.size() << " coarser-level grids on "
         << m_domainCoarse.domainBox().size()
         << endl;

  interiorBoundaryNodes(m_IVSV, a_gridsCoarse, m_coarsenedGrids, m_domainCoarse);

  if (m_verbose)
    cout << "IBN NodeCoarseAverage on "
         << m_domainCoarse.domainBox().size()
         << ", from "
         << m_coarsenedGrids.size() << " coarsened grids to selves on "
         << m_domainCoarse.domainBox().size()
         << endl;

  interiorBoundaryNodes(m_IVSVsame, m_coarsenedGrids, m_domainCoarse);

  // m_IVSVfull added by petermc, 21 Jul 2003
  fullIntVectSets(m_IVSVfull, m_IVSVsame);

  m_sameGrids = false;
  is_defined = true;
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:49,代码来源:NodeCoarseAverage.cpp

示例2: buildPeriodicVector

void CFStencil::buildPeriodicVector(Vector<Box>& a_periodicVector,
                                    const ProblemDomain& a_fineDomain,
                                    const DisjointBoxLayout& a_fineBoxes)
{
  Box periodicTestBox(a_fineDomain.domainBox());
  if (a_fineDomain.isPeriodic())
    {
      for (int idir=0; idir<SpaceDim; idir++)
        {
          if (a_fineDomain.isPeriodic(idir))
            {
              periodicTestBox.grow(idir,-1);
            }
        }
    }
  a_periodicVector.clear();
  a_periodicVector.reserve(a_fineBoxes.size());

  LayoutIterator lit = a_fineBoxes.layoutIterator();
  for (lit.reset(); lit.ok(); ++lit)
    {
      const Box& box = a_fineBoxes[lit()];
      a_periodicVector.push_back(box);
      // if periodic, also need to add periodic images
      // only do this IF we're periodic and box
      // adjacent to  the domain box boundary somewhere
      if (a_fineDomain.isPeriodic()
          && !periodicTestBox.contains(box))
        {
          ShiftIterator shiftIt = a_fineDomain.shiftIterator();
          IntVect shiftMult(a_fineDomain.domainBox().size());
          Box shiftedBox(box);
          for (shiftIt.begin(); shiftIt.ok(); ++shiftIt)
            {
              IntVect shiftVect = shiftMult*shiftIt();
              shiftedBox.shift(shiftVect);
              a_periodicVector.push_back(shiftedBox);
              shiftedBox.shift(-shiftVect);
            } // end loop over periodic shift directions
        } // end if periodic
    }
  a_periodicVector.sort();
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:43,代码来源:CFStencil.cpp


注:本文中的DisjointBoxLayout::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。