void Box::next (IntVect& p, const int* shv) const { BL_ASSERT(contains(p)); #if BL_SPACEDIM==1 p.shift(0,shv[0]); #elif BL_SPACEDIM==2 p.shift(0,shv[0]); if (!(p <= bigend)) { // // Reset 1 coord is on edge, and 2 coord is incremented. // p.setVal(0,smallend[0]); p.shift(1,shv[1]); } #elif BL_SPACEDIM==3 p.shift(0,shv[0]); if (!(p <= bigend)) { // // Reset 1 coord is on edge, and 2 coord is incremented. // p.setVal(0,smallend[0]); p.shift(1,shv[1]); if(!(p <= bigend)) { p.setVal(1,smallend[1]); p.shift(2,shv[2]); } } #endif }
void Box::next (IntVect& p) const { BL_ASSERT(contains(p)); p.shift(0,1); #if BL_SPACEDIM==2 if (!(p <= bigend)) { p.setVal(0,smallend[0]); p.shift(1,1); } #elif BL_SPACEDIM==3 if (!(p <= bigend)) { p.setVal(0,smallend[0]); p.shift(1,1); if (!(p <= bigend)) { p.setVal(1,smallend[1]); p.shift(2,1); } } #endif }
bool RSIBC::tagCellsInit(FArrayBox& markFAB,const Real& threshold) { // If grid spacing > R0 refine otherwise only refine the nucleation patch if(m_dx > m_R0) { // pout() << m_dx << " " << m_R0 << endl; markFAB.setVal(1,bdryLo(m_domain.domainBox(),1,1) & markFAB.box(),0); } else { IntVect nucSm; IntVect nucBg; if(SpaceDim > 0) { nucSm.setVal(0,floor(m_x0/m_dx)); nucBg.setVal(0, ceil(m_x0/m_dx)); } if(SpaceDim > 1) { nucSm.setVal(1,0); nucBg.setVal(1,0); } if(SpaceDim > 2) { nucSm.setVal(2,floor(m_x0/m_dx)); nucBg.setVal(2, ceil(m_x0/m_dx)); } markFAB.setVal(1,Box(nucSm,nucBg)& markFAB.box(),0); } // pout() << m_domain << endl; // FORT_ALLBOUNDREFINE( // CHF_FRA1(markFAB,0), // CHF_CONST_REAL(threshold), // CHF_BOX(markFAB.box())); return true; }
bool SWIBC::tagCellsInit(FArrayBox& markFAB,const Real& threshold) { // We do this here becauase we need m_dx to be set, and it isn't set when // the object is defined if(!m_isPatchBoxSet) { m_patchBoxes.resize(m_numPatches); // Loop over all the patches and figure out the boxes for(int itor = 0; itor < m_numPatches; itor ++) { IntVect nucSm; IntVect nucBg; int offSet = 0; if(SpaceDim > 0) { nucSm.setVal(0,floor((m_fricBoxCenter[0]+m_xcPatches[itor]-m_xwPatches[itor])/m_dx)); nucBg.setVal(0, ceil((m_fricBoxCenter[0]+m_xcPatches[itor]+m_xwPatches[itor])/m_dx)); } if(SpaceDim > 1) { nucSm.setVal(1,0); nucBg.setVal(1,0); } if(SpaceDim > 2) { nucSm.setVal(2,floor((m_fricBoxCenter[1]+m_zcPatches[itor]-m_zwPatches[itor])/m_dx)); nucBg.setVal(2, ceil((m_fricBoxCenter[1]+m_zcPatches[itor]+m_zwPatches[itor])/m_dx)); } m_patchBoxes[itor] = Box(nucSm,nucBg); m_smoothWidthNumCells = ceil(m_smoothValue / m_dx / 2); m_isPatchBoxSet = true; } } for(int itor = 0; itor < m_numPatches; itor ++) { markFAB.setVal(1,m_patchBoxes[itor] & markFAB.box(),0); } // markFAB.setVal(1,markFAB.box(),0); // for(int itor = 0; itor < m_patchBoxes.capacity(); itor++) // { // markFAB.setVal(1,adjCellLo(m_patchBoxes[itor],0, m_smoothWidthNumCells) & markFAB.box(),0); // markFAB.setVal(1,adjCellHi(m_patchBoxes[itor],0, m_smoothWidthNumCells) & markFAB.box(),0); // markFAB.setVal(1,adjCellLo(m_patchBoxes[itor],0,-m_smoothWidthNumCells) & markFAB.box(),0); // markFAB.setVal(1,adjCellHi(m_patchBoxes[itor],0,-m_smoothWidthNumCells) & markFAB.box(),0); // if(SpaceDim > 2) // { // markFAB.setVal(1,adjCellLo(m_patchBoxes[itor],2, m_smoothWidthNumCells) & markFAB.box(),0); // markFAB.setVal(1,adjCellHi(m_patchBoxes[itor],2, m_smoothWidthNumCells) & markFAB.box(),0); // markFAB.setVal(1,adjCellLo(m_patchBoxes[itor],2,-m_smoothWidthNumCells) & markFAB.box(),0); // markFAB.setVal(1,adjCellHi(m_patchBoxes[itor],2,-m_smoothWidthNumCells) & markFAB.box(),0); // } // } // FORT_BOUNDREFINE( // CHF_FRA1(markFAB,0), // CHF_CONST_REAL(refLocation), // CHF_CONST_REAL(m_dx), // CHF_BOX(b)); return true; }