本文整理汇总了C++中FArrayBox::divide方法的典型用法代码示例。如果您正苦于以下问题:C++ FArrayBox::divide方法的具体用法?C++ FArrayBox::divide怎么用?C++ FArrayBox::divide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FArrayBox
的用法示例。
在下文中一共展示了FArrayBox::divide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSolution
/* ********************************************************************* */
void PatchPluto::updateSolution(FArrayBox& a_U,
FArrayBox& a_Utmp,
const FArrayBox& a_dV,
FArrayBox& split_tags,
BaseFab<unsigned char>& a_Flags,
FluxBox& a_F,
Time_Step *Dts,
const Box& UBox,
Grid *grid)
/*
*
*
*
*
*********************************************************************** */
{
CH_assert(isDefined());
CH_assert(UBox == m_currentBox);
int nv, in;
int nxf, nyf, nzf, indf;
int nxb, nyb, nzb;
int *i, *j, *k;
int ii, jj, kk;
double ***UU[NVAR];
double *inv_dl, dl2, cylr;
static Data d;
#ifdef SKIP_SPLIT_CELLS
double ***splitcells;
#endif
#if (PARABOLIC_FLUX & EXPLICIT)
static double **dcoeff;
#endif
Index indx;
static State_1D state;
Riemann_Solver *Riemann;
Riemann = rsolver;
#if TIME_STEPPING == RK2
double wflux = 0.5;
#else
double wflux = 1.;
#endif
/* -----------------------------------------------------------------
Check algorithm compatibilities
----------------------------------------------------------------- */
if (NX1_TOT > NMAX_POINT || NX2_TOT > NMAX_POINT || NX3_TOT > NMAX_POINT){
print ("!updateSolution (Euler): need to re-allocate matrix\n");
QUIT_PLUTO(1);
}
/* -----------------------------------------------------------------
Allocate memory
----------------------------------------------------------------- */
#if GEOMETRY != CARTESIAN
for (nv = 0; nv < NVAR; nv++) a_U.divide(a_dV,0,nv);
#if CHOMBO_CONS_AM == YES
#if ROTATING_FRAME == YES
Box curBox = a_U.box();
for(BoxIterator bit(curBox); bit.ok(); ++bit) {
const IntVect& iv = bit();
a_U(iv,iMPHI) /= a_dV(iv,1);
a_U(iv,iMPHI) -= a_U(iv,RHO)*a_dV(iv,1)*g_OmegaZ;
}
#else
a_U.divide(a_dV,1,iMPHI);
#endif
#endif
#else
if (g_stretch_fact != 1.) a_U /= g_stretch_fact;
#endif
for (nv = 0; nv < NVAR; nv++){
UU[nv] = ArrayMap(NX3_TOT, NX2_TOT, NX1_TOT, a_U.dataPtr(nv));
}
#ifdef SKIP_SPLIT_CELLS
splitcells = ArrayBoxMap(KBEG, KEND, JBEG, JEND, IBEG, IEND,
split_tags.dataPtr(0));
#endif
#if (TIME_STEPPING == RK2)
d.flag = ArrayCharMap(NX3_TOT, NX2_TOT, NX1_TOT,a_Flags.dataPtr(0));
#endif
#if RESISTIVE_MHD != NO
if (d.J == NULL) d.J = ARRAY_4D(3,NX3_MAX, NX2_MAX, NX1_MAX, double);
#endif
/* -----------------------------------------------------------
Allocate static memory areas
----------------------------------------------------------- */
if (state.flux == NULL){
MakeState (&state);
//.........这里部分代码省略.........