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


C++ EBIndexSpace::fillEBISLayout方法代码示例

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


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

示例1: do_geo

void do_geo(DisjointBoxLayout&              a_dbl,
            EBISLayout       &              a_ebisl,
            Box              &              a_domain,
            Real             &              a_dx )
{

  //define grids
  int len = 32;
  int mid = len/2;
  Real xdom = 1.0;
  a_dx = xdom/len;
  const IntVect hi = (len-1)*IntVect::Unit;
  a_domain=  Box(IntVect::Zero, hi);
  Vector<Box> boxes(4);
  Vector<int> procs(4);
  boxes[0] = Box(IntVect(D_DECL(0  ,  0,   0)), IntVect(D_DECL(mid-1, mid-1, len-1)));
  boxes[1] = Box(IntVect(D_DECL(0  ,mid,   0)), IntVect(D_DECL(mid-1, len-1, len-1)));
  boxes[2] = Box(IntVect(D_DECL(mid,  0,   0)), IntVect(D_DECL(len-1, mid-1, len-1)));
  boxes[3] = Box(IntVect(D_DECL(mid,mid,   0)), IntVect(D_DECL(len-1, len-1, len-1)));

  LoadBalance(procs, boxes);
  /**
  int loProc = 0;
  int hiProc = numProc() -1;
  procs[0] = loProc;
  procs[1] = hiProc;
  procs[2] = loProc;
  procs[3] = hiProc;
  **/

  a_dbl = DisjointBoxLayout(boxes, procs);

  //define geometry
  RealVect rampNormal = RealVect::Zero;
  rampNormal[0] = -0.5;
  rampNormal[1] = 0.866025404;

  Real rampAlpha = -0.0625;

  RealVect rampPoint = RealVect::Zero;
  rampPoint[0] = rampAlpha / rampNormal[0];

  bool inside = true;

  PlaneIF ramp(rampNormal,rampPoint,inside);

  RealVect vectDx = RealVect::Unit;
  vectDx *= a_dx;

  GeometryShop mygeom( ramp, 0, vectDx );
  RealVect origin = RealVect::Zero;

  EBIndexSpace *ebisPtr = Chombo_EBIS::instance();
  ebisPtr->define(a_domain, origin, a_dx, mygeom);

  //fill layout
  ebisPtr->fillEBISLayout(a_ebisl, a_dbl, a_domain, 4 );
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:58,代码来源:ldBaseIFFABTest.cpp

示例2: dbl

int
main(int argc, char** argv)
{
  //This test is an attempt to test linearization
  //of eb data holders directly

  int eekflag=0;
#ifdef CH_MPI
  MPI_Init(&argc, &argv);
#endif
  //begin forever present scoping trick
  {
    //registerDebugger();

    // Set up some geometry.
    Box domain;
    Real dx;

    do_geo( domain, dx );

    Vector<Box> boxes(1, domain);
    Vector<int> procs(1, 0);
    // Make a layout for the space.
    DisjointBoxLayout dbl(boxes, procs);

    // Fill in the layout with the geometrical info.
    EBISLayout ebisl;
    EBIndexSpace *ebisPtr = Chombo_EBIS::instance();
    ebisPtr->fillEBISLayout(ebisl, dbl, domain, 1 );

    // Define the leveldata for my one and only level.
    DataIterator dit = dbl.dataIterator();
    for ( dit.begin(); dit.ok(); ++dit )
      {
        eekflag = testIVFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "IVFAB linearization test failed " << endl;
            return eekflag;
          }
        eekflag = testIFFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "IFFAB  linearization test failed " << endl;
            return eekflag;
          }
        eekflag = testEBCellFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "EBCellFAB  linearization test failed " << endl;
            return eekflag;
          }
        eekflag = testEBFaceFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "EBFaceFAB  linearization test failed " << endl;
            return eekflag;
          }

        eekflag = testEBFluxFAB(ebisl[dit()], dbl.get(dit()));
        if (eekflag != 0)
          {
            pout() << "EBFluxFAB  linearization test failed " << endl;
            return eekflag;
          }
      }

    ebisPtr->clear();

  }//end scoping trick
  pout() << "linearization tests passed "<< endl;
#ifdef CH_MPI
  MPI_Finalize();
#endif
  return eekflag;
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:76,代码来源:linearizationTest.cpp


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