libfbm
0.3
Simulation of multi-dimensional stationary Gaussian processes and fractional Brownian motion.
|
Power-law power spectrum field. More...
#include <libfbm.hpp>
Public Member Functions | |
PLFPSField (const zvec &dim, double H) | |
~PLFPSField () | |
void | generate () |
Generate the field. | |
void | generate (GaussianGenerator &rng) |
Generate the field using random generator rng. | |
void | clear () |
Release all memory this object holds. | |
const zvec & | getDim () const |
Get the usable dimensions of this field. | |
![]() | |
AbstractField () | |
virtual | ~AbstractField () |
double | operator() (const zvec &p) const |
Get field value at the given point. | |
double | operator() (size_t x) const |
double | operator() (size_t x, size_t y) const |
double | operator() (size_t x, size_t y, size_t z) const |
double | operator() (size_t x, size_t y, size_t z, size_t u) const |
double | operator() (size_t x, size_t y, size_t z, size_t u, size_t v) const |
double & | at (const zvec &p) |
Return a reference to the internal array element at point p. | |
const double & | at (const zvec &p) const |
const size_t * | getStrides () const |
Get the strides array. |
Additional Inherited Members | |
![]() | |
std::vector< double > | Z |
double * | datap |
size_t | muls [LIBFBM_MAX_DIM] |
Power-law power spectrum field.
Loosely based on [6]. The power spectum is given as
We fill a complex matrix with gaussian random values. We don't use symmetric conjugation. The random values are scaled based on frequency, that is they are scaled using the power law above as scaling factor. The values are also globally scaled so that the resulting field has variance 1.0. Then a FFT is applied. This result in two fields, one in the real part, the other in the complex part. The real part is exported first, the next generate() switches to the imaginary part. Note that the fields in this case are symmetric. The 0 frequency component is taken as 0. The scaling factors are kept in memory, so total memory usage is 3x that of field dimension.
Definition at line 1026 of file libfbm.hpp.
libfbm::PLFPSField::PLFPSField | ( | const zvec & | dim, |
double | H | ||
) |
libfbm::PLFPSField::~PLFPSField | ( | ) |
|
virtual |
Release all memory this object holds.
Implements libfbm::AbstractField.
|
virtual |
Generate the field.
Implements libfbm::AbstractField.
|
virtual |
Generate the field using random generator rng.
The random generator should produce normally distributed numbers.
Implements libfbm::AbstractField.
|
inlinevirtual |
Get the usable dimensions of this field.
Implements libfbm::AbstractField.
Definition at line 1037 of file libfbm.hpp.