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

Function InitializeMultiFab

Tests/MultiBlock/IndexType/main.cpp:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17amrex::iMultiFab InitializeMultiFab(const amrex::Box& domain)
18{
19 amrex::BoxArray ba(domain);
20 // do some work across MPI ranks.
21 ba.maxSize(8);
22 amrex::DistributionMapping dm(ba);
23 amrex::iMultiFab mf(ba, dm, 1, 0);
24 const int nx = domain.length(0);
25 const int ny = domain.length(1);
26 for (amrex::MFIter mfi(mf); mfi.isValid(); ++mfi) {
27 auto array = mf.array(mfi);
28 ParallelFor(mfi.tilebox(),
29 [=] AMREX_GPU_DEVICE (int i, int j, int k)
30 {
31 array(i,j,k) = i + j*nx + k*nx*ny;
32 });
33 }
34 return mf;
35}
36
37bool ParallelCopyWithItselfIsCorrect(amrex::iMultiFab& mf, const amrex::Box& domain) {
38 const amrex::IntVect e_x = amrex::IntVect::TheDimensionVector(0);

Callers 2

AMREX_D_TERMFunction · 0.85
MyMainFunction · 0.85

Calls 5

tileboxMethod · 0.80
ParallelForFunction · 0.50
lengthMethod · 0.45
isValidMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected