本文整理汇总了C++中Geometry::FillPeriodicBoundary方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::FillPeriodicBoundary方法的具体用法?C++ Geometry::FillPeriodicBoundary怎么用?C++ Geometry::FillPeriodicBoundary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry::FillPeriodicBoundary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fill_boundary
void fill_boundary(MultiFab& mf, int scomp, int ncomp, const Geometry& geom, bool cross)
{
if (mf.nGrow() <= 0) return;
bool local = false; // Don't think we ever want it to be true.
mf.FillBoundary(scomp, ncomp, local, cross);
bool do_corners = !cross;
geom.FillPeriodicBoundary(mf, scomp, ncomp, do_corners, local);
}
示例2: advance
static
void advance (MultiFab* old_phi, MultiFab* new_phi, MultiFab* flux, Real* dx, Real dt, Geometry geom)
{
// Fill the ghost cells of each grid from the other grids
old_phi->FillBoundary();
// Fill periodic boundary ghost cells
geom.FillPeriodicBoundary(*old_phi);
int Ncomp = old_phi->nComp();
int ng_p = old_phi->nGrow();
int ng_f = flux->nGrow();
// Compute fluxes one grid at a time
for ( MFIter mfi(*old_phi); mfi.isValid(); ++mfi )
{
const Box& bx = mfi.validbox();
FORT_COMPUTE_FLUX((*old_phi)[mfi].dataPtr(),
&ng_p,
flux[0][mfi].dataPtr(),
flux[1][mfi].dataPtr(),
#if (BL_SPACEDIM == 3)
flux[2][mfi].dataPtr(),
#endif
&ng_f, bx.loVect(), bx.hiVect(), &(dx[0]));
}
// Advance the solution one grid at a time
for ( MFIter mfi(*old_phi); mfi.isValid(); ++mfi )
{
const Box& bx = mfi.validbox();
FORT_UPDATE_PHI((*old_phi)[mfi].dataPtr(),
(*new_phi)[mfi].dataPtr(),
&ng_p,
flux[0][mfi].dataPtr(),
flux[1][mfi].dataPtr(),
#if (BL_SPACEDIM == 3)
flux[2][mfi].dataPtr(),
#endif
&ng_f, bx.loVect(), bx.hiVect(), &(dx[0]) , &dt);
}
}