71 real c000, c100, c001, c101, c010, c110, c011, c111;
72 real c00, c01, c10, c11;
104 int n = i_y*str->
n_z*str->
n_x + i_z*str->
n_x + i_x;
106 int y1 = str->
n_z*str->
n_x;
113 x1 = -(str->
n_x-1)*x1;
119 y1 = -(str->
n_y-1)*y1;
125 z1 = -(str->
n_z-1)*z1;
134 c100 = str->
c[n + x1];
135 c001 = str->
c[n + y1];
136 c101 = str->
c[n + y1 + x1];
137 c010 = str->
c[n + z1];
138 c110 = str->
c[n +z1 + x1];
139 c011 = str->
c[n + y1 + z1];
140 c111 = str->
c[n + y1 + z1 + x1];
142 c00 = c000*(1 - dx) + c100*dx;
143 c01 = c001*(1 - dx) + c101*dx;
144 c10 = c010*(1 - dx) + c110*dx;
145 c11 = c011*(1 - dx) + c111*dx;
147 c0 = c00*(1 - dz) + c10*dz;
148 c1 = c01*(1 - dz) + c11*dz;
150 *f = c0*(1 - dy) + c1*dy;
int linint3D_eval_f(real *f, linint3D_data *str, real x, real y, real z)
Evaluate interpolated value of 3D scalar field.
void linint3D_init(linint3D_data *str, real *c, int n_x, int n_y, int n_z, int bc_x, int bc_y, int bc_z, real x_min, real x_max, real y_min, real y_max, real z_min, real z_max)
Initialize linear interpolation struct for scalar 3D data.