Covariance Sampling Methods#

class drdmannturb.Sampling_method_base(RandomField)[source]#

Meta class for different sampling methods. Each of these requires a RandomField object, which is a subclass of :py:class:GaussianRandomField.

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.

class drdmannturb.Sampling_method_freq(RandomField)[source]#

Sampling method specifically in the frequency domain. This metaclass involves a single precomputation of the covariance spectrum of the underlying GaussianRandomField. Refer to specific subclasses for details on what each of these entails, but generally, the approximate square-root of each associated spectral tensor is computed and transformed into the frequency domain.

The norm of the transform is defined as the square-root of the length-scale.

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.

class drdmannturb.Sampling_FFTW(RandomField)[source]#

Sampling with FFTW. Two stencils for the forward and inverse FFTs are generated using the following FFTW flags: "FFTW_MEASURE", "FFTW_DESTROY_INPUT", "FFTW_UNALIGNED".

Due to properties of the FFT, only stationary covariances are admissible.

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.

class drdmannturb.Sampling_VF_FFTW(RandomField)[source]#

FFTW applied to a vector field. This should be used in conjunction with VectorGaussianRandomField. This sampling method is also multi-threaded across 4 threads, or else the maximum allowed by the environment. As in Sampling_FFTW, the following FFTW flags are used: "FFTW_MEASURE", "FFTW_DESTROY_INPUT", "FFTW_UNALIGNED".

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.

class drdmannturb.Sampling_FFT(RandomField)[source]#

Sampling using scipy.fftpack, which is considerably slower than with FFTW but is a simpler interface.

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.

class drdmannturb.Sampling_DST(RandomField)[source]#

Sampling using the discrete sine transform from scipy.fftpack, with all other operations being identical as other sampling methods.

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.

class drdmannturb.Sampling_DCT(RandomField)[source]#

Sampling using the discrete cosine transform from scipy.fftpack, with all other operations being identical as other sampling methods.

Parameters:

RandomField (GaussianRandomField) – The random field from which to sample from. This object also determines all of the physical quantities and domain partitioning.