const IntVect BoxLib::coarsen (const IntVect& p1, const IntVect& p2) { IntVect v = p1; return v.coarsen(p2); }
const IntVect BoxLib::coarsen (const IntVect& p, int s) { BL_ASSERT(s > 0); IntVect v = p; return v.coarsen(IntVect(D_DECL(s,s,s))); }
void DenseIntVectSet::refine(int iref) { if (iref == 1) return; if (isEmpty()) return; CH_assert(iref >= 1); //int refinements = iref/2; CH_assert((iref/2)*2 == iref); // check iref for power of 2 Box newDomain(m_domain); newDomain.refine(iref); DenseIntVectSet newSet(newDomain, false); IntVect iv; BoxIterator bit(newDomain); int count=0; for (bit.begin(); bit.ok(); ++bit, ++count) { iv = bit(); iv.coarsen(iref); if (this->operator[](iv)) { newSet.m_bits.setTrue(count); } } *this = newSet; }