MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / FineSetVal

Method FineSetVal

Src/AmrCore/AMReX_FluxRegister.cpp:499–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499void
500FluxRegister::FineSetVal (int dir,
501 int boxno,
502 int destcomp,
503 int numcomp,
504 Real val,
505 RunOn runon) noexcept
506{
507 BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= ncomp);
508
509 FArrayBox& loreg = bndry[Orientation(dir,Orientation::low)][boxno]; // NOLINT(clang-analyzer-security.ArrayBound)
510 BL_ASSERT(numcomp <= loreg.nComp());
511 if ((runon == RunOn::Gpu) && Gpu::inLaunchRegion()) {
512 loreg.setVal<RunOn::Device>(val, loreg.box(), destcomp, numcomp);
513 } else {
514 loreg.setVal<RunOn::Host>(val, loreg.box(), destcomp, numcomp);
515 }
516
517 FArrayBox& hireg = bndry[Orientation(dir,Orientation::high)][boxno]; // NOLINT(clang-analyzer-security.ArrayBound)
518 BL_ASSERT(numcomp <= hireg.nComp());
519 if ((runon == RunOn::Gpu) && Gpu::inLaunchRegion()) {
520 hireg.setVal<RunOn::Device>(val, hireg.box(), destcomp, numcomp);
521 } else {
522 hireg.setVal<RunOn::Host>(val, hireg.box(), destcomp, numcomp);
523 }
524}
525
526void
527FluxRegister::Reflux (MultiFab& mf,

Calls 4

inLaunchRegionFunction · 0.85
OrientationClass · 0.50
nCompMethod · 0.45
boxMethod · 0.45

Tested by

no test coverage detected