本文整理汇总了C++中MultiFab::is_nodal方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiFab::is_nodal方法的具体用法?C++ MultiFab::is_nodal怎么用?C++ MultiFab::is_nodal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiFab
的用法示例。
在下文中一共展示了MultiFab::is_nodal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: average_down
void average_down (MultiFab& S_fine, MultiFab& S_crse, const Geometry& fgeom, const Geometry& cgeom,
int scomp, int ncomp, const IntVect& ratio)
{
if (S_fine.is_nodal() || S_crse.is_nodal())
{
BoxLib::Error("Can't use BoxLib::average_down for nodal MultiFab!");
}
#if (BL_SPACEDIM == 3)
BoxLib::average_down(S_fine, S_crse, scomp, ncomp, ratio);
return;
#else
BL_ASSERT(S_crse.nComp() == S_fine.nComp());
//
// Coarsen() the fine stuff on processors owning the fine data.
//
const BoxArray& fine_BA = S_fine.boxArray();
BoxArray crse_S_fine_BA = fine_BA;
crse_S_fine_BA.coarsen(ratio);
MultiFab crse_S_fine(crse_S_fine_BA,ncomp,0);
MultiFab fvolume;
fgeom.GetVolume(fvolume, fine_BA, 0);
#ifdef _OPENMP
#pragma omp parallel
#endif
for (MFIter mfi(crse_S_fine,true); mfi.isValid(); ++mfi)
{
// NOTE: The tilebox is defined at the coarse level.
const Box& tbx = mfi.tilebox();
// NOTE: We copy from component scomp of the fine fab into component 0 of the crse fab
// because the crse fab is a temporary which was made starting at comp 0, it is
// not part of the actual crse multifab which came in.
BL_FORT_PROC_CALL(BL_AVGDOWN_WITH_VOL,bl_avgdown_with_vol)
(tbx.loVect(), tbx.hiVect(),
BL_TO_FORTRAN_N(S_fine[mfi],scomp),
BL_TO_FORTRAN_N(crse_S_fine[mfi],0),
BL_TO_FORTRAN(fvolume[mfi]),
ratio.getVect(),&ncomp);
}
S_crse.copy(crse_S_fine,0,scomp,ncomp);
#endif
}