#include #include #include #include #include #include #include "geostat.h" #include "pressure.h" /* Build_velocity */ /* Build velocity in spectral domain */ void build_velocity(int n[3],struct grid_mod grid,struct statistic_mod stat,struct pressure_mod gradient,double *realization,double *ireal,double *xvelocity,double *ixvelocity,int direction) { int i,j,k,maille1; int x,y,z; double ki,kj,kk; double coeff,temp,temp2; double grad; /* x-direction velocity calculation in the spectral domain*/ switch(direction) { case 1: grad = gradient.x; x=1; y=0; z=0; break; case 2: grad = gradient.y; x=0; y=1; z=0; break; case 3: grad = gradient.z; x=0; y=0; z=1; break; default : printf("build_velocity.c: wrong velocity direction!!! direction: %d\n",direction); break; } for ( k = 1; k <= n[2]; k++) { for (j = 1; j <= n[1]; j++) { for (i = 1; i <= n[0]; i++) { maille1 = i+(j-1+(k-1)*n[1])*n[0]; /* if (i