Class SimpleGridTurbulence

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class SimpleGridTurbulence : public GridTurbulence

Turbulent grid-based magnetic field with a simple power-law spectrum.

Subclassed by HelicalGridTurbulence

Public Functions

SimpleGridTurbulence(const SimpleTurbulenceSpectrum &spectrum, const GridProperties &gridProp, unsigned int seed = 0)

Create a random initialization of a turbulent field.

Parameters:
virtual Vector3d getField(const Vector3d &pos) const
inline virtual Vector3d getField(const Vector3d &position, double z) const
const ref_ptr<Grid3f> &getGrid() const

Return a const reference to the grid

Vector3f getMeanFieldVector() const

Evaluate the mean vector of all grid points

double getMeanFieldStrength() const

Evaluate the mean of all grid points

double getRmsFieldStrength() const

Evaluate the RMS of all grid points

std::array<float, 3> getRmsFieldStrengthPerAxis() const

Evaluate the RMS of all grid points per axis

std::vector<std::pair<int, float>> getPowerSpectrum() const

Evaluate generated power-spectrum

void dumpToFile(std::string filename) const

Dump a Grid3f to a binary file

inline double getBrms() const
inline virtual double getCorrelationLength() const
inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Public Static Functions

static void initTurbulence(ref_ptr<Grid3f> grid, double Brms, double lMin, double lMax, double alpha, int seed)
static void checkGridRequirements(ref_ptr<Grid3f> grid, double lMin, double lMax)
static void executeInverseFFTInplace(ref_ptr<Grid3f> grid, fftwf_complex *Bkx, fftwf_complex *Bky, fftwf_complex *Bkz)

Protected Functions

void initGrid(const GridProperties &grid)
void initTurbulence()

Protected Attributes

unsigned int seed
ref_ptr<Grid3f> gridPtr
const TurbulenceSpectrum &spectrum
mutable size_t _referenceCount