| 428 | } |
| 429 | |
| 430 | double |
| 431 | BoxArray::d_numPts () const noexcept |
| 432 | { |
| 433 | double result = 0; |
| 434 | const int N = static_cast<int>(size()); |
| 435 | auto const& bxs = this->m_ref->m_abox; |
| 436 | if (m_bat.is_null()) { |
| 437 | #ifdef AMREX_USE_OMP |
| 438 | #pragma omp parallel for reduction(+:result) |
| 439 | #endif |
| 440 | for (int i = 0; i < N; ++i) |
| 441 | { |
| 442 | result += bxs[i].d_numPts(); |
| 443 | } |
| 444 | } else if (m_bat.is_simple()) { |
| 445 | IndexType t = ixType(); |
| 446 | IntVect cr = crseRatio(); |
| 447 | #ifdef AMREX_USE_OMP |
| 448 | #pragma omp parallel for reduction(+:result) |
| 449 | #endif |
| 450 | for (int i = 0; i < N; ++i) |
| 451 | { |
| 452 | result += amrex::convert(amrex::coarsen(bxs[i],cr),t).d_numPts(); |
| 453 | } |
| 454 | } else { |
| 455 | #ifdef AMREX_USE_OMP |
| 456 | #pragma omp parallel for reduction(+:result) |
| 457 | #endif |
| 458 | for (int i = 0; i < N; ++i) |
| 459 | { |
| 460 | result += m_bat.m_op.m_bndryReg(bxs[i]).d_numPts(); |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | return result; |
| 465 | } |
| 466 | |
| 467 | int |
| 468 | BoxArray::readFrom (std::istream& is) |