rm files
parent
15a19c5935
commit
e01ef454b0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,79 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "genlib.h"
|
|
||||||
#include "simpio.h"
|
|
||||||
#include "geostat.h"
|
|
||||||
#include "toolsIO.h"
|
|
||||||
#include "toolsFFTMA.h"
|
|
||||||
|
|
||||||
/* kgeneration */
|
|
||||||
/* Z is the GWN with 0-mean and 1-variance */
|
|
||||||
/* Y1 is the realization with 0-mean and variance wanted */
|
|
||||||
/* Y is the realization with mean and variance wanted */
|
|
||||||
|
|
||||||
void kgeneration(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 i,N;
|
|
||||||
int typelog;
|
|
||||||
string file1,file2;
|
|
||||||
|
|
||||||
/*generate Gaussian white noise*/
|
|
||||||
N = grid.NX*grid.NY*grid.NZ;
|
|
||||||
n[0] = 0;
|
|
||||||
n[1] = 0;
|
|
||||||
n[2] = 0;
|
|
||||||
printf("\n\n\n");
|
|
||||||
|
|
||||||
switch (*genere)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
generate(&seed,N,Z);
|
|
||||||
/*save the Gaussian white noise file*/
|
|
||||||
if (*gwnwrite == 0)
|
|
||||||
{
|
|
||||||
writefile(filename[0],Z);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
(*Z).vector=(double *) malloc(N*sizeof(double));
|
|
||||||
(*Z).n = N;
|
|
||||||
for (i=0;i<N;i++)
|
|
||||||
{
|
|
||||||
(*Z).vector[i]=(*gwnoise).vector[i];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*FFTMA*/
|
|
||||||
FFTMA2(variogram,grid,n,Z,Y);
|
|
||||||
|
|
||||||
/* file1="prout"; */
|
|
||||||
/* writefile(file1,Y); */
|
|
||||||
|
|
||||||
/*add the statistics*/
|
|
||||||
//if (stat.mean[0] != 0 || stat.variance[0]!= 1)
|
|
||||||
//addstat2(Y,stat,Y1,Y);
|
|
||||||
|
|
||||||
/* file2="prout2"; */
|
|
||||||
/* writefile(file2,Y); */
|
|
||||||
|
|
||||||
/* make a log normal realization */
|
|
||||||
if (stat.type==1 || stat.type==2){
|
|
||||||
typelog=stat.type+2;
|
|
||||||
nor2log(Y1,typelog,Y1);
|
|
||||||
nor2log(Y,typelog,Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*save the realization*/
|
|
||||||
/* writefile(filename[0],Y1); */
|
|
||||||
|
|
||||||
/*save the permeability realization*/
|
|
||||||
writefile_bin(filename[1],Y);
|
|
||||||
readfile_bin(filename[1],Y);
|
|
||||||
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
@ -1,76 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "genlib.h"
|
|
||||||
#include "simpio.h"
|
|
||||||
#include "geostat.h"
|
|
||||||
#include "toolsIO.h"
|
|
||||||
#include "toolsFFTMA.h"
|
|
||||||
|
|
||||||
/* kgeneration */
|
|
||||||
/* Z is the GWN with 0-mean and 1-variance */
|
|
||||||
/* Y1 is the realization with 0-mean and variance wanted */
|
|
||||||
/* Y is the realization with mean and variance wanted */
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
int i,N;
|
|
||||||
int typelog;
|
|
||||||
string file1,file2;
|
|
||||||
|
|
||||||
/*generate Gaussian white noise*/
|
|
||||||
N = grid.NX*grid.NY*grid.NZ;
|
|
||||||
n[0] = 0;
|
|
||||||
n[1] = 0;
|
|
||||||
n[2] = 0;
|
|
||||||
printf("\n\n\n");
|
|
||||||
|
|
||||||
switch (*genere)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
generate(&seed,N,Z);
|
|
||||||
/*save the Gaussian white noise file*/
|
|
||||||
if (*gwnwrite == 0)
|
|
||||||
{
|
|
||||||
writefile(filename[0],Z);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
(*Z).vector=(double *) malloc(N*sizeof(double));
|
|
||||||
(*Z).n = N;
|
|
||||||
for (i=0;i<N;i++)
|
|
||||||
{
|
|
||||||
(*Z).vector[i]=(*gwnoise).vector[i];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*FFTMA*/
|
|
||||||
FFTMA2(variogram,grid,n,Z,Y);
|
|
||||||
|
|
||||||
/*add the statistics*/
|
|
||||||
//if (stat.mean[0] != 0 || stat.variance[0]!= 1)
|
|
||||||
//addstat2(Y,stat,Y1,Y);
|
|
||||||
|
|
||||||
/* make a log normal realization */
|
|
||||||
if (stat.type==1 || stat.type==2){
|
|
||||||
|
|
||||||
typelog=stat.type+2;
|
|
||||||
/* nor2log(Y1,typelog,Y1); */
|
|
||||||
nor2log(Y,typelog,Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (*format_file)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
writefile(filename[1],Y);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
writefile_bin(filename[1],Y);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "geostat.h"
|
|
||||||
#include "pressure.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* total_pressure */
|
|
||||||
/* Build total pressure */
|
|
||||||
/* grid: structure defining the grid */
|
|
||||||
/* pression: structure defining the gradient pressure */
|
|
||||||
/* realout: structure defining a realization */
|
|
||||||
|
|
||||||
void total_pressure(struct grid_mod grid,struct pressure_mod gradient,struct realization_mod *realout)
|
|
||||||
{
|
|
||||||
int i,j,k,maille0,maille1;
|
|
||||||
double temp,reference;
|
|
||||||
|
|
||||||
reference=abs(gradient.x)*grid.NX*grid.DX+abs(gradient.y)*grid.NY*grid.DY+abs(gradient.z)*grid.NZ*grid.DZ;
|
|
||||||
/* pressure reconstruction */
|
|
||||||
for ( k = 0; k < grid.NZ; k++) {
|
|
||||||
for (j = 0; j < grid.NY; j++) {
|
|
||||||
for (i = 0; i < grid.NX; i++) {
|
|
||||||
maille1 = i+(j+k*grid.NY)*grid.NX;
|
|
||||||
/* temp=reference+gradient.x*i*grid.DX+gradient.y*j*grid.DY+gradient.z*k*grid.DZ+(*realout).vector[maille1]; */
|
|
||||||
temp=-gradient.x*(i+1)/grid.NX-gradient.y*(j+1)/grid.NY-gradient.z*(k+1)/grid.NZ+(*realout).vector[maille1];
|
|
||||||
(*realout).vector[maille1]=temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
Loading…
Reference in New Issue