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

Retain only amrex::FFT for turbulence diagnostics #177

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
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
43 changes: 1 addition & 42 deletions exec/compressible_stag/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ USE_FFT = TRUE
USE_PARTICLES = FALSE
DO_TURB = FALSE

USE_HEFFTE_FFTW = FALSE
USE_HEFFTE_CUFFT = FALSE
USE_HEFFTE_ROCFFT = FALSE
USE_DISTRIBUTED_FFT = TRUE

ifeq ($(USE_HEFFTE_FFTW),TRUE)
HEFFTE_HOME ?= ../../../heffte/
else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
HEFFTE_HOME ?= ../../../heffte-org/build_aware/
else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
HEFFTE_HOME ?= ../../../heffte-org/build_noaware/
endif

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

VPATH_LOCATIONS += .
Expand Down Expand Up @@ -59,41 +46,13 @@ include ../../src_common/Make.package
VPATH_LOCATIONS += ../../src_common/
INCLUDE_LOCATIONS += ../../src_common/

#ifeq ($(USE_HEFFTE_FFTW),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#endif

ifeq ($(USE_HEFFTE_FFTW),TRUE)
DEFINES += -DHEFFTE_FFTW
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3 -lfftw3f
else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
DEFINES += -DHEFFTE_CUFFT
else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
DEFINES += -DHEFFTE_ROCFFT
endif

include $(AMREX_HOME)/Src/Base/Make.package

include ../../src_analysis/Make.package
VPATH_LOCATIONS += ../../src_analysis/
INCLUDE_LOCATIONS += ../../src_analysis/

include $(AMREX_HOME)/Tools/GNUMake/Make.rules

ifeq ($(USE_CUDA),TRUE)
LIBRARIES += -lcufft
else ifeq ($(USE_HIP),TRUE)
# Use rocFFT. ROC_PATH is defined in amrex
INCLUDE_LOCATIONS += $(ROC_PATH)/rocfft/include
LIBRARY_LOCATIONS += $(ROC_PATH)/rocfft/lib
LIBRARIES += -L$(ROC_PATH)/rocfft/lib -lrocfft
else
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3 -lfftw3f
endif
include $(AMREX_HOME)/Tools/GNUMake/Make.rules

ifeq ($(DO_TURB), TRUE)
DEFINES += -DTURB
Expand Down
9 changes: 1 addition & 8 deletions src_analysis/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@ CEXE_headers += StructFact.H
CEXE_sources += StructFact.cpp

CEXE_headers += TurbSpectra.H
CEXE_headers += TurbSpectra_distributed.H
CEXE_sources += TurbSpectra_distributed.cpp

#CEXE_sources += TurbSpectra_single.cpp
#CEXE_sources += TurbSpectra_heffte.cpp

#CEXE_headers += TurbSpectra_single.H
#CEXE_headers += TurbSpectra_heffte.H
CEXE_sources += TurbSpectra.cpp
62 changes: 51 additions & 11 deletions src_analysis/TurbSpectra.H
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
#ifndef _TurbSpectra_H_
#define _TurbSpectra_H_

#include <TurbSpectra_distributed.H>
//#if defined(HEFFTE_FFTW) || defined(HEFFTE_CUFFT) || defined(HEFFTE_ROCFFT) // use heFFTe
//#include <TurbSpectra_heffte.H>
//#elif defined(USE_DISTRIBUTED_FFT) // use single grid FFT
//#include <TurbSpectra_distributed.H>
//#else // use single grid FFT
//#include <TurbSpectra_single.H>
//#endif
#ifndef _TurbSpectraDistributed_H_
#define _TurbSpectraDistributed_H_

#include <AMReX.H>
#include <AMReX_MultiFab.H>
#include <AMReX_Vector.H>
#include <AMReX_VisMF.H>

#include <AMReX_GpuComplex.H>

#include <string>

#include "common_functions.H"

#define ALIGN 16

using namespace amrex;


void IntegrateKScalar(const MultiFab& cov_mag,
const std::string& name,
const int& step,
const int& comp);
//void IntegrateKScalarHeffte(const BaseFab<GpuComplex<Real> >& spectral_field,
// const std::string& name, const Real& scaling,
// const Box& c_local_box,
// const Real& sqrtnpts,
// const int& step);
void IntegrateKVelocity(const MultiFab& cov_mag,
const std::string& name,
const int& step,
const int& comp);
//void IntegrateKVelocityHeffte(const BaseFab<GpuComplex<Real> >& spectral_fieldx,
// const BaseFab<GpuComplex<Real> >& spectral_fieldy,
// const BaseFab<GpuComplex<Real> >& spectral_fieldz,
// const std::string& name, const Real& scaling,
// const Box& c_local_box,
// const int& step);
void TurbSpectrumScalar(const MultiFab& variables,
const amrex::Geometry& geom,
const int& step,
const amrex::Vector<amrex::Real>& var_scaling,
const amrex::Vector< std::string >& var_names);
void TurbSpectrumVelDecomp(const MultiFab& vel,
MultiFab& vel_decomp,
const amrex::Geometry& geom,
const int& step,
const amrex::Real& var_scaling,
const amrex::Vector< std::string >& var_names);


#endif
File renamed without changes.
52 changes: 0 additions & 52 deletions src_analysis/TurbSpectra_distributed.H

This file was deleted.

53 changes: 0 additions & 53 deletions src_analysis/TurbSpectra_heffte.H

This file was deleted.

Loading