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


C++ FArrayBox::define方法代码示例

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


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

示例1: coarsen

void NewPoissonOp::
createCoarsened(FArrayBox&                  a_lhs,
                const FArrayBox&            a_rhs,
                const int &                 a_refRat)
{
  int ncomp = a_rhs.nComp();
  //fill ebislayout
  Box coarsenedBox = coarsen(a_rhs.box(), a_refRat);
  a_lhs.define(coarsenedBox, ncomp);
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:10,代码来源:NewPoissonOp.cpp

示例2: box

void
getUnitSquareGrid(const int  a_n_radial,
                  const int  a_n_poloidal,
                  FArrayBox& a_xi)
{
   Box box(IntVect::Zero, IntVect(a_n_radial,a_n_poloidal));
   RealVect dx(1./a_n_radial,1./a_n_poloidal);

   a_xi.define(box,2);

   for (BoxIterator bit(box);bit.ok();++bit) {
      IntVect iv = bit();
      for (int dir=0; dir<SpaceDim; ++dir) {
         a_xi(iv,dir) = iv[dir]*dx[dir];
      }
   }
}
开发者ID:LLNL,项目名称:COGENT,代码行数:17,代码来源:magGeomData.cpp

示例3: createCoarser

void NewPoissonOp::createCoarser(FArrayBox& a_coarse,
                                 const FArrayBox& a_fine,
                                 bool ghosted)
{
  Box c = a_fine.box();
  if (ghosted)
    {
      c.grow(-1);
    }
  c.coarsen(2);
  c.refine(2);
  if (ghosted) c.grow(1);
  CH_assert(c == a_fine.box());
  if (ghosted) c.grow(-1);
  c.coarsen(2);
  if (ghosted)
    {
      c.grow(1);
    }
  a_coarse.define(c, a_fine.nComp());

}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:22,代码来源:NewPoissonOp.cpp

示例4: create

void NewPoissonOp::create(    FArrayBox& a_lhs, const FArrayBox& a_rhs)
{
  a_lhs.define(a_rhs.box(), a_rhs.nComp());
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:4,代码来源:NewPoissonOp.cpp

示例5: computeWHalf


//.........这里部分代码省略.........

  // Compute flattening once for all slopes if needed
  FArrayBox flattening(slopeBox, 1); // cell-centered
  if (m_useFlattening)
    {
      Interval velInt    = m_gdnvPhysics->velocityInterval();
      int pressureIndex  = m_gdnvPhysics->pressureIndex();
      Real smallPressure = m_gdnvPhysics->smallPressure();
      int bulkIndex      = m_gdnvPhysics->bulkModulusIndex();

      m_util.computeFlattening(flattening,
                               W,
                               velInt,
                               pressureIndex,
                               smallPressure,
                               bulkIndex,
                               slopeBox);
    }

  // Intermediate, extrapolated primitive variables
  FArrayBox WMinus[SpaceDim];
  FArrayBox WPlus [SpaceDim];

  // Initial fluxes
  FArrayBox WHalf1[SpaceDim];

  // Source term computed from current state
  FArrayBox localSource;

  // If the source term is valid, make a local copy, increment it, and scale
  // it by 1/2 the timestep
  if (!a_S.box().isEmpty())
    {
      localSource.define(a_S.box(), a_S.nComp());
      localSource.copy(a_S);

      m_gdnvPhysics->incrementSource(localSource,W,slopeBox);

      localSource *= 0.5 * a_dt;
    }

  // Compute initial fluxes
  for (int dir1 = 0; dir1 < SpaceDim; dir1++)
    {
      // Size the intermediate, extrapolated primitive variables
      WMinus[dir1].resize(slopeBox,numPrim); // cell-centered
      WPlus [dir1].resize(slopeBox,numPrim); // cell-centered

      // Compute predictor step to obtain extrapolated primitive variables
      if (m_normalPredOrder == 0)
        {
          CTUNormalPred(WMinus[dir1],WPlus[dir1],a_dt,m_dx,W,
                        flattening,dir1,slopeBox);
        }
      else if (m_normalPredOrder == 1)
        {
          PLMNormalPred(WMinus[dir1],WPlus[dir1],a_dt,m_dx,W,
                        flattening,dir1,slopeBox);
        }
      else if (m_normalPredOrder == 2)
        {
          PPMNormalPred(WMinus[dir1],WPlus[dir1],a_dt,m_dx,W,
                        flattening,dir1,slopeBox);
        }
      else
        {
开发者ID:rsnemmen,项目名称:Chombo,代码行数:67,代码来源:PatchGodunov.cpp


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