Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFT: use layout provided by amrex #142

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading