Skip to content

Commit

Permalink
FFT: use layout provided by amrex
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Nov 1, 2024
1 parent c2175c2 commit 1601a84
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ExampleCodes/FFT/Basic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,7 @@ int main (int argc, char* argv[])
}

// create storage for the FFT
Box cdomain = geom.Domain();
cdomain.setBig(0,cdomain.length(0)/2);
Geometry cgeom(cdomain, real_box, CoordSys::cartesian, is_periodic);
auto cba = amrex::decompose(cdomain, ParallelContext::NProcsSub(),
{AMREX_D_DECL(true,true,false)});
DistributionMapping cdm(cba);
auto const& [cba, cdm] = my_fft.getSpectralDataLayout();
FabArray<BaseFab<GpuComplex<amrex::Real> > > phi_fft(cba, cdm, 1, 0);

// we will copy the real and imaginary parts of the FFT to this MultiFab
Expand Down Expand Up @@ -175,6 +170,10 @@ int main (int argc, char* argv[])
Real time = 0.;
int step = 0;

Box cdomain = geom.Domain();
cdomain.setBig(0,cdomain.length(0)/2);
Geometry cgeom(cdomain, real_box, CoordSys::cartesian, is_periodic);

// arguments
// 1: name of plotfile
// 2: MultiFab containing data to plot
Expand Down

0 comments on commit 1601a84

Please sign in to comment.