File fft_fftw.cxx#
FFT routines using external libraries.
Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
Contact: Ben Dudson, bd512@york.ac.uk
This file is part of BOUT++.
BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.
-
namespace bout
Provides access to the Hypre library, handling initialisation and finalisation.
Usage
#include <bout/hyprelib.hxx>
class MyClass { public:
private: HypreLib lib; };
This will then automatically initialise Hypre the first time an object is created, and finalise it when the last object is destroyed.
Copyright 2012 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
Contact: Ben Dudson, bd512@york.ac.uk
This file is part of BOUT++.
BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.
Explicit inversion of a 3x3 matrix
aIf the matrix is singular (ill conditioned), the determinant is return. Otherwise, an empty
std::optionalis returnSNB model
-
namespace fft
Functions
-
void fft_init(bool fft_measure)#
Should the FFT functions find and use an optimised plan?
-
void fft_init(FFT_MEASUREMENT_FLAG fft_flag)#
Should the FFT functions find and use an optimised plan?
-
void fft_init(Options *options = nullptr)#
Should the FFT functions find and use an optimised plan?
If
optionsis not nullptr, it should contain a bool called “fftw_measure”. If it is nullptr, use the globalOptionsroot
-
Array<dcomplex> rfft(const Array<BoutReal> &in)#
Returns the fft of a real signal
inusing fftw_forward.
-
Array<BoutReal> irfft(const Array<dcomplex> &in, int length)#
Take the inverse fft of signal
inwhere the outputs are only reals. Requires thelengthof the original real signallengthis required because input signals to the forward transform of lengthnandn + 1both produce ffts of length(n / 2) + 1— i.e. it’s not possible to recover the length of the original signal from the fft alone.Expects that
in.size() == (length / 2) + 1
-
void rfft([[maybe_unused]] const BoutReal *in, [[maybe_unused]] int length, [[maybe_unused]] dcomplex *out)
-
void irfft([[maybe_unused]] const dcomplex *in, [[maybe_unused]] int length, [[maybe_unused]] BoutReal *out)
-
void fft_init(bool fft_measure)#
-
namespace fft