gstlearn  1.0.0
CCC
CalcSimuFFT Class Reference

#include <CalcSimuFFT.hpp>

Inheritance diagram for CalcSimuFFT:
ACalcSimulation ACalcInterpolator ACalcDbToDb ACalculator

Public Member Functions

 CalcSimuFFT (int nbsimu=0, bool verbose=false, int seed=4324324)
 
 CalcSimuFFT (const CalcSimuFFT &r)=delete
 
CalcSimuFFToperator= (const CalcSimuFFT &r)=delete
 
virtual ~CalcSimuFFT ()
 
void setParam (const SimuFFTParam &param)
 
void setVerbose (bool verbose)
 
VectorDouble changeSupport (const VectorDouble &sigma)
 
- Public Member Functions inherited from ACalcSimulation
 ACalcSimulation (int nbimu, int seed=4324324)
 
 ACalcSimulation (const ACalcSimulation &r)=delete
 
ACalcSimulationoperator= (const ACalcSimulation &r)=delete
 
virtual ~ACalcSimulation ()
 
int getSeed () const
 
int getNbSimu () const
 
void setSeed (int seed)
 
void setNbSimu (int nbsimu)
 
- Public Member Functions inherited from ACalcInterpolator
 ACalcInterpolator ()
 
 ACalcInterpolator (const ACalcInterpolator &r)=delete
 
ACalcInterpolatoroperator= (const ACalcInterpolator &r)=delete
 
virtual ~ACalcInterpolator ()
 
void setModel (Model *model)
 
void setNeigh (ANeigh *neigh)
 
ModelgetModel () const
 
ANeighgetNeigh () const
 
bool hasModel (bool verbose=true) const
 
bool hasNeigh (bool verbose=true) const
 
- Public Member Functions inherited from ACalcDbToDb
 ACalcDbToDb (bool mustShareSameSpaceDimension=true)
 
 ACalcDbToDb (const ACalcDbToDb &r)=delete
 
ACalcDbToDboperator= (const ACalcDbToDb &r)=delete
 
virtual ~ACalcDbToDb ()
 
void setDbin (Db *dbin)
 
void setDbout (Db *dbout)
 
void setNamingConvention (const NamingConvention &namconv)
 
void setMustShareSpaceDimension (bool mustShareSpaceDimension)
 
DbgetDbin () const
 
DbgetDbout () const
 
DbGridgetGridin () const
 
DbGridgetGridout () const
 
bool hasDbin (bool verbose=true) const
 
bool hasDbout (bool verbose=true) const
 
bool isGridIn (bool verbose=true) const
 
bool isGridOut (bool verbose=true) const
 
- Public Member Functions inherited from ACalculator
 ACalculator ()
 
 ACalculator (const ACalculator &r)=delete
 
ACalculatoroperator= (const ACalculator &r)=delete
 
virtual ~ACalculator ()
 
bool run ()
 

Private Member Functions

virtual bool _check () override
 
virtual bool _preprocess () override
 
virtual bool _run () override
 
virtual bool _postprocess () override
 
virtual void _rollback () override
 
bool _simulate ()
 
void _alloc ()
 
int _getOptimalEvenNumber (int number, int largeFactor=11)
 
VectorInt _getFactors (int number)
 
void _gridDilate ()
 
bool _checkCorrect (const VectorVectorDouble &xyz, int ix, int iy, int iz, double percent)
 
void _prepar (bool flag_amplitude, double eps=EPSILON5)
 
void _defineRandom ()
 
void _setVariance (int ix, int iy, int iz)
 
void _defineSymmetry (void)
 
void _defineSym1 ()
 
void _defineSym2 (int iz0)
 
void _defineSym3 ()
 
void _setZero (int ix, int iy, int iz)
 
void _setConjugate (int ix, int iy, int iz, int jx, int jy, int jz)
 
void _final (DbGrid *db, int iad)
 
double _support (double sigma)
 
double _support1 (double sigma)
 
double _support2 (double sigma)
 
double _support3 (double sigma)
 
double _rhoSigma (double sigma, int ix, int iy, int iz)
 

Private Attributes

int _iattOut
 
bool _verbose
 
SimuFFTParam _param
 
int _nxyz
 
VectorInt _nx
 
VectorInt _shift
 
VectorInt _dims
 
VectorInt _dim2
 
int _sizes_alloc
 
VectorDouble _cmat
 
VectorDouble _rnd
 
VectorDouble _u
 
VectorDouble _v
 

Additional Inherited Members

- Protected Member Functions inherited from ACalcInterpolator
virtual int _getNDim () const override
 
virtual int _getNVar () const override
 
virtual int _getNCova () const
 
int _centerDataToGrid (DbGrid *dbgrid)
 
- Protected Member Functions inherited from ACalcDbToDb
int _addVariableDb (int whichDb, int status, const ELoc &locatorType, int locatorIndex=0, int number=1, double valinit=0.)
 
void _renameVariable (int whichDb, const VectorString &names, const ELoc &locatorType, int nvar, int iptr, const String &name, int count, bool flagSetLocator=true, int shift=0)
 
void _storeInVariableList (int whichDb, int status, const VectorInt &iuids)
 
int _expandInformation (int mode, const ELoc &locatorType)
 
void _cleanVariableDb (int status)
 
Db_whichDb (int whichDb)
 
String _identifyVariable (int iuid) const
 

Constructor & Destructor Documentation

◆ CalcSimuFFT() [1/2]

CalcSimuFFT::CalcSimuFFT ( int  nbsimu = 0,
bool  verbose = false,
int  seed = 4324324 
)

◆ CalcSimuFFT() [2/2]

CalcSimuFFT::CalcSimuFFT ( const CalcSimuFFT r)
delete

◆ ~CalcSimuFFT()

CalcSimuFFT::~CalcSimuFFT ( )
virtual

Member Function Documentation

◆ _alloc()

void CalcSimuFFT::_alloc ( )
private

Dimension the ST_FFT structure

◆ _check()

bool CalcSimuFFT::_check ( )
overrideprivatevirtual

Reimplemented from ACalcSimulation.

◆ _checkCorrect()

bool CalcSimuFFT::_checkCorrect ( const VectorVectorDouble xyz,
int  ix,
int  iy,
int  iz,
double  percent 
)
private

Checks if the covariance is below threshold for tested distance

Returns
True if the grid node is below threshold; 0 otherwise
Parameters
[in]xyzGrid increment
[in]ixGrid index along X
[in]iyGrid index along Y
[in]izGrid index along Z
[in]percentPercentage of the model variance below which the covariance is considered as small enough for dilation

◆ _defineRandom()

void CalcSimuFFT::_defineRandom ( )
private

Initiate a vector of random normal values

◆ _defineSym1()

void CalcSimuFFT::_defineSym1 ( )
private

Operate the symmetry for a 1-D space

◆ _defineSym2()

void CalcSimuFFT::_defineSym2 ( int  iz0)
private

Operate the symmetry for a 2-D space

Parameters
[in]iz0fixed third index

◆ _defineSym3()

void CalcSimuFFT::_defineSym3 ( )
private

Operate the symmetry for a 3-D space

◆ _defineSymmetry()

void CalcSimuFFT::_defineSymmetry ( void  )
private

Operate the symmetry

◆ _final()

void CalcSimuFFT::_final ( DbGrid db,
int  iad 
)
private

Perform a non-conditional simulation on the grid

Parameters
[in]dbDb structure
[in]iadaddress for writing the simulation

◆ _getFactors()

VectorInt CalcSimuFFT::_getFactors ( int  number)
private

Get the factor decomposition of a number

Returns
Count of active factors
Parameters
[in]numbernumber to be decomposed

◆ _getOptimalEvenNumber()

int CalcSimuFFT::_getOptimalEvenNumber ( int  number,
int  largeFactor = 11 
)
private

Returns the closest value, larger than the argument, which is factorized as the product of low factors

Returns
Returned number
Parameters
[in]numberinput number
[in]largeFactorMaximum value for a Factor

◆ _gridDilate()

void CalcSimuFFT::_gridDilate ( )
private

Calculates the grid extension in a given grid direction

◆ _postprocess()

bool CalcSimuFFT::_postprocess ( )
overrideprivatevirtual

Reimplemented from ACalculator.

◆ _prepar()

void CalcSimuFFT::_prepar ( bool  flag_amplitude,
double  eps = EPSILON5 
)
private

Prepares the simulation on a grid using Discrete FFT

Parameters
[in]flag_amplitude1 to convert into amplitude
[in]epsTolerance

◆ _preprocess()

bool CalcSimuFFT::_preprocess ( )
overrideprivatevirtual

Reimplemented from ACalcSimulation.

◆ _rhoSigma()

double CalcSimuFFT::_rhoSigma ( double  sigma,
int  ix,
int  iy,
int  iz 
)
private

Calculate the exponential of the scaled correlation

Returns
Value of the transformed correlation
Parameters
[in]sigmaLogarithmic variance value
[in]ixIndex for the discretized covariance along X
[in]iyIndex for the discretized covariance along Y
[in]izIndex for the discretized covariance along Z

◆ _rollback()

void CalcSimuFFT::_rollback ( )
overrideprivatevirtual

Reimplemented from ACalculator.

◆ _run()

bool CalcSimuFFT::_run ( )
overrideprivatevirtual

Implements ACalculator.

◆ _setConjugate()

void CalcSimuFFT::_setConjugate ( int  ix,
int  iy,
int  iz,
int  jx,
int  jy,
int  jz 
)
private

Set the target cell as the conjugate of the input cell

Parameters
[in]ixInput cell location along X
[in]iyInput cell location along Y
[in]izInput cell location along Z
[in]jxTarget cell location along X
[in]jyTarget cell location along Y
[in]jzTarget cell location along Z

◆ _setVariance()

void CalcSimuFFT::_setVariance ( int  ix,
int  iy,
int  iz 
)
private

Correct the variance of the spectrum for real U

Parameters
[in]ixCell location along X
[in]iyCell location along Y
[in]izCell location along Z

◆ _setZero()

void CalcSimuFFT::_setZero ( int  ix,
int  iy,
int  iz 
)
private

Set the imaginary part of a cell to zero

Parameters
[in]ixCell location along X
[in]iyCell location along Y
[in]izCell location along Z

◆ _simulate()

bool CalcSimuFFT::_simulate ( )
private

◆ _support()

double CalcSimuFFT::_support ( double  sigma)
private

Calculate the mean lognormal covariance over the block

Returns
Mean lognormal covariance
Parameters
[in]sigmaLogarithmic variance value

◆ _support1()

double CalcSimuFFT::_support1 ( double  sigma)
private

Calculate the mean lognormal covariance over the block (1-D)

Returns
Mean lognormal covariance
Parameters
[in]sigmaLogarithmic variance value

◆ _support2()

double CalcSimuFFT::_support2 ( double  sigma)
private

Calculate the mean lognormal covariance over the block (2-D)

Returns
Mean lognormal covariance
Parameters
[in]sigmaLogarithmic variance value

◆ _support3()

double CalcSimuFFT::_support3 ( double  sigma)
private

Calculate the mean lognormal covariance over the block (3-D)

Returns
Mean lognormal covariance
Parameters
[in]sigmaLogarithmic variance value

◆ changeSupport()

VectorDouble CalcSimuFFT::changeSupport ( const VectorDouble sigma)

◆ operator=()

CalcSimuFFT& CalcSimuFFT::operator= ( const CalcSimuFFT r)
delete

◆ setParam()

void CalcSimuFFT::setParam ( const SimuFFTParam param)
inline

◆ setVerbose()

void CalcSimuFFT::setVerbose ( bool  verbose)
inline

Member Data Documentation

◆ _cmat

VectorDouble CalcSimuFFT::_cmat
private

◆ _dim2

VectorInt CalcSimuFFT::_dim2
private

◆ _dims

VectorInt CalcSimuFFT::_dims
private

◆ _iattOut

int CalcSimuFFT::_iattOut
private

◆ _nx

VectorInt CalcSimuFFT::_nx
private

◆ _nxyz

int CalcSimuFFT::_nxyz
private

◆ _param

SimuFFTParam CalcSimuFFT::_param
private

◆ _rnd

VectorDouble CalcSimuFFT::_rnd
private

◆ _shift

VectorInt CalcSimuFFT::_shift
private

◆ _sizes_alloc

int CalcSimuFFT::_sizes_alloc
private

◆ _u

VectorDouble CalcSimuFFT::_u
private

◆ _v

VectorDouble CalcSimuFFT::_v
private

◆ _verbose

bool CalcSimuFFT::_verbose
private

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