MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / loadLevelVectors

Method loadLevelVectors

Source/radiation/HypreMultiABec.cpp:2538–2630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2536}
2537
2538void HypreMultiABec::loadLevelVectors(int level,
2539 MultiFab& dest,
2540 int icomp,
2541 MultiFab& rhs,
2542 BC_Mode inhom)
2543{
2544 BL_PROFILE("HypreMultiABec::loadLevelVectors");
2545
2546 int part = level - crse_level;
2547
2548 Real *vec;
2549 FArrayBox fnew;
2550 for (MFIter mfi(dest); mfi.isValid(); ++mfi) {
2551 int i = mfi.index();
2552 const Box &reg = grids[level][i];
2553
2554 // initialize dest, since we will reuse the space to set up rhs below:
2555
2556 FArrayBox *f;
2557 int fcomp;
2558 if (dest.nGrow() == 0) { // need a temporary if dest is the wrong size
2559 f = &dest[mfi];
2560 fcomp = icomp;
2561 }
2562 else {
2563 f = &fnew;
2564 f->resize(reg);
2565 f->copy<RunOn::Device>(dest[mfi], icomp, 0, 1);
2566 fcomp = 0;
2567 }
2568 Elixir f_elix = fnew.elixir();
2569
2570 vec = f->dataPtr(fcomp); // sharing space, dest will be overwritten below
2571
2572 vectorSetBoxValues(x, part, reg, subgrids[level][i], vec);
2573
2574 f->copy<RunOn::Device>(rhs[mfi], 0, fcomp, 1);
2575
2576 // add b.c.'s to rhs
2577
2578 if (inhom) {
2579 const Box& domain = bd[level]->getDomain();
2580 for (OrientationIter oitr; oitr; oitr++) {
2581 int cdir(oitr());
2582 int idim = oitr().coordDir();
2583 const RadBoundCond &bct = bd[level]->bndryConds(oitr())[i];
2584 const Real &bcl = bd[level]->bndryLocs(oitr())[i];
2585 const FArrayBox &fs = bd[level]->bndryValues(oitr())[mfi];
2586 const Mask &msk = bd[level]->bndryMasks(oitr(), i);
2587 const Box &bbox = (*bcoefs[level])[idim][mfi].box();
2588
2589 if (reg[oitr()] == domain[oitr()] || level == crse_level) {
2590
2591 // Treat an exposed grid edge here as a boundary condition
2592 // for the linear solver:
2593
2594 if (reg[oitr()] == domain[oitr()]) {
2595 Array4<const int> tfp{};

Callers 1

levelSolveMethod · 0.45

Calls 2

isValidMethod · 0.80
mixedBndryMethod · 0.45

Tested by

no test coverage detected