You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simulacion-permeabilidad/fftma_module/gen/sources/pgeneration.c

49 lines
1.5 KiB
C

#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 "pressure.h"
#include "toolsIO.h"
void pgeneration(int n[3],struct grid_mod grid,struct statistic_mod stat,struct vario_mod variogram,string filename[7],struct pressure_mod pression,struct realization_mod *Y,struct realization_mod *P,struct realization_mod *VX,struct realization_mod *VY,struct realization_mod *VZ, int solver)
{
int i,ntot;
struct realization_mod GP;
FFTPressure(n,grid,Y,stat,pression,P,VX,VY,VZ,solver);
/*save the delta-pressure realization*/
writefile(filename[2],P);
total_pressure(grid,pression,P);
total_velocity(grid,stat.mean[0],1,pression,VX);
total_velocity(grid,stat.mean[0],2,pression,VY);
total_velocity(grid,stat.mean[0],3,pression,VZ);
/*save the total pressure realization*/
writefile(filename[3],P);
/*save the x-velocity realization*/
writefile(filename[4],VX);
/*save the y-velocity realization*/
writefile(filename[5],VY);
/*save the z-velocity realization*/
writefile(filename[6],VZ);
ntot=grid.NX*grid.NY*grid.NZ;
GP.vector = (double *) malloc(ntot * sizeof(double));
testmemory(GP.vector);
GP.n= ntot-1;
for (i = 0; i < ntot-1; i++)
{
GP.vector[i]=(*P).vector[i]-(*P).vector[i-1];
}
/*save the pressure gradient realization*/
writefile(filename[7],&GP);
return;
}