Program Listing for File HelicalGridTurbulence.h

Return to documentation for file (include/crpropa/magneticField/turbulentField/HelicalGridTurbulence.h)

#ifndef CRPROPA_HELICALGRIDTURBULENCE_H
#define CRPROPA_HELICALGRIDTURBULENCE_H

#ifdef CRPROPA_HAVE_FFTW3F

#include "crpropa/Grid.h"
#include "crpropa/magneticField/turbulentField/SimpleGridTurbulence.h"

#include "kiss/logger.h"
#include "kiss/string.h"

namespace crpropa {
class HelicalGridTurbulence : public SimpleGridTurbulence {
  private:
        double H;

  public:
        HelicalGridTurbulence(const SimpleTurbulenceSpectrum &spectrum,
                              const GridProperties &gridProp, double H,
                              unsigned int seed = 0);

        static void initTurbulence(ref_ptr<Grid3f> grid, double Brms, double lMin,
                                   double lMax, double alpha, int seed, double H);
};

// Compatibility with old functions from GridTurbulence:

void initHelicalTurbulence(ref_ptr<Grid3f> grid, double Brms, double lMin,
                           double lMax, double alpha = -11 / 3., int seed = 0,
                           double H = 0) {
        KISS_LOG_WARNING
            << "initTurbulence is deprecated and will be removed in the future. "
               "Replace it with a more appropriate turbulent field model instance.";
        HelicalGridTurbulence::initTurbulence(grid, Brms, lMin, lMax, alpha, seed,
                                              H);
}

} // namespace crpropa

#endif // CRPROPA_HAVE_FFTW3F

#endif // CRPROPA_HELICALGRIDTURBULENCE_H