Linter to c files

milestone_5_without_improvements
chortas 3 years ago
parent 83d7d29273
commit 4fd1d5ddc6

@ -1,16 +1,15 @@
#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 "simpio.h"
#include "toolsIO.h"
#include <Python.h>
#include <numpy/arrayobject.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.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]);

@ -3,8 +3,6 @@
#ifndef _CONDOR_H_
#define _CONDOR_H_
/*=======================================================*/
/*FUNCTIONS*/
/*---------*/
@ -25,7 +23,6 @@
/*realout: structure defining the output realization */
void condit(int k, struct welldata_mod well, struct vario_mod variogram, struct grid_mod grid, struct realization_mod* realin, struct realization_mod* realout);
/*d_kriging */
/*interpolation from ponctual data with simple dual */
/*kriging. d_kriging is used to interpolate standard */
@ -40,7 +37,6 @@ void condit(int k,struct welldata_mod well,struct vario_mod variogram,struct gri
/*realout: structure defining the output realization */
void d_kriging(int k, struct welldata_mod well, struct vario_mod variogram, struct grid_mod grid, struct realization_mod* realout);
/*dual_condit */
/*conditioning of a Gaussian realization using */
/*the dual kriging approach */
@ -56,7 +52,6 @@ void d_kriging(int k,struct welldata_mod well,struct vario_mod variogram,struct
/*realout: structure defining the output realization */
void dual_condit(int k, struct welldata_mod well, struct vario_mod variogram, struct grid_mod grid, struct realization_mod* realin, struct realization_mod* realout);
/*dual_condit_gen */
/*conditioning of a Gaussian realization using */
/*the dual kriging approach */
@ -101,7 +96,6 @@ void dual_condit_gen(int k,struct welldata_mod wellin,struct vario_mod variogram
/*DYoverDRHO : structure with the output gradients */
void FFTMA_gradient(struct vario_mod variogram, struct grid_mod grid, int n[3], struct realization_mod* realin, struct gradients_mod* DZoverDRHO, struct realization_mod* realout, struct gradients_mod* DYoverDRHO);
/* GENERATION OF A GAUSSIAN WHITE NOISE VECTOR */
/*input: */
/* seed: seed */
@ -112,7 +106,6 @@ void generate(long *seed, int n, struct realization_mod *realization);
void ikrig(int option, struct statfacies_mod facies, int kk, struct welldata_mod data, struct variotable_mod variogram, struct grid_mod grid, float* krigout);
/*kriging */
/*interpolation from ponctual data with simple */
/*kriging. kriging is used to interpolate standard */
@ -127,7 +120,6 @@ void ikrig(int option, struct statfacies_mod facies, int kk,struct welldata_mod
/*realout: structure defining the output realization */
void kriging(int k, struct welldata_mod data, struct vario_mod variogram, struct grid_mod grid, struct realization_mod* realout);
/*CHOLESKY SIMULATION TECHNIQUE - LUSIM */
/*appropriate for regular grids and small number */
/*of points */
@ -139,7 +131,6 @@ void kriging(int k,struct welldata_mod data,struct vario_mod variogram,struct gr
/*realout: structure defining a realization - */
void LUSIM(struct vario_mod variogram, struct grid_mod grid, struct realization_mod* realin, struct realization_mod* realout);
void nor2any(struct cdf_mod* pcumulf, struct realization_mod* realin, struct realization_mod* realout);
/*TURNS NORMAL NUMBERS INTO LOGNORMAL NUMBERS */
@ -153,7 +144,6 @@ void nor2any(struct cdf_mod *pcumulf,struct realization_mod *realin,struct reali
/* lognormal numbers */
void nor2log(struct realization_mod* realin, int typelog, struct realization_mod* realout);
/*TURNS NORMAL NUMBERS INTO UNIFORM NUMBERS */
/*input: */
/*realin: structure defining a realization - */
@ -163,7 +153,6 @@ void nor2log(struct realization_mod *realin, int typelog, struct realization_mod
/* uniform numbers */
void nor2unif(struct realization_mod* realin, struct realization_mod* realout);
/*o_kriging */
/*interpolation from ponctual data with ordinary kriging */
/*o_kriging is used to interpolate standard Gaussian data*/
@ -177,7 +166,6 @@ void nor2unif(struct realization_mod *realin,struct realization_mod *realout);
/*realout: structure defining the kriged realization */
void o_kriging(int k, struct vario_mod variogram, struct welldata_mod data, struct grid_mod grid, struct realization_mod* realout);
/*od_kriging */
/*interpolation from ponctual data with ordinary dual*/
/*kriging. od_kriging is used to interpolate */
@ -192,7 +180,6 @@ void o_kriging(int k,struct vario_mod variogram,struct welldata_mod data,struct
/*realout: structure defining the output realization */
void od_kriging(int k, struct welldata_mod well, struct vario_mod variogram, struct grid_mod grid, struct realization_mod* realout);
/*PLURIGAUSSIAN METHOD */
/*Starting from two independent Gaussian realizations Y1*/
/*and Y2 with zero mean and unit variance, but possibly */
@ -214,7 +201,6 @@ void od_kriging(int k,struct welldata_mod well,struct vario_mod variogram,struct
/*Y: output realization */
void plurigau(struct statfacies_mod facies, struct inequalities_mod ineq, struct realization_mod* Y1, struct realization_mod* Y2, struct realization_mod* Y);
/*tr_kriging */
/*kriging with an external drift */
/*The trend is limited to a 2-term function */
@ -231,7 +217,6 @@ void plurigau(struct statfacies_mod facies,struct inequalities_mod ineq,struct r
/*realout: kriged realization */
void tr_kriging(int k, struct vario_mod variogram, struct welldata_mod data, struct grid_mod grid, struct realization_mod* Y, struct realization_mod* realout);
/*truncat */
/*TRUNCATES A STANDARD GAUSSIAN REALIZATION */
/*WITH THE TRUNCATED GAUSSIAN METHOD */
@ -248,7 +233,6 @@ void tr_kriging(int k, struct vario_mod variogram,struct welldata_mod data,struc
/* to the facies volume fractions if*/
void truncat(struct statfacies_mod facies, struct realization_mod* realin, struct realization_mod* realout, struct statfacies_mod* thresholds);
/*TURNS UNIFORM NUMBERS INTO NORMAL NUMBERS*/
/*INPUT: */
/*realin: structure defining a realization - */
@ -258,7 +242,6 @@ void truncat(struct statfacies_mod facies,struct realization_mod *realin,struct
/* must have zero mean and unit variance */
void unif2nor(struct realization_mod* realin, struct realization_mod* realout);
/*Wany2nor */
/*converts any kind of continuous data to Gaussian data*/
/*INPUT: */
@ -271,7 +254,6 @@ void unif2nor(struct realization_mod *realin,struct realization_mod *realout);
/* cumulative distribution */
void Wany2nor(int k, struct welldata_mod wellin, long* seed, struct welldata_mod* wellout, struct cdf_mod* pcumulf);
/*Wfac2nor0 */
/*turns the facies well measurements into Gaussian data */
/*intervals only are respected - spatial variability is */
@ -290,7 +272,6 @@ void Wany2nor(int k, struct welldata_mod wellin, long *seed,struct welldata_mod
/*of measures are converted to standard normal data */
void Wfac2nor0(int k, struct grid_mod grid, struct welldata_mod wellin, struct statfacies_mod facies, long* seed, struct welldata_mod* wellout);
/*Wfac2nor1 */
/*turns the facies well measurements into Gaussian data */
/*Proceeds in 2 steps */
@ -310,7 +291,6 @@ void Wfac2nor0(int k,struct grid_mod grid,struct welldata_mod wellin,struct stat
/*of measures are converted to standard normal data */
void Wfac2nor1(int k, struct vario_mod variogram, struct grid_mod grid, struct welldata_mod wellin, struct statfacies_mod facies, long* seed, struct welldata_mod* wellout);
/*Wfac2norPG0 */
/*turns the facies well measurements into Gaussian data */
/*intervals only are respected - spatial variability is */
@ -334,7 +314,6 @@ void Wfac2nor1(int k,struct vario_mod variogram,struct grid_mod grid,struct well
/*of measures are converted to standard normal data */
void Wfac2norPG0(int k, struct inequalities_mod ineq, struct grid_mod grid, struct welldata_mod wellin, struct statfacies_mod facies, long* seed, int idreal, struct welldata_mod* wellout);
/*Wfac2norPG1 */
/*turns the facies well measurements into Gaussian data */
/*Proceeds in 2 steps */
@ -363,7 +342,6 @@ void Wfac2norPG0(int k,struct inequalities_mod ineq,struct grid_mod grid,struct
/*realization 2 - the kth vector */
void Wfac2norPG1(int k, struct inequalities_mod ineq, struct vario_mod variogram1, struct vario_mod variogram2, struct grid_mod grid, struct welldata_mod wellin, struct statfacies_mod facies, long* seed, struct welldata_mod* wellout1, struct welldata_mod* wellout2);
/*Wlog2nor */
/*turns the log well measurements into std Gaussian data*/
/*This step is required before performing kriging */
@ -379,7 +357,6 @@ void Wfac2norPG1(int k,struct inequalities_mod ineq,struct vario_mod variogram1,
/*of measures are converted to standard normal data */
void Wlog2nor(int k, struct welldata_mod wellin, struct grid_mod grid, struct statistic_mod stat, struct welldata_mod* wellout);
/*Wnor2nor */
/*converts Well Normal numbers to the standard Gaussian */
/*input: */
@ -392,7 +369,6 @@ void Wlog2nor(int k, struct welldata_mod wellin,struct grid_mod grid,struct stat
/*of measures are converted to standard normal data */
void Wnor2nor(int k, struct welldata_mod wellin, struct grid_mod grid, struct statistic_mod stat, struct welldata_mod* wellout);
/*Wunif2nor */
/*converts Well uniform numbers to the standard Gaussian*/
/*input: */
@ -403,6 +379,4 @@ void Wnor2nor(int k, struct welldata_mod wellin,struct grid_mod grid,struct stat
/*of measures are converted to standard normal data */
void Wunif2nor(int k, struct welldata_mod wellin, struct welldata_mod* wellout);
#endif // define _CONDOR_H_

@ -25,9 +25,9 @@
#ifndef _genlib_h
#define _genlib_h
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
/* Section 1 -- Define new "primitive" types */

@ -1,8 +1,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#ifndef _GEOSTAT_H
#define _GEOSTAT_H
@ -27,7 +26,6 @@
/* cdf_mod */
/* realization_mod */
/* List of functions: */
/* ------------------ */
@ -44,9 +42,6 @@
/* test_fract, trun1, trungasdev,vec_vec, */
/* vf2gthres,polint */
/*STRUCTURES*/
/*----------*/
/*variogram */
@ -75,8 +70,6 @@ struct vario_mod {
double* var;
};
/*variogram table */
/*Nvario: number of combined variogram models */
/*vario: model of variogram per variogram model */
@ -104,11 +97,6 @@ struct variotable_mod {
float* var;
};
/*grid */
/*NX: number of gridblocks along the X axis*/
/*NY: number of gridblocks along the Y axis*/
@ -125,7 +113,6 @@ struct grid_mod {
double Xo, Yo, Zo;
};
/*well data */
/*nwell: number of wells */
/*n: number of measurement points per well */
@ -164,8 +151,6 @@ struct welldata_mod {
float* measure;
};
/*volume fractions for facies */
/*ncat: number of facies */
/*nblock: number of gridblocks with different */
@ -180,7 +165,6 @@ struct statfacies_mod {
float* vf;
};
/*inequalities for truncated plurigaussian realizations*/
/*only two basic realizations Y1 and Y2 are considered */
/*Y1 and Y2 are independent */
@ -210,7 +194,6 @@ struct inequalities_mod {
int* address_sY2;
};
/*statistical data */
/*type --> 0 : normal */
/* --> 1 : natural log */
@ -235,7 +218,6 @@ struct statistic_mod {
double* variance;
};
/*gradual deformation parameters */
/*Nadded: number of complementary realizations */
/*NZONES: number of subregions */
@ -251,7 +233,6 @@ struct grad_mod {
int *cellini, *cellfin;
};
/*gradient structures */
/*Nparam : number of parameters for which gradients are */
/* required */
@ -268,8 +249,6 @@ struct gradients_mod {
float* grad;
};
/*description of discretized cumulative distributions */
/*n: number of points */
/*x: values along the x axis i = [0...n-1] */
@ -281,7 +260,6 @@ struct cdf_mod {
float* fx;
};
/*realization */
/*n: number of components */
/*code: status of the realization */
@ -312,18 +290,15 @@ struct realization_mod {
/*FUNCTIONS*/
/*---------*/
/*normalization of the anostropy axes */
/*ap: anisotropy axes */
/*scf: correlation lengths */
/* The returned normalized axes are in ap */
void axes(double* ap, double* scf, int N);
/*cardsin covariance value for lag h*/
double cardsin(double h);
/*Cholesky decomposition of matrix C */
/* C : symetric positive-definite matrix recorded */
/* (per raws) as a vector with only components */
@ -333,7 +308,6 @@ double cardsin(double h);
/* C is turned into the lower triangular cholesky matrix*/
void choldc(double* C, int n);
/*computes the coordinates of a given cell */
/*as numbers of cells along the X,Y and Z axes*/
/*maille = i[0]+1+i[1]*NX+i[2]*NX*NY */
@ -344,7 +318,6 @@ void choldc(double *C, int n);
/*i: vector with the coordinates */
void coordinates(int maille, int i[3], struct grid_mod grid);
/*builds the sampled covariance function */
/*dimensions are even */
/*covar: covariance array, vector of size*/
@ -365,7 +338,6 @@ void covariance(double *covar,struct vario_mod variogram, struct grid_mod grid,
/*grid: structure defined above */
void cov_matrix(double* C, struct vario_mod variogram, struct welldata_mod well, struct grid_mod grid);
/*calculation of the covariance value for a distance h */
/*defined by i,j,k */
/*available variogram model: */
@ -388,7 +360,6 @@ double cov_value(struct vario_mod variogram,double di,double dj,double dk);
/*cubic covariance value for lag h*/
double cubic(double h);
/*truncation of the power spectrum to remove */
/*high frequencies - isotropic case */
/*covar: power spectrum */
@ -398,7 +369,6 @@ double cubic(double h);
/*n[3]: number of cells along the X, Y and Z axes*/
void cutspectr(float* covar, int kx, int ky, int kz, int n[3]);
/*defines the threshold interval for a facies x*/
/*lim_inf: lower bound */
/*lim_sup: upper bound */
@ -408,7 +378,6 @@ void cutspectr(float *covar, int kx, int ky, int kz, int n[3]);
/*nblock: gridcell number of point x */
void deflimit(double* plim_inf, double* plim_sup, float x, float* thresholds, struct statfacies_mod facies, int nblock);
/*kriges the realization considering weights */
/*realin: input realization */
/*variogram: structure defining the variogram */
@ -419,12 +388,9 @@ void deflimit(double *plim_inf, double *plim_sup, float x, float *thresholds, st
/*The kriged realization is stored in realout */
void dual_kri(struct realization_mod* realin, struct vario_mod variogram, struct welldata_mod well, struct grid_mod grid, double* D, struct realization_mod* realout);
/*exponential covariance value for lag h*/
double exponential(double h);
/*Fast Fourier Transform - Cooley-Tukey algorithm */
/*datar: real part vector - to be transformed */
/*datai: imaginary part vector - to be transformed */
@ -437,27 +403,21 @@ double exponential(double h);
/*The transformed data are returned in datar and datai*/
void fourt(double* datar, double* datai, int nn[3], int ndim, int ifrwd, int icplx, double* workr, double* worki);
/*calculates F(x) = (1/a)*exp(-x*x/2)*/
double funtrun1(double x);
/*cumulative standard normal value*/
float G(float x);
/*gamma covariance value for lag h and exponent alpha*/
double gammf(double h, double alpha);
/*returns the value ln(G(x))*/
float gammln(float xx);
/*incomplete gamma fnction*/
float gammp(float a, float x);
/*returns a normally distributed deviate with 0 mean*/
/*and unit variance, using ran1(idum) as the source */
/*of uniform deviates */
@ -467,13 +427,11 @@ double gasdev(long *idum, long *idum2, long *iy, long *iv, int *iset);
/*gaussian covariance value for lag h*/
double gaussian(double h);
/*incomplete gamma function evaluated by its continued */
/*fraction represented as gammcf, also returns ln(G(a))*/
/*as gln */
void gcf(float* gammcf, float a, float x, float* gln);
/*computation of the covariance matrix for the well data*/
/*well coordinates have no specific unit */
/*The dimension of C is given by n */
@ -485,7 +443,6 @@ void gcf(float *gammcf, float a, float x, float *gln);
/*well: structure defined above */
void gen_cov_matrix(double* C, struct vario_mod variogram, struct welldata_mod well, int n);
/*Ginv */
/*Computes the inverse of the standard normal cumulative*/
/*distribution function with a numerical approximation */
@ -495,7 +452,6 @@ void gen_cov_matrix(double *C, struct vario_mod variogram, struct welldata_mod w
/*p: cumulative probability value */
float Ginv(float p);
/*gradual combination of 1 realization + Nadded */
/*complementary realizations */
/*rho: gradual deformation parameters */
@ -513,7 +469,6 @@ float Ginv(float p);
/*grid: grid definition */
void gradual(struct grad_mod grad, float* Zo, float* Z, float* Zfinal, int n, struct grid_mod grid);
/*computes the size of the underlying grid for FFTs*/
/*input: */
/*variogram: structure defining the variogram model*/
@ -529,7 +484,6 @@ void cgrid(struct vario_mod variogram, struct grid_mod grid, int n[3]);
/*as gln */
void gser(float* gamser, float a, float x, float* gln);
/*calculates x so that x = invF(u) */
/*F is the cumulative density function for the */
/*function approximating the Gaussian function */
@ -539,12 +493,10 @@ void gser(float *gamser, float a, float x, float *gln);
/*C: normalizing constant */
double invtrun1(double u, double lim_inf, double lim_sup, double C);
/*computes the kriging mean and variance*/
/*for the vector bi, i = [0...n-1] */
void krig_stat(float* b, int n, struct vario_mod variogram, struct welldata_mod well, float* mean, float* var);
/* computes the number of gridblocks for one dimension*/
/*N: initial number of gridblocks */
/*i: considered direction */
@ -573,39 +525,31 @@ int maxfactor(int n);
/*metrop is only true with probability "ratio" */
int metrop(double ratio, long* idum, long* idum2, long* iy, long* iv);
/*2-norm of vector b */
/* b : vector */
/* n : length of b, bi, i = [0...n-1]*/
/*returns the norm of b */
double norm(double* b, int n);
/*value of g(x) where g is the normal function*/
double normal(double x);
/*nugget covariance value for lag h*/
double nugget(double h);
/*power covariance value for lag h and exponent alpha*/
double power(double h, double alpha);
/*generates uniform deviates between 0 and 1*/
/*idum: seed */
double ran2(long* idum, long* idum2, long* iy, long* iv);
/*calculates bt.b */
/* b : vector, bi, i = [0...n-1] */
/* n : length of b */
/*returns the scalar product of b*/
double scal_vec(double* b, int n);
/*solves the set of n linear equations Cx = D */
/* C : symmetric positive-definite matrix recorded */
/* (per raws) as a vector with only components */
@ -617,31 +561,25 @@ double scal_vec(double *b,int n);
/* CONJUGATE GRADIENT method */
void solve3(double* C, double* D, int n);
/*sorts an array [0...n-1] into ascending order using */
/*shell */
void sort(float n, float* arr);
/*spherical covariance value for lag h*/
double spherical(double h);
/*stable covariance value for lag h and exponent alpha*/
double stable(double h, double alpha);
/*conversion of log mean and variance to nor*/
void statlog2nor(struct statistic_mod* pstat);
/*tries factor */
/*pnum: number to be decomposed */
/*fact: suggested factor */
/*pmaxfac: memory to keep the greatest factor*/
int test_fact(int* pnum, int fact, int* pmaxfac);
/*calculates the integrale of an approximate function*/
/*for the Gaussian function over an interval defined */
/*by lim_inf and lim_sup */
@ -649,7 +587,6 @@ int test_fact(int *pnum, int fact, int *pmaxfac);
/*lim_sup: upper bound of the considered interval */
double trun1(double lim_inf, double lim_sup);
/*draws a truncated gaussian variable between lim_inf*/
/*and lim_sup */
/*idum: seed */
@ -662,7 +599,6 @@ double trungasdev(long *idum,double lim_inf,double lim_sup,long *idum2, long *iy
/*returns the norm the product tb1.b2 */
double vec_vec(double* b1, double* b2, int n);
/*turns the volume fractions into Gaussian thresholds */
/*facies: structure defined above */
/*thresholds: output threshold vector fot i = [0...n-1]*/
@ -672,6 +608,4 @@ void vf2gthres(struct statfacies_mod facies,float *thresholds);
void polint(float xa[], float ya[], int n, float x, float* y, float* dy);
#endif

@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include "genlib.h"
#include "geostat.h"
#include <stdlib.h>
#include <string.h>
#ifndef _PRESSURE_H
#define _PRESSURE_H
@ -17,5 +17,4 @@ struct pressure_mod {
double x, y, z;
};
#endif // define _PRESSURE_H

@ -151,7 +151,8 @@ void SaveToken(scannerADT scanner, string token);
* of this option.
*/
typedef enum { PreserveSpaces, IgnoreSpaces } spaceOptionT;
typedef enum { PreserveSpaces,
IgnoreSpaces } spaceOptionT;
void SetScannerSpaceOption(scannerADT scanner, spaceOptionT option);
spaceOptionT GetScannerSpaceOption(scannerADT scanner);

@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include "genlib.h"
#include "geostat.h"
#include <stdlib.h>
#include <string.h>
#ifndef _TOOLSFFTMA_H
#define _TOOLSFFTMA_H
@ -13,7 +13,6 @@
/* ------------------ */
/* kgeneration, FFTMA2, prebuild_gwn, build_real, , clean_real */
/*FAST FOURIER TRANSFORM Pressure Simulation */
/*Turns a Gaussian white noise vector into a */
/*spatially correlated vector */

@ -1,7 +1,6 @@
#include <string.h>
#include "geostat.h"
#include "pressure.h"
#include <string.h>
#ifndef _TOOLSFFTPSIM_H
#define _TOOLSFFTPSIM_H

@ -1,8 +1,8 @@
#include <stdlib.h>
#include <string.h>
#include "genlib.h"
#include "geostat.h"
#include "pressure.h"
#include <stdlib.h>
#include <string.h>
#ifndef _TOOLSIO_H
#define _TOOLSIO_H
@ -14,7 +14,6 @@
/* ------------------ */
/* testmemory */
/*FUNCTIONS*/
/*----------*/

@ -1,20 +1,20 @@
#include <Python.h>
#include <numpy/arrayobject.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include "Py_py-api.h"
#include "genlib.h"
#include "simpio.h"
#include "condor.h"
#include "genlib.h"
#include "geostat.h"
#include "toolsIO.h"
#include "toolsFFTMA.h"
#include "pressure.h"
#include "simpio.h"
#include "toolsFFTMA.h"
#include "toolsFFTPSIM.h"
#include "toolsIO.h"
#include <Python.h>
#include <math.h>
#include <numpy/arrayobject.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NDIMENSIONS 3
/* Z is the GWN with 0-mean and 1-variance */
@ -32,15 +32,14 @@ static PyObject* genFunc(PyObject* self, PyObject* args)
PyObject* out_array;
npy_intp out_dims[NPY_MAXDIMS];
if(!Py_getvalues(args, &seed, &grid, &variogram, &stat)) return NULL;
if (!Py_getvalues(args, &seed, &grid, &variogram, &stat))
return NULL;
Py_kgeneration(seed, grid, stat, variogram, &Z, &Y, &Y1, n);
out_dims[0] = grid.NZ;
out_dims[1] = grid.NY;
out_dims[2] = grid.NX;
out_array = PyArray_SimpleNewFromData(NDIMENSIONS, out_dims, NPY_DOUBLE, Y.vector);
if (out_array == NULL)
return NULL;
@ -48,18 +47,14 @@ static PyObject* genFunc(PyObject* self, PyObject* args)
PyArray_ENABLEFLAGS(out_array, NPY_ARRAY_OWNDATA);
return out_array;
}
static PyMethodDef FFTMAMethods[]=
{
static PyMethodDef FFTMAMethods[] = {
{ "gen", genFunc, METH_VARARGS, "Generates a permeability 3D field." },
{ NULL, NULL, 0, NULL }
};
static struct PyModuleDef cFFTMADef =
{
static struct PyModuleDef cFFTMADef = {
PyModuleDef_HEAD_INIT,
"FFTMA", "",
-1,

Loading…
Cancel
Save