本文整理汇总了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);
}
示例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];
}
}
}
示例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());
}
示例4: create
void NewPoissonOp::create( FArrayBox& a_lhs, const FArrayBox& a_rhs)
{
a_lhs.define(a_rhs.box(), a_rhs.nComp());
}
示例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
{