Class GridTurbulence

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class GridTurbulence : public TurbulentField

Turbulent grid-based magnetic field with a general energy spectrum.

Subclassed by SimpleGridTurbulence

Public Functions

GridTurbulence(const TurbulenceSpectrum &spectum, const GridProperties &gridProp, unsigned int seed = 0)

Create a random initialization of a turbulent field.


Vector3d getField(const Vector3d &pos) 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

double getBrms() const
virtual double getCorrelationLength() const
virtual Vector3d getField(const Vector3d &position, double z) const
size_t addReference() const
size_t removeReference() const
int removeReferenceNoDelete() const
size_t getReferenceCount() const

Public Static Functions

void checkGridRequirements(ref_ptr<Grid3f> grid, double lMin, double lMax)
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
size_t _referenceCount