diff --git a/fftma_module/gen/build/lib.linux-x86_64-3.6/FFTMA.cpython-36m-x86_64-linux-gnu.so b/fftma_module/gen/build/lib.linux-x86_64-3.6/FFTMA.cpython-36m-x86_64-linux-gnu.so index 00aa14f..09c005e 100755 Binary files a/fftma_module/gen/build/lib.linux-x86_64-3.6/FFTMA.cpython-36m-x86_64-linux-gnu.so and b/fftma_module/gen/build/lib.linux-x86_64-3.6/FFTMA.cpython-36m-x86_64-linux-gnu.so differ diff --git a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/inputfiledata.o b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/inputfiledata.o index ba75822..ab3aa11 100644 Binary files a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/inputfiledata.o and b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/inputfiledata.o differ diff --git a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/test_fact.o b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/test_fact.o index 7887255..560d0ea 100644 Binary files a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/test_fact.o and b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/test_fact.o differ diff --git a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testmemory.o b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testmemory.o index b8ee6e2..90dfe51 100644 Binary files a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testmemory.o and b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testmemory.o differ diff --git a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testopenfile.o b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testopenfile.o index eda714a..9aed3c0 100644 Binary files a/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testopenfile.o and b/fftma_module/gen/build/temp.linux-x86_64-3.6/lib_src/testopenfile.o differ diff --git a/fftma_module/gen/include/toolsIO.h b/fftma_module/gen/include/toolsIO.h index f271f0c..0a92d52 100755 --- a/fftma_module/gen/include/toolsIO.h +++ b/fftma_module/gen/include/toolsIO.h @@ -12,53 +12,13 @@ /* List of functions: */ /* ------------------ */ -/* readfile_bin,inputdata,inputfiledata,debuginput */ -/* testmemory, testopenfile */ +/* testmemory */ /*FUNCTIONS*/ /*----------*/ -/* Lecture dans un fichier */ - -/* Inputdata */ -/* */ -/* input data needed for realizations*/ -/* seed: seed */ -/* grid: structure defining the actual grid */ -/* filename: name of files */ -/* variogram: struture defining the variogram model */ -/* stat: struture defining the mean and the variance of permeability realization */ -/* pression: structure defining the gradient pressure */ - -void inputdata(long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression); - -void inputfiledata(string inputfile,long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression); - -/* readfile_bin */ -/* */ -/* read in the file "filename" the vector values of a */ -/* realization_mod variable */ -/* filename: explicit */ -/* realin: structure defining a realization */ - -void readfile_bin(string filename, struct realization_mod *realin); - -/* DebugInput */ -/* */ -/* Display the input data */ -/* seed: seed */ -/* grid: structure defining the actual grid */ -/* filename: name of files */ -/* variogram: struture defining the variogram model */ -/* stat: struture defining the mean and the variance of permeability realization */ -/* pression: structure defining the gradient pressure */ -void debuginput(long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,int *genere, int *gwnwrite); - /* Allocation test */ void testmemory(double *realint); -/* Test open file */ -void testopenfile(FILE *fp); - #endif // define _TOOLSIO_H diff --git a/fftma_module/gen/lib_src/debuginput.c b/fftma_module/gen/lib_src/debuginput.c deleted file mode 100755 index b9c3a45..0000000 --- a/fftma_module/gen/lib_src/debuginput.c +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include -#include -#include -#include "genlib.h" -#include "geostat.h" -#include "toolsIO.h" - - -/* DebugInput */ -/* */ -/* Display the input data */ -/* seed: seed */ -/* grid: structure defining the actual grid */ -/* filename: name of files */ -/* variogram: struture defining the variogram model */ -/* stat: struture defining the mean and the variance of permeability realization */ -/* pression: structure defining the gradient pressure */ - -void debuginput(long *seed,struct grid_mod *grid,string filename[8],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,int *genere, int *gwnwrite) -{ - int i; - - - /* debug du 8/7/2002 */ - printf("\n\n"); - - printf("Starting seed (integer): %d\n",(*seed)); - printf("Number of cells along the X axis: %d\n",(*grid).NX); - printf("Number of cells along the Y axis: %d\n",(*grid).NY); - printf("Number of cells along the Z axis: %d\n",(*grid).NZ); - printf("cell length along the X axis: %6.4f\n",(*grid).DX); - printf("cell length along the Y axis: %6.4f\n",(*grid).DY); - printf("cell length along the Z axis: %6.4f\n",(*grid).DZ); - printf("Number of structures for the variogram: %d\n",(*variogram).Nvario); - i=0; - printf("Weight: %6.4f\n",(*variogram).var[i]); - printf("Type of variogram: %d\n",(*variogram).vario[i]); - printf("Exponent: %6.4f\n",(*variogram).alpha[i]); - - printf("Mean of the output realization: %15.8f\n",(*stat).mean[0]); - printf("Variance of the output realization: %6.4f\n",(*stat).variance[0]); - printf("Structure of the field (0-normal case 1-lognormal case 2-log10 case) : %d\n",(*stat).type); - - /*output files*/ - printf("output filename for permeability realization: %s\n", filename[1]); - printf("\n\n"); - if (*gwnwrite == 0) - { - printf("K field generation with Gaussian white noise!\n"); - printf("output filename for Gaussian white noise: %s\n",filename[0]); - } - printf("\n\n"); - if ((*Ksolver == 1) | (*Ksolver == 2)) - { - printf("P field generation: %d/n",*Ksolver); - printf("output filename for pressure realization: %s\n", filename[2]); - printf("output filename for pressure total realization: %s\n", filename[3]); - printf("output filename for x-velocity realization: %s\n", filename[4]); - printf("output filename for y-velocity realization: %s\n", filename[5]); - printf("output filename for z-velocity realization: %s\n", filename[6]); - printf("output filename for pressure gradient realization: %s\n", filename[7]); - - /*Pressure data*/ - printf("Pressure gradient in x direction: %6.4f\n",(*pression).x); - printf("Pressure gradient in y direction: %6.4f\n",(*pression).y); - printf("Pressure gradient in z direction: %6.4f\n",(*pression).z); - } - printf("\n\n"); - - return; -} diff --git a/fftma_module/gen/lib_src/inputdata.c b/fftma_module/gen/lib_src/inputdata.c deleted file mode 100755 index 6cc4d73..0000000 --- a/fftma_module/gen/lib_src/inputdata.c +++ /dev/null @@ -1,122 +0,0 @@ -#include -#include -#include -#include -#include -#include "genlib.h" -#include "simpio.h" -#include "geostat.h" -#include "toolsIO.h" - - - -/* Inputdata */ -/* */ -/* input data needed for realizations*/ -/* seed: seed */ -/* grid: structure defining the actual grid */ -/* filename: name of files */ -/* variogram: struture defining the variogram model */ -/* stat: struture defining the mean and the variance of permeability realization */ -/* pression: structure defining the gradient pressure */ - -void inputdata(long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression) -{ - int i,j; - - - /*seed*/ - printf("Starting sedsdsed (integer): \n"); - *seed = GetInteger(); - - /*Grid description*/ - printf("Number of cells along the X axis: \n"); - (*grid).NX = GetInteger(); - printf("Number of cells along the Y axis: \n"); - (*grid).NY = GetInteger(); - printf("Number of cells along the Z axis: \n"); - (*grid).NZ = GetInteger(); - printf("cell length along the X axis: \n"); - (*grid).DX = GetReal(); - printf("cell length along the Y axis: \n"); - (*grid).DY = GetReal(); - printf("cell length along the Z axis: \n"); - (*grid).DZ = GetReal(); - - /*output file*/ - printf("output filename for Gaussian white noise: \n"); - filename[0] = GetLine(); - - /*variogram description*/ - printf("Number of structures for the variogram: \n"); - (*variogram).Nvario = GetInteger(); - (*variogram).vario = (int *) malloc((*variogram).Nvario * sizeof(int)); - (*variogram).alpha = (double *) malloc((*variogram).Nvario * sizeof(double)); - (*variogram).ap = (double *) malloc(9*(*variogram).Nvario * sizeof(double)); - (*variogram).scf = (double *) malloc(3*(*variogram).Nvario * sizeof(double)); - (*variogram).var = (double *) malloc((*variogram).Nvario * sizeof(double)); - for (i= 0; i < (*variogram).Nvario; i++) { - printf("i %d\n",i); - printf("Weight: \n"); - (*variogram).var[i] = GetReal(); - printf("Type of variogram: \n"); - (*variogram).vario[i] = GetInteger(); - printf("Exponent: \n"); - (*variogram).alpha[i] = GetReal(); - printf("Correlation lengths (3): \n"); - for (j = 0; j < 3; j++) - (*variogram).scf[i*3+j]=GetReal(); - printf("Coordinates of the first two main axes (first axis first, then second): \n"); - for (j = 0; j < 6; j++) - (*variogram).ap[i*9+j] = GetReal(); - } - - /*statistical data*/ - (*stat).nblock_mean = 1; - (*stat).nblock_var = 1; - (*stat).mean = (double *)malloc((*stat).nblock_mean * sizeof(double)); - if ((*stat).mean == NULL) - Error("No memory available"); - (*stat).variance = (double *)malloc((*stat).nblock_var * sizeof(double)); - if ((*stat).variance == NULL) - Error("No memory available"); - printf("Mean of the output realization: \n"); - (*stat).mean[0] = GetReal(); - printf("Variance of the output realization: \n"); - (*stat).variance[0] = GetReal(); - printf("Structure of the field (0-normal case 1-lognormal case 2-log10 case) : \n"); - (*stat).type = GetInteger(); - - /*output file*/ - printf("output filename for permeability realization: \n"); - filename[1] = GetLine(); - - /*Pressure data*/ - printf("Macroscopic pressure gradient in x direction: \n"); - (*pression).x = GetReal(); - printf("Macroscopic pressure gradient in y direction: \n"); - (*pression).y = GetReal(); - printf("Macroscopic pressure gradient in z direction: \n"); - (*pression).z = GetReal(); - - - /*output pressure file*/ - printf("output filename for pressure realization: \n"); - filename[2] = GetLine(); - - /*output pressure totale file*/ - printf("output filename for total pressure realization: \n"); - filename[3] = GetLine(); - - /*output x-velocity file*/ - printf("output filename for x-velocity realization: \n"); - filename[4] = GetLine(); - /*output y-velocity file*/ - printf("output filename for y-velocity realization: \n"); - filename[5] = GetLine(); - /*output z-velocity file*/ - printf("output filename for z-velocity realization: \n"); - filename[6] = GetLine(); - - return; -} diff --git a/fftma_module/gen/lib_src/inputfiledata.c b/fftma_module/gen/lib_src/inputfiledata.c deleted file mode 100755 index 404d482..0000000 --- a/fftma_module/gen/lib_src/inputfiledata.c +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include -#include -#include -#include "genlib.h" -#include "simpio.h" -#include "geostat.h" -#include "toolsIO.h" - -void inputfiledata(string inputfile,long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression) -{ - FILE *fp; - int i,j; - - fp=fopen(inputfile,"r"); - if(fp== NULL) - { - printf("Erreur d'ouverture du fichier\n"); - exit(0); - } - *seed=atoi(ReadLine(fp)); - (*grid).NX = atoi(ReadLine(fp)); - (*grid).NY = atoi(ReadLine(fp)); - (*grid).NZ = atoi(ReadLine(fp)); - (*grid).DX = atof(ReadLine(fp)); - (*grid).DY = atof(ReadLine(fp)); - (*grid).DZ = atof(ReadLine(fp)); - filename[0] = ReadLine(fp); - (*variogram).Nvario = atoi(ReadLine(fp)); - - (*variogram).vario = (int *) malloc((*variogram).Nvario * sizeof(int)); - (*variogram).alpha = (double *) malloc((*variogram).Nvario * sizeof(double)); - (*variogram).ap = (double *) malloc(9*(*variogram).Nvario * sizeof(double)); - (*variogram).scf = (double *) malloc(3*(*variogram).Nvario * sizeof(double)); - (*variogram).var = (double *) malloc((*variogram).Nvario * sizeof(double)); - for (i= 0; i < (*variogram).Nvario; i++) { - (*variogram).var[i] = atof(ReadLine(fp)); - (*variogram).vario[i] = atoi(ReadLine(fp)); - (*variogram).alpha[i] = atof(ReadLine(fp)); - for (j = 0; j < 3; j++) - (*variogram).scf[i*3+j]= atof(ReadLine(fp)); - for (j = 0; j < 6; j++) - (*variogram).ap[i*9+j] = atof(ReadLine(fp)); - } - /*statistical data*/ - (*stat).nblock_mean = 1; - (*stat).nblock_var = 1; - (*stat).mean = (double *)malloc((*stat).nblock_mean * sizeof(double)); - if ((*stat).mean == NULL) - Error("No memory available"); - (*stat).variance = (double *)malloc((*stat).nblock_var * sizeof(double)); - if ((*stat).variance == NULL) - Error("No memory available"); - - (*stat).mean[0] = atof(ReadLine(fp)); - (*stat).variance[0] = atof(ReadLine(fp)); - (*stat).type = atoi(ReadLine(fp)); - - filename[1] = ReadLine(fp); - (*pression).x = atof(ReadLine(fp)); - (*pression).y = atof(ReadLine(fp)); - (*pression).z = atof(ReadLine(fp)); - filename[2] = ReadLine(fp); - filename[3] = ReadLine(fp); - filename[4] = ReadLine(fp); - filename[5] = ReadLine(fp); - filename[6] = ReadLine(fp); - fclose(fp); - return; -} diff --git a/fftma_module/gen/lib_src/readfile_bin.c b/fftma_module/gen/lib_src/readfile_bin.c deleted file mode 100755 index ee61e0e..0000000 --- a/fftma_module/gen/lib_src/readfile_bin.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "genlib.h" -#include "geostat.h" - -/*readfile */ -/* read in the file "filename" the vector values of a */ -/* realization_mod variable */ -/* filename: explicit */ -/* realin: structure defining a realization */ - -void readfile_bin(string filename, struct realization_mod *realin) -{ - FILE *fp; - int i; - double prout; - - printf("readfile_bin\n"); - - /*read the permeability realization*/ - - - fp = fopen(filename, "r"); - - for (i=0;i<(*realin).n;i++) - { - fread(&prout,sizeof(double),1,fp); - printf("Prout: %15.10f\n",prout); - } - - fclose(fp); - return; -} diff --git a/fftma_module/gen/lib_src/test_fact.c b/fftma_module/gen/lib_src/test_fact.c index d2456ee..78e9dbd 100755 --- a/fftma_module/gen/lib_src/test_fact.c +++ b/fftma_module/gen/lib_src/test_fact.c @@ -3,6 +3,7 @@ /*tries factor*/ int test_fact(int *pnum, int fact, int *pmaxfac) { + printf("test_fact\n"); int power, t; power = 0; diff --git a/fftma_module/gen/lib_src/testmemory.c b/fftma_module/gen/lib_src/testmemory.c index 7cbd10e..707044f 100755 --- a/fftma_module/gen/lib_src/testmemory.c +++ b/fftma_module/gen/lib_src/testmemory.c @@ -7,6 +7,7 @@ void testmemory(double *realint) { + printf("testmemory\n"); if (realint == NULL) { printf("Testmemory.c: No memory available \n"); exit; diff --git a/fftma_module/gen/lib_src/testopenfile.c b/fftma_module/gen/lib_src/testopenfile.c deleted file mode 100755 index dee13a8..0000000 --- a/fftma_module/gen/lib_src/testopenfile.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include -#include -#include - -void testopenfile(FILE *fp) -{ - if (fp == NULL) - { - printf("Erreur d'ouverture de fichier\n"); - exit(0); - } - return; -} diff --git a/fftma_module/gen/lib_src/toolsIO.h b/fftma_module/gen/lib_src/toolsIO.h index e2ae0db..0a92d52 100755 --- a/fftma_module/gen/lib_src/toolsIO.h +++ b/fftma_module/gen/lib_src/toolsIO.h @@ -12,61 +12,13 @@ /* List of functions: */ /* ------------------ */ -/* readfile_bin,inputdata,inputfiledata,readdata,debuginput */ -/* testmemory, testopenfile */ +/* testmemory */ /*FUNCTIONS*/ /*----------*/ -/* Lecture dans un fichier */ - -/* Inputdata */ -/* */ -/* input data needed for realizations*/ -/* seed: seed */ -/* grid: structure defining the actual grid */ -/* filename: name of files */ -/* variogram: struture defining the variogram model */ -/* stat: struture defining the mean and the variance of permeability realization */ -/* pression: structure defining the gradient pressure */ - -void inputdata(long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression); - -void inputfiledata(string inputfile,long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression); - -/* void readdata(long *seed,struct grid_mod *grid,string filename[8],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,struct realization_mod *Kfield, char *argv[]); */ - -void readdata(long *seed,struct grid_mod *grid,string filename[8],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,int *genere, int *gwnwrite, struct realization_mod *Kfield,struct realization_mod *gwnoise, char *argv[]); - -void readdata2(long *seed,struct grid_mod *grid,string filename[8],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,int *genere, int *gwnwrite, int *format_file, struct realization_mod *Kfield,struct realization_mod *gwnoise, char *argv[]); - -void readdata3(long *seed,struct grid_mod *grid,string filename[8],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,int *genere, int *gwnwrite, int *format_file,int *Psolver, struct realization_mod *Kfield,struct realization_mod *gwnoise, char *argv[]); - -/* readfile_bin */ -/* */ -/* read in the file "filename" the vector values of a */ -/* realization_mod variable */ -/* filename: explicit */ -/* realin: structure defining a realization */ - -void readfile_bin(string filename, struct realization_mod *realin); - -/* DebugInput */ -/* */ -/* Display the input data */ -/* seed: seed */ -/* grid: structure defining the actual grid */ -/* filename: name of files */ -/* variogram: struture defining the variogram model */ -/* stat: struture defining the mean and the variance of permeability realization */ -/* pression: structure defining the gradient pressure */ -void debuginput(long *seed,struct grid_mod *grid,string filename[7],struct vario_mod *variogram,struct statistic_mod *stat,struct pressure_mod *pression,int *Ksolver,int *genere, int *gwnwrite); - /* Allocation test */ void testmemory(double *realint); -/* Test open file */ -void testopenfile(FILE *fp); - #endif // define _TOOLSIO_H diff --git a/fftma_module/gen/setup.py b/fftma_module/gen/setup.py index fad607e..f445552 100644 --- a/fftma_module/gen/setup.py +++ b/fftma_module/gen/setup.py @@ -42,12 +42,7 @@ module_FFTMA = Extension( "./lib_src/build_pressure.c", "./lib_src/build_velocity.c", "./lib_src/mat_vec.c", - "./lib_src/inputdata.c", - "./lib_src/inputfiledata.c", - "./lib_src/debuginput.c", - "./lib_src/readfile_bin.c", "./lib_src/testmemory.c", - "./lib_src/testopenfile.c", "./lib_src/genlib.c", ], )