CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
68 stars 67 forks source link

Fix #338, removes deprecation warning due to initTurbulence in JF12 #343

Closed adundovi closed 3 years ago

adundovi commented 3 years ago

Besides just replacing the code, I've named turbulent field parameters for readability:

    const double lMin = 8 * parsec;
    const double lMax = 272 * parsec;
    const double Brms = 1;
    const double spacing = 4 * parsec;
    const double grid_n = 256;

    auto spectrum = SimpleTurbulenceSpectrum(Brms, lMin, lMax);
    auto gp = GridProperties(Vector3d(0.), grid_n, spacing);
    auto tf = SimpleGridTurbulence(spectrum, gp, seed);

In addition, a few trivial tests checks if the output field remains the same.