| 500 | } |
| 501 | |
| 502 | void Radiation::regrid(int level, const BoxArray& grids, const DistributionMapping& dmap) |
| 503 | { |
| 504 | BL_PROFILE("Radiation::Regrid"); |
| 505 | if (verbose > 0 && ParallelDescriptor::IOProcessor()) { |
| 506 | std::cout << "Regridding radiation object at level " << level |
| 507 | << "..." << std::endl; |
| 508 | } |
| 509 | if (level > 0) { |
| 510 | IntVect crse_ratio = parent->refRatio(level-1); |
| 511 | |
| 512 | flux_cons[level].reset(new FluxRegister(grids, dmap, crse_ratio, level, nGroups)); |
| 513 | flux_cons[level]->setVal(0.0); |
| 514 | |
| 515 | // For deferred sync, flux_cons_old does not need to be defined here. |
| 516 | // It will be set in the deferred_sync_setup routine. |
| 517 | |
| 518 | flux_trial[level].reset(new FluxRegister(grids, dmap, crse_ratio, level, nGroups)); |
| 519 | flux_trial[level]->setVal(0.0); |
| 520 | |
| 521 | } |
| 522 | |
| 523 | dflux[level].reset(new MultiFab(grids, dmap, 1, 0)); |
| 524 | |
| 525 | if (nplotvar > 0) { |
| 526 | plotvar[level].reset(new MultiFab(grids, dmap, nplotvar, 0)); |
| 527 | plotvar[level]->setVal(0.0); |
| 528 | } |
| 529 | |
| 530 | // This array will not be used on the finest level. I create it here, |
| 531 | // though, in case a finer level is created before this level is next |
| 532 | // regridded: |
| 533 | |
| 534 | if (verbose > 1 && ParallelDescriptor::IOProcessor()) { |
| 535 | std::cout << " done" << std::endl; |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | void Radiation::close(int level) |
| 540 | { |