Exemple #1
0
void MultiDataDistribution2D::addBlock(int x0, int x1, int y0, int y1, int envelopeWidth, int procId) {
    OLB_PRECONDITION( x0>=0 && y0>=0 );
    OLB_PRECONDITION( x1<nx && y1<ny );
    OLB_PRECONDITION( x0 <= x1 && y0 <= y1 );

    BlockParameters2D newBlock(x0, x1, y0, y1, envelopeWidth, procId,
                               x0==0, x1==nx-1, y0==0, y1==ny-1);
    computeNormalOverlaps(newBlock);
    blocks.push_back(newBlock);
    computePeriodicOverlaps();
}
void LocalMultiBlockInfo3D::computeAllPeriodicOverlaps (
        SparseBlockStructure3D const& sparseBlock )
{
    for (pluint iBlock=0; iBlock<myBlocks.size(); ++iBlock) {
        plint blockId = myBlocks[iBlock];
        Box3D bulk;
        sparseBlock.getBulk(blockId, bulk);
        // Speed optimization: execute the test for periodicity
        //   only for bulk-domains which touch the bounding box.
        if (!contained (
                    bulk.enlarge(1), sparseBlock.getBoundingBox() ) )
        {
            computePeriodicOverlaps(sparseBlock, blockId);
        }
    }
}