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


C++ CH_TIME函数代码示例

本文整理汇总了C++中CH_TIME函数的典型用法代码示例。如果您正苦于以下问题:C++ CH_TIME函数的具体用法?C++ CH_TIME怎么用?C++ CH_TIME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: CH_TIME

//-----------------------------------------------------------------------
//  AMR Factory define function
void VCAMRPoissonOp2Factory::define(const ProblemDomain&                           a_coarseDomain,
                                   const Vector<DisjointBoxLayout>&               a_grids,
                                   const Vector<int>&                             a_refRatios,
                                   const Real&                                    a_coarsedx,
                                   BCHolder                                       a_bc,
                                   const Real&                                    a_alpha,
                                   Vector<RefCountedPtr<LevelData<FArrayBox> > >& a_aCoef,
                                   const Real&                                    a_beta,
                                   Vector<RefCountedPtr<LevelData<FluxBox> > >&   a_bCoef)
{
  CH_TIME("VCAMRPoissonOp2Factory::define");

  setDefaultValues();

  m_boxes = a_grids;

  m_refRatios = a_refRatios;

  m_bc = a_bc;

  m_dx.resize(a_grids.size());
  m_dx[0] = a_coarsedx;

  m_domains.resize(a_grids.size());
  m_domains[0] = a_coarseDomain;

  m_exchangeCopiers.resize(a_grids.size());
  m_exchangeCopiers[0].exchangeDefine(a_grids[0], IntVect::Unit);
  m_exchangeCopiers[0].trimEdges(a_grids[0], IntVect::Unit);

  m_cfregion.resize(a_grids.size());
  m_cfregion[0].define(a_grids[0], m_domains[0]);

  for (int i = 1; i < a_grids.size(); i++)
    {
      m_dx[i] = m_dx[i-1] / m_refRatios[i-1];

      m_domains[i] = m_domains[i-1];
      m_domains[i].refine(m_refRatios[i-1]);

      m_exchangeCopiers[i].exchangeDefine(a_grids[i], IntVect::Unit);
      m_exchangeCopiers[i].trimEdges(a_grids[i], IntVect::Unit);

      m_cfregion[i].define(a_grids[i], m_domains[i]);
    }

  m_alpha = a_alpha;
  m_aCoef = a_aCoef;

  m_beta  = a_beta;
  m_bCoef = a_bCoef;
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:54,代码来源:VCAMRPoissonOp2.cpp

示例2: setSolverParams

void
EBCompositeCCProjector::
setSolverParams(int  a_numSmooths,
                int  a_iterMax,
                int  a_mgcycle,
                Real a_hang,
                Real a_tolerance,
                int  a_verbosity,
                Real a_normThresh)
{
  CH_TIME("EBCompositeCCProjector::setSolverParams");
  m_macProjector->setSolverParams(a_numSmooths, a_iterMax, a_mgcycle, a_hang, a_tolerance,a_verbosity,a_normThresh);
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:13,代码来源:EBCompositeCCProjector.cpp

示例3: averageStressToFaces

void
EBCompositeCCProjector::
averageStressToFaces(Vector<LevelData<EBFluxFAB>* >&  a_macVeloc,
                     Vector<LevelData<EBCellFAB>* >&  a_velocity)
{
  CH_TIME("EBCompositeCCProjector::averageVelocityToFaces");
  //interpolate and then send stuff on through to level function
  int ncomp = a_velocity[0]->nComp();
  Interval interv(0, ncomp-1);
  Vector<LevelData<EBCellFAB> *> amrPhi = m_macProjector->getPhi();
  for (int ilev = 0; ilev < m_numLevels; ilev++)
    {
      if (ilev > 0)
        {
          //so it can be reused quadcfi is a one-variable animal
          //when we have ebalias, we can accomplish this without copies.
          //for now, tough luck
          //use phi for scratch space
          LevelData<EBCellFAB>& phiCoar = *amrPhi[ilev-1];
          LevelData<EBCellFAB>& phiFine = *amrPhi[ilev  ];
          for (int idir = 0; idir < ncomp; idir++)
            {
              Interval phiInterv(0, 0);
              Interval velInterv(idir, idir);
              a_velocity[ilev-1]->copyTo(velInterv, phiCoar, phiInterv);
              a_velocity[ilev  ]->copyTo(velInterv, phiFine, phiInterv);
              m_quadCFI[ilev]->interpolate(phiFine,
                                           phiCoar,
                                           phiInterv);

              //on copy back, we need ghost cells, so do the data iterator loop
              for (DataIterator dit = phiFine.dataIterator(); dit.ok(); ++dit)
                {
                  Box region = phiFine[dit()].getRegion(); //includes ghost cells
                  (*a_velocity[ilev])[dit()].copy(region, velInterv, region, phiFine[dit()], phiInterv);
                }

              EBLevelDataOps::setVal(phiFine, 0.0);
              EBLevelDataOps::setVal(phiCoar, 0.0);
            }
        }
      a_velocity[ilev]->exchange(interv);
      ccpAverageStressToFaces(*a_macVeloc[ilev],
                              *a_velocity[ilev],
                              m_eblg[ilev].getDBL(),
                              m_eblg[ilev].getEBISL(),
                              m_eblg[ilev].getDomain(),
                              m_dx[ilev],
                              *m_eblg[ilev].getCFIVS());
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:51,代码来源:EBCompositeCCProjector.cpp

示例4: CH_TIME

void NonAggregatedEBStencil::applyInhomDomBC(EBCellFAB&             a_lofphi,
                                             const EBCellFAB&       a_phi,
                                             const Real             a_factor) const

{
  CH_TIME("NonAggregatedEBStencil::applyInhomDomBC");
  for (int isrc = 0; isrc < m_srcVofs.size(); isrc++)
    {
      const VolIndex& vof = m_srcVofs[isrc];
      Real& lphi       = a_lofphi(vof, m_destVar);
      const Real& sour = a_phi(vof,0);
      lphi += a_factor*sour;
    }
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:14,代码来源:NonAggregatedEBStencil.cpp

示例5: advectToFacesBCG

void
EBLevelAdvect::
advectToFacesBCG(EBFluxFAB&                         a_extrapState,
                 BaseIVFAB<Real>&                   a_boundaryPrim,
                 const EBCellFAB &                  a_consState,
                 const EBCellFAB &                  a_normalVel,
                 const EBFluxFAB &                  a_advectionVel,
                 const Box&                         a_cellBox,
                 const EBISBox&                     a_ebisBox,
                 const Real&                        a_dt,
                 const Real&                        a_time,
                 const EBCellFAB &                  a_source,
                 const DataIndex&                   a_dit,
                 bool   a_doBoundaryPrim)
{
  CH_TIME("EBLevelAdvect::advectToFacesBCG (fluxfab)");
  IntVectSet cfivs; //not used here.  only used in flux interpolation
  m_ebPatchAdvect[a_dit]->setTimeAndDt(a_time, a_dt);
  // EBCellFAB& primState = m_ebPatchAdvect[a_dit]->getPrimState();
  m_ebPatchAdvect[a_dit]->setVelocities(a_normalVel, a_advectionVel);

  //placeholder (no flattening used here)
  EBCellFAB flattening;
  //not reused
  EBCellFAB  slopesPrim[SpaceDim];
  EBCellFAB  slopesSeco[SpaceDim];
  bool verbose = false;

  m_ebPatchAdvect[a_dit]->extrapolateBCG(a_extrapState,
                                         // primState,
                                         slopesPrim,
                                         slopesSeco,
                                         flattening,
                                         a_consState,
                                         a_source,
                                         a_cellBox,
                                         a_dit,
                                         verbose);

  if (a_doBoundaryPrim)
    {
      IntVectSet irregIVS = a_ebisBox.getIrregIVS(a_cellBox);
      m_ebPatchAdvect[a_dit]->computeEBIrregFlux(a_boundaryPrim,
                                                 // primState,
                                                 a_consState,
                                                 slopesPrim,
                                                 irregIVS,
                                                 a_source);
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:50,代码来源:EBLevelAdvect.cpp

示例6: CH_TIME

void
MappedLevelFluxRegister::setToZero()
{
    CH_TIME("MappedLevelFluxRegister::setToZero");
    if (m_isDefined & FluxRegCoarseDefined) {
        for (DataIterator d = m_coarFlux.dataIterator(); d.ok(); ++d) {
            m_coarFlux[d].setVal(0.0);
        }
    }
    if (m_isDefined & FluxRegFineDefined) {
        for (DataIterator d = m_fineFlux.dataIterator(); d.ok(); ++d) {
            m_fineFlux[d].setVal(0.0);
        }
    }
}
开发者ID:UNC-CFD,项目名称:somar,代码行数:15,代码来源:MappedLevelFluxRegister.cpp

示例7: EBStenVarCoef

EBStenVarCoef::
EBStenVarCoef(const Vector<VolIndex>& a_srcVofs,
              const BaseIVFAB<VoFStencil>& a_vofStencil,
              const Box& a_box,
              const EBISBox& a_ebisBox,
              const IntVect& a_ghostVect,
              int a_varDest)
  : m_box(       a_box       ),
    m_ebisBox(   a_ebisBox   ),
    m_ghostVect( a_ghostVect ),
    m_destVar(   a_varDest   )
{
  CH_TIME("EBStenVarCoef::EBStenVarCoef");
  computeOffsets(a_srcVofs, a_vofStencil);
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:15,代码来源:EBStenVarCoef.cpp

示例8: residual

void EBPoissonOp::
residual(LevelData<EBCellFAB>&       a_residual,
         const LevelData<EBCellFAB>& a_phi,
         const LevelData<EBCellFAB>& a_rhs,
         bool                        a_homogeneousPhysBC)
{
  CH_TIME("EBPoissonOp::residual");
  //this is a multigrid operator so only homogeneous CF BC
  //and null coar level
  CH_assert(a_residual.ghostVect() == m_ghostCellsRHS);
  CH_assert(a_phi.ghostVect() == m_ghostCellsPhi);
  DataIterator dit = a_residual.dataIterator();
  applyOp(a_residual,a_phi, a_homogeneousPhysBC, dit );
  axby(a_residual,a_residual,a_rhs,-1.0, 1.0);
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:15,代码来源:EBPoissonOp.cpp

示例9: enforceGradientBC

void
EBCompositeMACProjector::
enforceGradientBC(Vector<LevelData<EBFluxFAB>* >&       a_grad,
                  const Vector<LevelData<EBCellFAB>* >& a_phi)
{
  CH_TIME("EBCompositeMACProjector::enforceGradientBC");
  for (int ilev = 0; ilev < m_numLevels; ilev++)
    {
      EBLevelMACProjector::setCurLevel(ilev);
      macEnforceGradientBC(*a_grad[ilev],  *a_phi[ilev],
                           m_eblg[ilev].getDBL(), m_eblg[ilev].getEBISL(),
                           m_eblg[ilev].getDomain(),   m_dx[ilev],
                           m_origin,m_time,m_baseDomainBCFactPhi);
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:15,代码来源:EBCompositeMACProjector.cpp

示例10: correctVelocityComponent

void
EBCompositeMACProjector::
correctVelocityComponent(Vector<LayoutData< Vector< BaseIVFAB<Real> * > >* >      &  a_coveredVelLo,
                         Vector<LayoutData< Vector< BaseIVFAB<Real> * > >* >      &  a_coveredVelHi,
                         const Vector< LayoutData< Vector< Vector<VolIndex> > >* >&  a_coveredFaceLo,
                         const Vector< LayoutData< Vector< Vector<VolIndex> > >* >&  a_coveredFaceHi,
                         const Vector< LayoutData< Vector< IntVectSet > >* >      &  a_coveredSetsLo,
                         const Vector< LayoutData< Vector< IntVectSet > >* >      &  a_coveredSetsHi,
                         const Vector<LevelData<EBFluxFAB>* >                     &  a_macGradient,
                         int                                                         a_coveredFaceDir,
                         int                                                         a_velComp)
{
  CH_TIME("EBCompositeMACProjector::correctVelocityComponent");
  for (int ilev = 0; ilev < m_numLevels; ilev++)
    {
      for (SideIterator sit; sit.ok(); ++sit)
        {
          LayoutData<Vector<BaseIVFAB<Real>* > >*        velPtr = NULL;
          const LayoutData<Vector<Vector<VolIndex> > >* facePtr = NULL;
          const LayoutData<Vector<IntVectSet>  >*       setsPtr = NULL;
          if (sit() == Side::Lo)
            {
              velPtr  =  a_coveredVelLo[ilev];
              facePtr = a_coveredFaceLo[ilev];
              setsPtr = a_coveredSetsLo[ilev];
            }
          else
            {
              velPtr  =  a_coveredVelHi[ilev];
              facePtr = a_coveredFaceHi[ilev];
              setsPtr = a_coveredSetsHi[ilev];
            }

          const LevelData<EBFluxFAB>& macGradient = *a_macGradient[ilev];
          for (DataIterator dit = m_eblg[ilev].getDBL().dataIterator(); dit.ok(); ++dit)
            {
              const EBFluxFAB       & macGradFAB  = macGradient[dit()];
              const Vector<VolIndex>& coveredFace =  (*facePtr)[dit()][a_coveredFaceDir];
              const IntVectSet      & coveredSets =  (*setsPtr)[dit()][a_coveredFaceDir];
              BaseIVFAB<Real>       & coveredVel  = *((*velPtr)[dit()][a_coveredFaceDir]);
              const EBISBox& ebisBox = m_eblg[ilev].getEBISL()[dit()];

              correctVelocityComponent(coveredVel, coveredFace, coveredSets, macGradFAB, ebisBox,
                                       a_coveredFaceDir, sit(), a_velComp);
            }
        }
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:48,代码来源:EBCompositeMACProjector.cpp

示例11: fillLambda

void
EBGradDivFilter::
fillLambda()
{
  CH_TIME("EBGradDivFilter::fillLambda");
  Real lambdaVal = 1.0e10;
  for (int idir = 0; idir < SpaceDim; idir++)
    {
      Real lambdaDir  = m_lambdaScale*m_dxFine[idir]*m_dxFine[idir];
      lambdaVal = Min(lambdaVal, lambdaDir);
    }
  for (DataIterator dit = m_gridsFine.dataIterator(); dit.ok(); ++dit)
    {
      m_lambda[dit()].setVal(lambdaVal);
    }
}
开发者ID:siddarthc,项目名称:CHOMBO-EBAMRRANS,代码行数:16,代码来源:EBGradDivFilter.cpp

示例12: redistribute

void
EBCoarToFineRedist::
redistribute(LevelData<EBCellFAB>& a_fineSolution,
             const Interval& a_variables)
{
  CH_TIME("EBCoarToFineRedist::redistribute");
  //copy the buffer to the fine layout
  m_regsCoar.copyTo(a_variables, m_regsCedFine, a_variables);
  //redistribute the coarsened fine registers to the fine solution
  for (DataIterator dit = m_gridsFine.dataIterator(); dit.ok(); ++dit)
    {
      const BaseIVFAB<Real>& regCoar = m_regsCedFine[dit()];
      const IntVectSet& ivsCoar = m_setsCedFine[dit()];
      const EBISBox& ebisBoxCoar = m_ebislCedFine[dit()];
      const BaseIVFAB<VoFStencil>& stenFAB = m_stenCedFine[dit()];

      EBCellFAB& solFAB = a_fineSolution[dit()];

      for (VoFIterator vofitCoar(ivsCoar, ebisBoxCoar.getEBGraph());
          vofitCoar.ok(); ++vofitCoar)
        {
          const VolIndex& srcVoFCoar = vofitCoar();
          const VoFStencil& vofsten = stenFAB(srcVoFCoar, 0);
          for (int isten = 0; isten < vofsten.size(); isten++)
            {
              const Real& weight = vofsten.weight(isten);
              const VolIndex& dstVoFCoar = vofsten.vof(isten);
              Vector<VolIndex> vofsFine =
                m_ebislCedFine.refine(dstVoFCoar,m_refRat, dit());

              for (int ivar = a_variables.begin();
                  ivar <= a_variables.end();  ivar++)
                {
                  Real dmCoar = regCoar(srcVoFCoar, ivar);
                  for (int ifine = 0; ifine < vofsFine.size(); ifine++)
                    {

                      const VolIndex& dstVoFFine = vofsFine[ifine];
                      //ufine += (wcoar*dmCoar) (piecewise constant density diff)
                      Real dUFine = dmCoar*weight;
                      solFAB(dstVoFFine, ivar) += dUFine;
                    }
                }
            }
        }
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:47,代码来源:EBCoarToFineRedist.cpp

示例13: setToZero

void
EBCoarToFineRedist::
setToZero()
{
  CH_TIME("EBCoarToFineRedist::setToZero");
  for (DataIterator dit = m_gridsCedFine.dataIterator();
      dit.ok(); ++dit)
    {
      m_regsCedFine[dit()].setVal(0.0);
    }

  for (DataIterator dit = m_gridsCoar.dataIterator();
      dit.ok(); ++dit)
    {
      m_regsCoar[dit()].setVal(0.0);
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:17,代码来源:EBCoarToFineRedist.cpp

示例14: setToZero

void
EBFineToCoarRedist::
setToZero()
{
  CH_TIME("EBFineToCoarRedist::setToZero");
  for (DataIterator dit = m_gridsRefCoar.dataIterator();
      dit.ok(); ++dit)
    {
      m_regsRefCoar[dit()].setVal(0.0);
    }

  for (DataIterator dit = m_gridsFine.dataIterator();
      dit.ok(); ++dit)
    {
      m_regsFine[dit()].setVal(0.0);
    }
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:17,代码来源:EBFineToCoarRedist.cpp

示例15: CH_TIME

void
EBMGInterp::pwcInterpMG(LevelData<EBCellFAB>&       a_fineData,
                        const LevelData<EBCellFAB>& a_coarData,
                        const Interval&             a_variables)
{
  CH_TIME("EBMGInterp::pwcInterpMG");
  CH_assert(a_fineData.ghostVect() == m_ghost);
  CH_assert(a_coarData.ghostVect() == m_ghost);

  for (DataIterator dit = m_coarGrids.dataIterator(); dit.ok(); ++dit)
    {
      pwcInterpFAB(a_fineData[dit()],
                   m_coarGrids[dit()],
                   a_coarData[dit()],
                   dit(),
                   a_variables);
    }
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:18,代码来源:EBMGInterp.cpp


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