| 1714 | } |
| 1715 | |
| 1716 | BoxArray |
| 1717 | intersect (const BoxArray& ba, |
| 1718 | const Box& b, |
| 1719 | int ng) |
| 1720 | { |
| 1721 | std::vector< std::pair<int,Box> > isects; |
| 1722 | |
| 1723 | ba.intersections(b,isects,false,IntVect(ng)); |
| 1724 | |
| 1725 | const int N = static_cast<int>(isects.size()); |
| 1726 | |
| 1727 | BoxArray r(N); |
| 1728 | |
| 1729 | if (N > 0) { |
| 1730 | #ifdef AMREX_USE_OMP |
| 1731 | #pragma omp parallel for |
| 1732 | #endif |
| 1733 | for (int i = 0; i < N; i++) |
| 1734 | { |
| 1735 | r.set(i, isects[i].second); |
| 1736 | } |
| 1737 | } |
| 1738 | |
| 1739 | return r; |
| 1740 | } |
| 1741 | |
| 1742 | BoxArray |
| 1743 | intersect (const BoxArray& ba, |