Skip to content

Commit 6a53de0

Browse files
committed
Update makefile for new FFT procedure
1 parent 4482b3d commit 6a53de0

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Make.sledgehamr

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ CEXE_headers += $(shell ls $(SLEDGEHAMR_PROJECT_PATH)/*/*.h | xargs -n 1 basenam
3434
include $(SLEDGEHAMR_HOME_ABS)/Make.projects
3535

3636
# SWFFT
37-
include $(AMREX_HOME)/Src/Extern/SWFFT/Make.package
38-
INCLUDE_LOCATIONS += $(AMREX_HOME)/Src/Extern/SWFFT
39-
VPATH_LOCATIONS += $(AMREX_HOME)/Src/Extern/SWFFT
37+
#include $(AMREX_HOME)/Src/Extern/SWFFT/Make.package
38+
#INCLUDE_LOCATIONS += $(AMREX_HOME)/Src/Extern/SWFFT
39+
#VPATH_LOCATIONS += $(AMREX_HOME)/Src/Extern/SWFFT
40+
41+
include $(AMREX_HOME)/Src/FFT/Make.package
42+
INCLUDE_LOCATIONS += $(AMREX_HOME)/Src/FFT
43+
VPATH_LOCATIONS += $(AMREX_HOME)/Src/FFT
44+
4045
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3_omp -lfftw3
4146

4247
# Boost
@@ -49,6 +54,7 @@ LIBRARIES += -lhdf5
4954
# AMReX
5055
USE_MPI = TRUE
5156
USE_OMP = TRUE
57+
USE_FFT = TRUE
5258
DIM = 3
5359

5460
include $(AMREX_HOME)/Tools/GNUMake/Make.defs

source/utils/fft.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
#ifndef SLEDGEHAMR_FFT_H_
22
#define SLEDGEHAMR_FFT_H_
33

4+
// #define OLD_FFT
5+
46
#include <AMReX_BCUtil.H>
57
#include <AMReX_FillPatchUtil.H>
68
#include <AMReX_PhysBCFunct.H>
7-
// #include <AlignedAllocator.h>
8-
// #include <Dfft.H>
9-
// #include <Distribution.H>
9+
#ifdef OLD_FFT
10+
#include <AlignedAllocator.h>
11+
#include <Dfft.H>
12+
#include <Distribution.H>
13+
#else
1014
#include <AMReX_FFT.H>
15+
#endif
1116
#include <iterator>
1217

1318
#include "hdf5_utils.h"
@@ -211,6 +216,8 @@ static void Fft(const amrex::MultiFab &field, const int comp,
211216

212217
amrex::FillPatchSingleLevel(padded_field, 0, smf, stime, 0, 0, 1,
213218
padded_geom, physbc, 0);
219+
220+
#ifndef OLD_FFT
214221
// Use the new amrex::FFT setup
215222
amrex::Box domain = padded_ba.minimalBox();
216223
amrex::FFT::R2C my_fft(domain);
@@ -253,8 +260,8 @@ static void Fft(const amrex::MultiFab &field, const int comp,
253260
});
254261
}
255262
}
263+
#else
256264

257-
/*
258265
// Now setup SWFFT
259266
int nx = padded_ba[0].size()[0];
260267
int ny = padded_ba[0].size()[1];
@@ -340,7 +347,7 @@ static void Fft(const amrex::MultiFab &field, const int comp,
340347
}
341348
}
342349
}
343-
*/
350+
#endif
344351
}
345352

346353
}; // namespace utils

0 commit comments

Comments
 (0)