26 double x, xmin, xmax, dx;
27 double y, ymin, ymax, dy;
28 double rho, p,
T,
c[11];
37 xmin = 2.1; xmax = 7.06; dx = 0.08;
38 ymin = 4.0; ymax = 19.0; dy = 0.2;
40 nx = 1 +
INT_FLOOR((xmax - xmin)/dx + 0.5);
41 ny = 1 +
INT_FLOOR((ymax - ymin)/dy + 0.5);
43 printf (
"%f %f nx = %d, ny = %d\n",(xmax-xmin)/dx,(ymax-ymin)/dy,nx,ny);
50 fp = fopen(
"H_TAB_I.A",
"r");
52 print1 (
"! File not found\n");
56 for (i = 0; i < rho_tab.
nx; i++)
for (j = 0; j < rho_tab.
ny; j++) {
57 rho_tab.
f[
j][
i] = -90;
61 for (i = 0; i < nx; i++){
62 fscanf (fp,
"%lf %d",&x, &ny);
63 for (j = 0; j < ny; j++){
64 for (k = 0; k < 11; k++) fscanf (fp,
"%lf",c+k);
65 printf (
"(i,j) = (%d, %d), lnT = [%f %f], lnP = [%f %f]\n",
66 i,j, x,rho_tab.
lnx[i], c[0], rho_tab.
lny[j]);
67 rho = pow(10.0, c[3]);
68 rho_tab.
f[
j][
i] = rho;
86 P10(-12),
P10(4.065), 256);
100 for (j = 0; j < Ttab.
ny; j++){
101 for (i = 0; i < Ttab.
nx; i++){
105 if (status == 0) Ttab.
f[
j][
i] =
T;
107 if (log10(rho) > -3 && log10(rho) < -2){
108 printf (
"! Inverse not found, Log(p) = %f, Log(rho) = %f\n",
109 log10(p), log10(rho));
double * y
array of y-values (not uniform)
#define UNIT_DENSITY
Unit density in gr/cm^3.
void print1(const char *fmt,...)
int nx
Number of columns or points in the x direction.
void WriteBinaryTable2D(char *fname, Table2D *tab)
#define UNIT_VELOCITY
Unit velocity in cm/sec.
int InverseLookupTable2D(Table2D *tab, double y, double f, double *x)
int ny
Number of rows or points in the y direction.
double * lny
array of log10(y) values (uniform)
void InitializeTable2D(Table2D *tab, double xmin, double xmax, int nx, double ymin, double ymax, int ny)
double * lnx
array of log10(x) values (uniform)
static Table2D Ttab
A 2D table containing pre-computed values of temperature stored at equally spaced node values of Log...
#define QUIT_PLUTO(e_code)
double * x
array of x-values (not uniform)