milestone_5_without_improvements
Oli 3 years ago
parent 6b97a9dfeb
commit f152649da5

@ -48,9 +48,6 @@ int Py_getvalues(PyObject* args, long* seed,struct grid_mod* grid,struct vario_m
PyObject* vgr;
//char* gwnfilename;
printf("Py_getvalues\n");
stat->nblock_mean=1;
stat->nblock_var=1;
stat->mean=(double*)malloc(stat->nblock_mean * sizeof(double));

@ -22,9 +22,6 @@ void Py_kgeneration(long seed,struct grid_mod grid,struct statistic_mod stat,st
int i,N;
int typelog;
printf("\nESTOYdsds ACAAAAA\n");
/*generate Gaussian white noise*/
N = grid.NX*grid.NY*grid.NZ;
n[0] = 0;

@ -1,16 +0,0 @@
#include <Python.h>
#include <numpy/arrayobject.h>
#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"
int Py_getvalues(PyObject*, long*, struct grid_mod*, struct vario_mod*, struct statistic_mod*);
void Py_kgeneration(long,struct grid_mod,struct statistic_mod,struct vario_mod,struct realization_mod*,struct realization_mod*,struct realization_mod*, int [3]);

@ -23,9 +23,6 @@ void build_real(int n[3],int NTOT,double *covar,double *realization,double *irea
int i,j,k,maille1;
double temp;
printf("build real\n");
/*decomposition and multiplication in the spectral domain*/
for ( k = 1; k <= n[2]; k++) {
for (j = 1; j <= n[1]; j++) {

@ -15,8 +15,6 @@ void cgrid(struct vario_mod variogram, struct grid_mod grid, int n[3])
int i,N;
double D;
printf("cgrid\n");
if (n == NULL || n[0] == 0 || n[1] == 0 || n[2] == 0) {
for (i = 0; i<3; i++) {
switch (i) {

@ -11,8 +11,6 @@ void clean_real(struct realization_mod *realin,int n[3],struct grid_mod grid,dou
int i,j,k,maille0,maille1;
double NTOT;
printf("clean_real\n");
NTOT=n[0]*n[1]*n[2];
/*is the output realization already allocated?*/
/*if not, memory allocation*/

@ -9,9 +9,6 @@ double cov_value(struct vario_mod variogram,double di,double dj,double dk)
double cov;
int k;
//printf("cov_valueds\n");
cov = 0.;
for (k = 0; k < variogram.Nvario; k++) {

@ -8,9 +8,6 @@ void covariance(double *covar, struct vario_mod variogram, struct grid_mod mesh,
int i,j,k,maille,n2[3],symmetric;
double di,dj,dk;
printf("covaridsdsadsncdse\n");
for (i=0;i<3;i++)
n2[i] = n[i]/2;

@ -8,8 +8,6 @@ double cubic(double h)
{
double z;
printf("cubidsc\n");
if (h >= 1.) {
z = 0.;
} else {

@ -5,6 +5,5 @@
/*exponential covariance function*/
double exponential(double h)
{
//printf("exponential\n");
return (exp(-3.*(double)h));
}

@ -29,8 +29,6 @@ void FFTMA2(struct vario_mod variogram,struct grid_mod grid,int n[3],struct real
double temp;
double *ireal,*covar,*workr,*worki,*realization;
printf("no puede haber tanto\n");
/*covariance axis normalization*/
axes(variogram.ap,variogram.scf,variogram.Nvario);

@ -95,7 +95,6 @@ void fourt(double *datar,double *datai, int nn[3], int ndim, int ifrwd, int icpl
int ifact[21],ntot,idim,np1,n,np2,m,ntwo,iff,idiv,iquot,irem,inon2,non2p,np0,nprev,icase,ifmin,i,j,jmax,np2hf,i2,i1max,i3,j3,i1,ifp1,ifp2,i2max,i1rng,istep,imin,imax,mmax,mmin,mstep,j1,j2max,j2,jmin,j3max,nhalf;
double theta,wstpr,wstpi,wminr,wmini,wr,wi,wtemp,thetm,wmstr,wmsti,twowr,sr,si,oldsr,oldsi,stmpr,stmpi,tempr,tempi,difi,difr,sumr,sumi,TWOPI = 6.283185307179586476925286766559;
printf("fourt\n");
ntot = 1;
for (idim = 0; idim < ndim; idim++) {
ntot *= nn[idim];

@ -6,7 +6,6 @@
/*gamma covariance function*/
double gammf(double h, double alpha)
{
printf("gadsmmf\n");
float delta;
double z;

@ -8,7 +8,6 @@ double gasdev(long *idum,long *idum2, long *iy, long iv[NTAB])
/*and unit variance, using ran2(idum) as the source */
/*of uniform deviates */
{
//printf("gasdev\n");
double ran2(long *idum,long *idum2, long *iy, long iv[NTAB]);
static int iset = 0;
static double gset;

@ -17,8 +17,6 @@ void generate(long *seed, int n, struct realization_mod *realization)
long *iv;
int iset =0;
printf("ESROY EN ESTE GENERATE\n");
iv = (long *) malloc(NTAB * sizeof(long));
/*negative seed*/

@ -25,8 +25,6 @@ void prebuild_gwn(struct grid_mod grid,int n[3],struct realization_mod *realin,d
int i,j,k,maille0,maille1;
int ntot;
printf("por favor\n");
ntot=n[0]*n[1]*n[2];
realization[0]=0.;
if (solver==1)
@ -42,13 +40,9 @@ void prebuild_gwn(struct grid_mod grid,int n[3],struct realization_mod *realin,d
for (j = 1; j <= n[1]; j++) {
for (i = 1; i <= n[0]; i++) {
maille1 = i+(j-1+(k-1)*n[1])*n[0];
//printf("n[1] es %d y grid.NY %d\n", n[1], grid.NY);
//printf("n[0] es %d y grid.NX %d\n", n[0], grid.NX);
if (i <= grid.NX && j <= grid.NY && k <= grid.NZ) {
maille0 = i-1+(j-1+(k-1)*grid.NY)*grid.NX;
//printf("maille0: %d\n", maille0);
realization[maille1] = (*realin).vector[maille0];
//printf("en realization maille1 %d pos guarde %f\n", maille1, realization[maille1]);
} else {
realization[maille1] = 0.;
}

@ -18,7 +18,6 @@
double ran2(long *idum, long *idum2, long *iy, long iv[NTAB])
{
//printf("ran2\n");
int j;
long k;
double temp;

@ -53,14 +53,12 @@ scannerADT NewScanner(void)
void FreeScanner(scannerADT scanner)
{
printf("FreeScanner llama a FreeBlock\n");
if (scanner->str != NULL) FreeBlock(scanner->str);
FreeBlock(scanner);
}
void SetScannerString(scannerADT scanner, string str)
{
printf("SetScannerString llama a FreeBlock\n");
if (scanner->str != NULL) FreeBlock(scanner->str);
scanner->str = CopyString(str);
scanner->len = StringLength(str);
@ -70,7 +68,6 @@ void SetScannerString(scannerADT scanner, string str)
string ReadToken(scannerADT scanner)
{
printf("readtoken\n");
char ch;
string token;
int start, finish;

@ -40,8 +40,6 @@ int GetInteger(void)
int value;
char termch;
printf("getinteger\n");
while (TRUE) {
line = GetLine();
switch (sscanf(line, " %d %c", &value, &termch)) {

@ -8,8 +8,6 @@ double spherical(double h)
{
double z;
printf("spherical\n");
if (h >= 1.) {
z = 0.;
} else {

@ -3,7 +3,6 @@
/*tries factor*/
int test_fact(int *pnum, int fact, int *pmaxfac)
{
printf("test_fact\n");
int power, t;
power = 0;

@ -7,7 +7,6 @@
void testmemory(double *realint)
{
printf("testmemory\n");
if (realint == NULL) {
printf("Testmemory.c: No memory available \n");
exit;

@ -32,9 +32,6 @@ static PyObject* genFunc(PyObject* self, PyObject* args)
PyObject* out_array;
npy_intp out_dims[NPY_MAXDIMS];
printf("estoy edsdsdn genfunc\n");
if(!Py_getvalues(args, &seed, &grid, &variogram, &stat)) return NULL;
Py_kgeneration(seed,grid,stat,variogram,&Z,&Y,&Y1,n);

Loading…
Cancel
Save