libfbm  0.3
Simulation of multi-dimensional stationary Gaussian processes and fractional Brownian motion.
 All Classes Namespaces Functions Variables Friends
Public Member Functions
libfbm::PLFPSField Class Reference

Power-law power spectrum field. More...

#include <libfbm.hpp>

Inheritance diagram for libfbm::PLFPSField:
libfbm::AbstractField

List of all members.

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 zvecgetDim () const
 Get the usable dimensions of this field.
- Public Member Functions inherited from libfbm::AbstractField
 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

- Protected Attributes inherited from libfbm::AbstractField
std::vector< double > Z
double * datap
size_t muls [LIBFBM_MAX_DIM]

Detailed Description

Power-law power spectrum field.

Loosely based on [6]. The power spectum is given as

\[ S\!\left(f\right)\sim 1/f^{(2H+d)}. \]

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.


Constructor & Destructor Documentation

libfbm::PLFPSField::PLFPSField ( const zvec dim,
double  H 
)
libfbm::PLFPSField::~PLFPSField ( )

Member Function Documentation

void libfbm::PLFPSField::clear ( )
virtual

Release all memory this object holds.

Implements libfbm::AbstractField.

void libfbm::PLFPSField::generate ( )
virtual

Generate the field.

Implements libfbm::AbstractField.

void libfbm::PLFPSField::generate ( GaussianGenerator rng)
virtual

Generate the field using random generator rng.

The random generator should produce normally distributed numbers.

Implements libfbm::AbstractField.

const zvec& libfbm::PLFPSField::getDim ( ) const
inlinevirtual

Get the usable dimensions of this field.

Implements libfbm::AbstractField.

Definition at line 1037 of file libfbm.hpp.


The documentation for this class was generated from the following file: