#include #include #include "genlib.h" #include "geostat.h" #ifndef _TOOLSFFTMA_H #define _TOOLSFFTMA_H /* Create december, the 16th 2002 */ /* Modified december, the 9th 2002 */ /* List of functions: */ /* ------------------ */ /* kgeneration, FFTMA2, prebuild_gwn, build_real, , clean_real */ /*FUNCTIONS*/ /*----------*/ void kgeneration(long seed,struct grid_mod grid,struct statistic_mod stat,struct vario_mod variogram,string filename[8],struct realization_mod *Z,struct realization_mod *Y,struct realization_mod *Y2, int n[3], int *genere, int *gwnwrite, struct realization_mod *gwnoise); void kgeneration2(long seed,struct grid_mod grid,struct statistic_mod stat,struct vario_mod variogram,string filename[7],struct realization_mod *Z,struct realization_mod *Y,struct realization_mod *Y1, int n[3], int *genere, int *gwnwrite, struct realization_mod *gwnoise,int *format_file) ; /*FAST FOURIER TRANSFORM Pressure Simulation */ /*Turns a Gaussian white noise vector into a */ /*spatially correlated vector */ /*input: */ /*variogram: structure defining the variogram */ /* model */ /*grid: structure defining the grid */ /*n: vector with the number of cells along the */ /* X, Y and Z axes for the underlying grid */ /* i = [0 1 2] */ /* --> 0 0 0 : n will be computed and */ /* updated as output */ /* --> nx ny nz: these dimensions are used */ /*realin: structure defining a realization - */ /* must be a Gaussian white noise */ /*gradient: macroscopic gradient pression vector */ /*output: */ /*realout: structure defining a realization - */ /*realout2: structure defining a pressure field */ /*realout3: structure defining a xvelocity field */ /*realout4: structure defining a yvelocity field */ /*realout5: structure defining a zvelocity field */ void FFTMA2(struct vario_mod variogram,struct grid_mod grid,int n[3],struct realization_mod *realin,struct realization_mod *realout); /* prebuild_gwn */ /* Produce a first construction in real space of the Gaussian white noise */ /* grid: structure defining the grid */ /*n: vector with the number of cells along the */ /* X, Y and Z axes for the underlying grid */ /* i = [0 1 2] */ /* --> 0 0 0 : n will be computed and */ /* updated as output */ /* --> nx ny nz: these dimensions are used */ /*realin: structure defining a realization - */ /* must be a Gaussian white noise */ /*realization: structure defining a realization*/ void prebuild_gwn(struct grid_mod grid,int n[3],struct realization_mod *realin,double *realization,int solver); /* build_real */ /* build a realization in the spectral domain */ /*n: vector with the number of cells along the */ /* X, Y and Z axes for the underlying grid */ /* i = [0 1 2] */ /* --> 0 0 0 : n will be computed and */ /* updated as output */ /* --> nx ny nz: these dimensions are used */ /*covar: vector defining the covariance in spectral domain */ /*realization: vector defining the real part */ /*ireal: vector defining the i-part */ void build_real(int n[3],int NTOT,double *covar,double *realization,double *ireal); void clean_real(struct realization_mod *realin,int n[3],struct grid_mod grid,double *vectorresult,struct realization_mod *realout); #endif // define _TOOLSFFTMA_H