#include "layers.h"

int write_veldis(char* label) {

  int i,n;
  FILE* file;
  double maxv,dv;

  char filename[256];

  filename[0] = 'v';
  filename[1] = 'e';
  filename[2] = 'l';
  filename[3] = '-';
  filename[4] = '\0';

  n = 0;

  strcat(filename,label);
  file = fopen("veldis","w");

  maxv = 5.0*sqrt(3.0*0.001*Rgas*Tsoll/m);
  dv   = maxv/100.0;
  for(i=0;i<100;i++)
    n += fprintf(file,"%lf %d\n", (double)i*dv,vdist[i]);

  fclose(file);

  return(n);
}
