Skip to content

Commit 51373e5

Browse files
authored
FFT: use layout provided by amrex (#142)
1 parent c2175c2 commit 51373e5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ExampleCodes/FFT/Basic/main.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,7 @@ int main (int argc, char* argv[])
132132
}
133133

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

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

173+
Box cdomain = geom.Domain();
174+
cdomain.setBig(0,cdomain.length(0)/2);
175+
Geometry cgeom(cdomain, real_box, CoordSys::cartesian, is_periodic);
176+
178177
// arguments
179178
// 1: name of plotfile
180179
// 2: MultiFab containing data to plot

0 commit comments

Comments
 (0)