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/lib_src/writefile_bin.c

34 lines
670 B
C

#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include "genlib.h"
#include "geostat.h"
/*writefile */
/* write in the file "filename" the vector values of a */
/* realization_mod variable */
/* filename: explicit */
/* realin: structure defining a realization */
void writefile_bin(string filename, struct realization_mod *realin)
{
FILE *fp;
int i;
double *prout;
/*save the permeability realization*/
fp = fopen(filename, "w");
for (i=0;i<(*realin).n;i++)
{
prout=(*realin).vector;
fwrite(&prout[i],sizeof(double),1,fp);
}
fclose(fp);
return;
}