50 void interpol_herm(
const Tbl&,
const Tbl&,
const Tbl&,
double,
int&,
double&,
67 void interpol_mixed_3d(
const Tbl& xtab,
const Tbl& ytab,
const Tbl& ztab,
const Tbl& ftab,
68 const Tbl& dfdytab,
const Tbl& dfdztab,
const Tbl& d2fdydztab,
69 double x,
double y,
double z,
double& f,
double& dfdy,
double& dfdz)
71 assert(ytab.dim == xtab.dim) ;
72 assert(ztab.dim == xtab.dim) ;
73 assert(ftab.dim == xtab.dim) ;
74 assert(dfdytab.dim == xtab.dim) ;
75 assert(dfdztab.dim == xtab.dim) ;
76 assert(d2fdydztab.dim == xtab.dim) ;
79 nbp1 = xtab.get_dim(2) ;
80 nbp2 = xtab.get_dim(1) ;
81 nbp3 = xtab.get_dim(0) ;
99 while ( ( xtab(i_near,0,0) <= x ) && ( ( nbp1-1 ) > i_near ) ) {
106 while ( ( ytab(i_near,j_near, 0) <= y ) && ( ( nbp2-1 ) > j_near ) ) {
113 while ( ( ztab( i_near, j_near, k_near) <= z) && ( ( nbp3-1 ) > k_near ) ) {
120 int i1 = i_near + 1 ;
121 int j1 = j_near + 1 ;
122 int k1 = k_near + 1 ;
139 double dy_i_near = ytab(i_near, j1, k_near) - ytab(i_near, j_near, k_near) ;
140 double dz_i_near = ztab(i_near, j_near, k1) - ztab(i_near, j_near, k_near) ;
141 double u_i_near = (y - ytab(i_near, j_near, k_near)) / dy_i_near ;
142 double v_i_near = (z - ztab(i_near, j_near, k_near)) / dz_i_near ;
155 double u2_i_near = u_i_near * u_i_near ;
156 double v2_i_near = v_i_near * v_i_near ;
157 double u3_i_near = u2_i_near * u_i_near ;
158 double v3_i_near = v2_i_near * v_i_near ;
168 double psi0_u_i_near = double(2)*u3_i_near - double(3)*u2_i_near + double(1) ;
169 double psi0_1mu_i_near = -double(2)*u3_i_near + double(3)*u2_i_near ;
170 double psi1_u_i_near = u3_i_near - double(2)*u2_i_near + u_i_near ;
171 double psi1_1mu_i_near = -u3_i_near + u2_i_near ;
172 double psi0_v_i_near = double(2)*v3_i_near - double(3)*v2_i_near + double(1) ;
173 double psi0_1mv_i_near = -double(2)*v3_i_near + double(3)*v2_i_near ;
174 double psi1_v_i_near = v3_i_near - double(2)*v2_i_near + v_i_near ;
175 double psi1_1mv_i_near = -v3_i_near + v2_i_near ;
196 f_i_near = ftab(i_near, j_near, k_near) * psi0_u_i_near * psi0_v_i_near
197 + ftab(i_near, j1, k_near) * psi0_1mu_i_near * psi0_v_i_near
198 + ftab(i_near, j_near, k1) * psi0_u_i_near * psi0_1mv_i_near
199 + ftab(i_near, j1, k1) * psi0_1mu_i_near * psi0_1mv_i_near ;
201 f_i_near += (dfdytab(i_near, j_near, k_near) * psi1_u_i_near * psi0_v_i_near
202 - dfdytab(i_near, j1, k_near) * psi1_1mu_i_near * psi0_v_i_near
203 + dfdytab(i_near, j_near, k1) * psi1_u_i_near * psi0_1mv_i_near
204 - dfdytab(i_near, j1, k1) * psi1_1mu_i_near * psi0_1mv_i_near) * dy_i_near ;
206 f_i_near += (dfdztab(i_near, j_near, k_near) * psi0_u_i_near * psi1_v_i_near
207 + dfdztab(i_near, j1, k_near) * psi0_1mu_i_near * psi1_v_i_near
208 - dfdztab(i_near, j_near, k1) * psi0_u_i_near * psi1_1mv_i_near
209 - dfdztab(i_near, j1, k1) * psi0_1mu_i_near * psi1_1mv_i_near) * dz_i_near ;
211 f_i_near += (d2fdydztab(i_near, j_near, k_near) * psi1_u_i_near * psi1_v_i_near
212 - d2fdydztab(i_near, j1, k_near) * psi1_1mu_i_near * psi1_v_i_near
213 - d2fdydztab(i_near, j_near, k1) * psi1_u_i_near * psi1_1mv_i_near
214 + d2fdydztab(i_near, j1, k1) * psi1_1mu_i_near * psi1_1mv_i_near) * dy_i_near * dz_i_near ;
216 double dpsi0_u_i_near = 6.*(u2_i_near - u_i_near) ;
217 double dpsi0_1mu_i_near = 6.*(u2_i_near - u_i_near) ;
218 double dpsi1_u_i_near = 3.*u2_i_near - 4.*u_i_near + 1. ;
219 double dpsi1_1mu_i_near = 3.*u2_i_near - 2.*u_i_near ;
223 dfdy_i_near = (ftab(i_near, j_near, k_near) * dpsi0_u_i_near * psi0_v_i_near
224 - ftab(i_near, j1, k_near) * dpsi0_1mu_i_near * psi0_v_i_near
225 + ftab(i_near, j_near, k1) * dpsi0_u_i_near * psi0_1mv_i_near
226 - ftab(i_near, j1, k1) * dpsi0_1mu_i_near * psi0_1mv_i_near ) / dy_i_near;
228 dfdy_i_near += (dfdytab(i_near, j_near, k_near) * dpsi1_u_i_near * psi0_v_i_near
229 + dfdytab(i_near, j1, k_near) * dpsi1_1mu_i_near * psi0_v_i_near
230 + dfdytab(i_near, j_near, k1) * dpsi1_u_i_near * psi0_1mv_i_near
231 + dfdytab(i_near, j1, k1) * dpsi1_1mu_i_near * psi0_1mv_i_near) ;
233 dfdy_i_near += (dfdztab(i_near, j_near, k_near) * dpsi0_u_i_near * psi1_v_i_near
234 - dfdztab(i_near, j1, k_near) * dpsi0_1mu_i_near * psi1_v_i_near
235 - dfdztab(i_near, j_near, k1) * dpsi0_u_i_near * psi1_1mv_i_near
236 + dfdztab(i_near, j1, k1) * dpsi0_1mu_i_near * psi1_1mv_i_near) * dz_i_near /dy_i_near ;
238 dfdy_i_near += (d2fdydztab(i_near, j_near, k_near) * dpsi1_u_i_near * psi1_v_i_near
239 + d2fdydztab(i_near, j1, k_near) * dpsi1_1mu_i_near * psi1_v_i_near
240 - d2fdydztab(i_near, j_near, k1) * dpsi1_u_i_near * psi1_1mv_i_near
241 - d2fdydztab(i_near, j1, k1) * dpsi1_1mu_i_near * psi1_1mv_i_near) * dz_i_near ;
243 double dpsi0_v_i_near = 6.*(v2_i_near - v_i_near) ;
244 double dpsi0_1mv_i_near = 6.*(v2_i_near - v_i_near) ;
245 double dpsi1_v_i_near= 3.*v2_i_near - 4.*v_i_near + 1. ;
246 double dpsi1_1mv_i_near= 3.*v2_i_near - 2.*v_i_near ;
250 dfdz_i_near = (ftab(i_near, j_near, k_near) * psi0_u_i_near * dpsi0_v_i_near
251 + ftab(i_near, j1, k_near) * psi0_1mu_i_near * dpsi0_v_i_near
252 - ftab(i_near, j_near, k1) * psi0_u_i_near * dpsi0_1mv_i_near
253 - ftab(i_near, j1, k1) * psi0_1mu_i_near * dpsi0_1mv_i_near) / dz_i_near ;
255 dfdz_i_near += (dfdytab(i_near, j_near, k_near) * psi1_u_i_near * dpsi0_v_i_near
256 - dfdytab(i_near, j1, k_near) * psi1_1mu_i_near * dpsi0_v_i_near
257 - dfdytab(i_near, j_near, k1) * psi1_u_i_near * dpsi0_1mv_i_near
258 + dfdytab(i_near, j1, k1) * psi1_1mu_i_near * dpsi0_1mv_i_near) * dy_i_near / dz_i_near ;
260 dfdz_i_near += (dfdztab(i_near, j_near, k_near) * psi0_u_i_near * dpsi1_v_i_near
261 + dfdztab(i_near, j1, k_near) * psi0_1mu_i_near * dpsi1_v_i_near
262 + dfdztab(i_near, j_near, k1) * psi0_u_i_near * dpsi1_1mv_i_near
263 + dfdztab(i_near, j1, k1) * psi0_1mu_i_near * dpsi1_1mv_i_near) ;
265 dfdz_i_near += (d2fdydztab(i_near, j_near, k_near) * psi1_u_i_near* dpsi1_v_i_near
266 - d2fdydztab(i_near, j1, k_near) * psi1_1mu_i_near * dpsi1_v_i_near
267 + d2fdydztab(i_near, j_near, k1) * psi1_u_i_near* dpsi1_1mv_i_near
268 - d2fdydztab(i_near, j1, k1) * psi1_1mu_i_near * dpsi1_1mv_i_near) * dy_i_near;
274 while ( ( ytab(i1,j_near, 0) <= y ) && ( ( nbp2-1 ) > j_near ) ) {
281 while ( ( ztab( i1, j_near, k_near) <= z) && ( ( nbp3-1 ) > k_near ) ) {
291 double dy_i1 = ytab(i1, j1, k_near) - ytab(i1, j_near, k_near) ;
292 double dz_i1 = ztab(i1, j_near, k1) - ztab(i1, j_near, k_near) ;
294 double u_i1 = (y - ytab(i1, j_near, k_near)) / dy_i1 ;
295 double v_i1 = (z - ztab(i1, j_near, k_near)) / dz_i1 ;
297 double u2_i1 = u_i1 * u_i1 ;
298 double v2_i1 = v_i1 * v_i1 ;
299 double u3_i1 = u2_i1 * u_i1 ;
300 double v3_i1 = v2_i1 * v_i1 ;
302 double psi0_u_i1 = 2.*u3_i1 - 3.*u2_i1 + 1. ;
303 double psi0_1mu_i1 = -2.*u3_i1 + 3.*u2_i1 ;
304 double psi1_u_i1 = u3_i1 - 2.*u2_i1 + u_i1 ;
305 double psi1_1mu_i1 = -u3_i1 + u2_i1 ;
307 double psi0_v_i1 = 2.*v3_i1 - 3.*v2_i1 + 1. ;
308 double psi0_1mv_i1 = -2.*v3_i1 + 3.*v2_i1 ;
309 double psi1_v_i1 = v3_i1 - 2.*v2_i1 + v_i1 ;
310 double psi1_1mv_i1 = -v3_i1 + v2_i1 ;
314 f_i1 = ftab(i1, j_near, k_near) * psi0_u_i1 * psi0_v_i1
315 + ftab(i1, j1, k_near) * psi0_1mu_i1 * psi0_v_i1
316 + ftab(i1, j_near, k1) * psi0_u_i1 * psi0_1mv_i1
317 + ftab(i1, j1, k1) * psi0_1mu_i1 * psi0_1mv_i1 ;
319 f_i1 += (dfdytab(i1, j_near, k_near) * psi1_u_i1 * psi0_v_i1
320 - dfdytab(i1, j1, k_near) * psi1_1mu_i1 * psi0_v_i1
321 + dfdytab(i1, j_near, k1) * psi1_u_i1 * psi0_1mv_i1
322 - dfdytab(i1, j1, k1) * psi1_1mu_i1 * psi0_1mv_i1) * dy_i1 ;
324 f_i1 += (dfdztab(i1, j_near, k_near) * psi0_u_i1 * psi1_v_i1
325 + dfdztab(i1, j1, k_near) * psi0_1mu_i1 * psi1_v_i1
326 - dfdztab(i1, j_near, k1) * psi0_u_i1 * psi1_1mv_i1
327 - dfdztab(i1, j1, k1) * psi0_1mu_i1 * psi1_1mv_i1) * dz_i1 ;
329 f_i1 += (d2fdydztab(i1, j_near, k_near) * psi1_u_i1 * psi1_v_i1
330 - d2fdydztab(i1, j1, k_near) * psi1_1mu_i1 * psi1_v_i1
331 - d2fdydztab(i1, j_near, k1) * psi1_u_i1 * psi1_1mv_i1
332 + d2fdydztab(i1, j1, k1) * psi1_1mu_i1 * psi1_1mv_i1) * dy_i1 * dz_i1 ;
334 double dpsi0_u_i1 = 6.*(u2_i1 - u_i1) ;
335 double dpsi0_1mu_i1 = 6.*(u2_i1 - u_i1) ;
336 double dpsi1_u_i1 = 3.*u2_i1 - 4.*u_i1 + 1. ;
337 double dpsi1_1mu_i1 = 3.*u2_i1 - 2.*u_i1 ;
341 dfdy_i1 = (ftab(i1, j_near, k_near) * dpsi0_u_i1 * psi0_v_i1
342 - ftab(i1, j1, k_near) * dpsi0_1mu_i1 * psi0_v_i1
343 + ftab(i1, j_near, k1) * dpsi0_u_i1 * psi0_1mv_i1
344 - ftab(i1, j1, k1) * dpsi0_1mu_i1 * psi0_1mv_i1 ) / dy_i1;
346 dfdy_i1 += (dfdytab(i1, j_near, k_near) * dpsi1_u_i1 * psi0_v_i1
347 + dfdytab(i1, j1, k_near) * dpsi1_1mu_i1 * psi0_v_i1
348 + dfdytab(i1, j_near, k1) * dpsi1_u_i1 * psi0_1mv_i1
349 + dfdytab(i1, j1, k1) * dpsi1_1mu_i1 * psi0_1mv_i1) ;
351 dfdy_i1 += (dfdztab(i1, j_near, k_near) * dpsi0_u_i1 * psi1_v_i1
352 - dfdztab(i1, j1, k_near) * dpsi0_1mu_i1 * psi1_v_i1
353 - dfdztab(i1, j_near, k1) * dpsi0_u_i1 * psi1_1mv_i1
354 + dfdztab(i1, j1, k1) * dpsi0_1mu_i1 * psi1_1mv_i1) * dz_i1 /dy_i1 ;
356 dfdy_i1 += (d2fdydztab(i1, j_near, k_near) * dpsi1_u_i1 * psi1_v_i1
357 + d2fdydztab(i1, j1, k_near) * dpsi1_1mu_i1 * psi1_v_i1
358 - d2fdydztab(i1, j_near, k1) * dpsi1_u_i1 * psi1_1mv_i1
359 - d2fdydztab(i1, j1, k1) * dpsi1_1mu_i1 * psi1_1mv_i1) * dz_i1 ;
361 double dpsi0_v_i1 = 6.*(v2_i1 - v_i1) ;
362 double dpsi0_1mv_i1 = 6.*(v2_i1 - v_i1) ;
363 double dpsi1_v_i1= 3.*v2_i1 - 4.*v_i1 + 1. ;
364 double dpsi1_1mv_i1= 3.*v2_i1 - 2.*v_i1 ;
368 dfdz_i1 = (ftab(i1, j_near, k_near) * psi0_u_i1 * dpsi0_v_i1
369 + ftab(i1, j1, k_near) * psi0_1mu_i1 * dpsi0_v_i1
370 - ftab(i1, j_near, k1) * psi0_u_i1 * dpsi0_1mv_i1
371 - ftab(i1, j1, k1) * psi0_1mu_i1 * dpsi0_1mv_i1) / dz_i1 ;
373 dfdz_i1 += (dfdytab(i1, j_near, k_near) * psi1_u_i1 * dpsi0_v_i1
374 - dfdytab(i1, j1, k_near) * psi1_1mu_i1 * dpsi0_v_i1
375 - dfdytab(i1, j_near, k1) * psi1_u_i1 * dpsi0_1mv_i1
376 + dfdytab(i1, j1, k1) * psi1_1mu_i1 * dpsi0_1mv_i1) * dy_i1 / dz_i1 ;
378 dfdz_i1 += (dfdztab(i1, j_near, k_near) * psi0_u_i1 * dpsi1_v_i1
379 + dfdztab(i1, j1, k_near) * psi0_1mu_i1 * dpsi1_v_i1
380 + dfdztab(i1, j_near, k1) * psi0_u_i1 * dpsi1_1mv_i1
381 + dfdztab(i1, j1, k1) * psi0_1mu_i1 * dpsi1_1mv_i1) ;
383 dfdz_i1 += (d2fdydztab(i1, j_near, k_near) * psi1_u_i1* dpsi1_v_i1
384 - d2fdydztab(i1, j1, k_near) * psi1_1mu_i1 * dpsi1_v_i1
385 + d2fdydztab(i1, j_near, k1) * psi1_u_i1* dpsi1_1mv_i1
386 - d2fdydztab(i1, j1, k1) * psi1_1mu_i1 * dpsi1_1mv_i1) * dy_i1;
390 double x1 = xtab(i_near, 0, 0) ;
391 double x2 = xtab(i1, 0, 0) ;
396 double y1 = f_i_near;
398 double a = (y1-y2)/x12 ;
399 double b = (x1*y2-y1*x2)/x12 ;
409 double y1_y = dfdy_i_near;
410 double y2_y = dfdy_i1;
411 double a_y = (y1_y-y2_y)/x12 ;
412 double b_y = (x1*y2_y-y1_y*x2)/x12 ;
417 double y1_z = dfdz_i_near;
418 double y2_z = dfdz_i1;
419 double a_z = (y1_z-y2_z)/x12 ;
420 double b_z = (x1*y2_z-y1_z*x2)/x12 ;
434 void interpol_mixed_3d_mod(
const Tbl& xtab,
const Tbl& ytab,
const Tbl& ztab,
const Tbl& ftab,
435 const Tbl& dfdytab,
const Tbl& dfdztab,
436 double x,
double y,
double z,
double& f,
double& dfdy,
double& dfdz)
438 assert(ytab.dim == xtab.dim) ;
439 assert(ztab.dim == xtab.dim) ;
440 assert(ftab.dim == xtab.dim) ;
441 assert(dfdytab.dim == xtab.dim) ;
442 assert(dfdztab.dim == xtab.dim) ;
444 int nbp1, nbp2, nbp3;
445 nbp1 = xtab.get_dim(2) ;
446 nbp2 = xtab.get_dim(1) ;
447 nbp3 = xtab.get_dim(0) ;
464 while ( ( xtab(i_near,0,0) <= x ) && ( ( nbp1-1 ) > i_near ) ) {
471 while ( ( ytab(i_near,j_near, 0) <= y ) && ( ( nbp2-1 ) > j_near ) ) {
478 while ( ( ztab( i_near, j_near, k_near) <= z) && ( ( nbp3-1 ) > k_near ) ) {
485 int i1 = i_near + 1 ;
486 int j1 = j_near + 1 ;
487 int k1 = k_near + 1 ;
504 double dy_i_near = ytab(i_near, j1, k_near) - ytab(i_near, j_near, k_near) ;
505 double dz_i_near = ztab(i_near, j_near, k1) - ztab(i_near, j_near, k_near) ;
506 double u_i_near = (y - ytab(i_near, j_near, k_near)) / dy_i_near ;
507 double v_i_near = (z - ztab(i_near, j_near, k_near)) / dz_i_near ;
521 double u2_i_near = u_i_near * u_i_near ;
522 double v2_i_near = v_i_near * v_i_near ;
523 double u3_i_near = u2_i_near * u_i_near ;
524 double v3_i_near = v2_i_near * v_i_near ;
536 double psi0_u_i_near = double(2)*u3_i_near - double(3)*u2_i_near + double(1) ;
537 double psi0_1mu_i_near = -double(2)*u3_i_near + double(3)*u2_i_near ;
538 double psi1_u_i_near = u3_i_near - double(2)*u2_i_near + u_i_near ;
539 double psi1_1mu_i_near = -u3_i_near + u2_i_near ;
540 double psi0_v_i_near = double(2)*v3_i_near - double(3)*v2_i_near + double(1) ;
541 double psi0_1mv_i_near = -double(2)*v3_i_near + double(3)*v2_i_near ;
542 double psi1_v_i_near = v3_i_near - double(2)*v2_i_near + v_i_near ;
543 double psi1_1mv_i_near = -v3_i_near + v2_i_near ;
569 f_i_near = ftab(i_near, j_near, k_near) * psi0_u_i_near * psi0_v_i_near
570 + ftab(i_near, j1, k_near) * psi0_1mu_i_near * psi0_v_i_near
571 + ftab(i_near, j_near, k1) * psi0_u_i_near * psi0_1mv_i_near
572 + ftab(i_near, j1, k1) * psi0_1mu_i_near * psi0_1mv_i_near ;
574 f_i_near += (dfdytab(i_near, j_near, k_near) * psi1_u_i_near * psi0_v_i_near
575 - dfdytab(i_near, j1, k_near) * psi1_1mu_i_near * psi0_v_i_near
576 + dfdytab(i_near, j_near, k1) * psi1_u_i_near * psi0_1mv_i_near
577 - dfdytab(i_near, j1, k1) * psi1_1mu_i_near * psi0_1mv_i_near) * dy_i_near ;
579 f_i_near += (dfdztab(i_near, j_near, k_near) * psi0_u_i_near * psi1_v_i_near
580 + dfdztab(i_near, j1, k_near) * psi0_1mu_i_near * psi1_v_i_near
581 - dfdztab(i_near, j_near, k1) * psi0_u_i_near * psi1_1mv_i_near
582 - dfdztab(i_near, j1, k1) * psi0_1mu_i_near * psi1_1mv_i_near) * dz_i_near ;
584 double dpsi0_u_i_near = 6.*(u2_i_near - u_i_near) ;
585 double dpsi0_1mu_i_near = 6.*(u2_i_near - u_i_near) ;
586 double dpsi1_u_i_near = 3.*u2_i_near - 4.*u_i_near + 1. ;
587 double dpsi1_1mu_i_near = 3.*u2_i_near - 2.*u_i_near ;
591 dfdy_i_near = (ftab(i_near, j_near, k_near) * dpsi0_u_i_near * psi0_v_i_near
592 - ftab(i_near, j1, k_near) * dpsi0_1mu_i_near * psi0_v_i_near
593 + ftab(i_near, j_near, k1) * dpsi0_u_i_near * psi0_1mv_i_near
594 - ftab(i_near, j1, k1) * dpsi0_1mu_i_near * psi0_1mv_i_near ) / dy_i_near;
596 dfdy_i_near += (dfdytab(i_near, j_near, k_near) * dpsi1_u_i_near * psi0_v_i_near
597 + dfdytab(i_near, j1, k_near) * dpsi1_1mu_i_near * psi0_v_i_near
598 + dfdytab(i_near, j_near, k1) * dpsi1_u_i_near * psi0_1mv_i_near
599 + dfdytab(i_near, j1, k1) * dpsi1_1mu_i_near * psi0_1mv_i_near) ;
601 dfdy_i_near += (dfdztab(i_near, j_near, k_near) * dpsi0_u_i_near * psi1_v_i_near
602 - dfdztab(i_near, j1, k_near) * dpsi0_1mu_i_near * psi1_v_i_near
603 - dfdztab(i_near, j_near, k1) * dpsi0_u_i_near * psi1_1mv_i_near
604 + dfdztab(i_near, j1, k1) * dpsi0_1mu_i_near * psi1_1mv_i_near) * dz_i_near /dy_i_near ;
608 double dpsi0_v_i_near = 6.*(v2_i_near - v_i_near) ;
609 double dpsi0_1mv_i_near = 6.*(v2_i_near - v_i_near) ;
610 double dpsi1_v_i_near= 3.*v2_i_near - 4.*v_i_near + 1. ;
611 double dpsi1_1mv_i_near= 3.*v2_i_near - 2.*v_i_near ;
615 dfdz_i_near = (ftab(i_near, j_near, k_near) * psi0_u_i_near * dpsi0_v_i_near
616 + ftab(i_near, j1, k_near) * psi0_1mu_i_near * dpsi0_v_i_near
617 - ftab(i_near, j_near, k1) * psi0_u_i_near * dpsi0_1mv_i_near
618 - ftab(i_near, j1, k1) * psi0_1mu_i_near * dpsi0_1mv_i_near) / dz_i_near ;
620 dfdz_i_near += (dfdytab(i_near, j_near, k_near) * psi1_u_i_near * dpsi0_v_i_near
621 - dfdytab(i_near, j1, k_near) * psi1_1mu_i_near * dpsi0_v_i_near
622 - dfdytab(i_near, j_near, k1) * psi1_u_i_near * dpsi0_1mv_i_near
623 + dfdytab(i_near, j1, k1) * psi1_1mu_i_near * dpsi0_1mv_i_near) * dy_i_near / dz_i_near ;
625 dfdz_i_near += (dfdztab(i_near, j_near, k_near) * psi0_u_i_near * dpsi1_v_i_near
626 + dfdztab(i_near, j1, k_near) * psi0_1mu_i_near * dpsi1_v_i_near
627 + dfdztab(i_near, j_near, k1) * psi0_u_i_near * dpsi1_1mv_i_near
628 + dfdztab(i_near, j1, k1) * psi0_1mu_i_near * dpsi1_1mv_i_near) ;
634 while ( ( ytab(i1,j_near, 0) <= y ) && ( ( nbp2-1 ) > j_near ) ) {
641 while ( ( ztab( i1, j_near, k_near) <= z) && ( ( nbp3-1 ) > k_near ) ) {
651 double dy_i1 = ytab(i1, j1, k_near) - ytab(i1, j_near, k_near) ;
652 double dz_i1 = ztab(i1, j_near, k1) - ztab(i1, j_near, k_near) ;
654 double u_i1 = (y - ytab(i1, j_near, k_near)) / dy_i1 ;
655 double v_i1 = (z - ztab(i1, j_near, k_near)) / dz_i1 ;
657 double u2_i1 = u_i1 * u_i1 ;
658 double v2_i1 = v_i1 * v_i1 ;
659 double u3_i1 = u2_i1 * u_i1 ;
660 double v3_i1 = v2_i1 * v_i1 ;
662 double psi0_u_i1 = 2.*u3_i1 - 3.*u2_i1 + 1. ;
663 double psi0_1mu_i1 = -2.*u3_i1 + 3.*u2_i1 ;
664 double psi1_u_i1 = u3_i1 - 2.*u2_i1 + u_i1 ;
665 double psi1_1mu_i1 = -u3_i1 + u2_i1 ;
667 double psi0_v_i1 = 2.*v3_i1 - 3.*v2_i1 + 1. ;
668 double psi0_1mv_i1 = -2.*v3_i1 + 3.*v2_i1 ;
669 double psi1_v_i1 = v3_i1 - 2.*v2_i1 + v_i1 ;
670 double psi1_1mv_i1 = -v3_i1 + v2_i1 ;
674 f_i1 = ftab(i1, j_near, k_near) * psi0_u_i1 * psi0_v_i1
675 + ftab(i1, j1, k_near) * psi0_1mu_i1 * psi0_v_i1
676 + ftab(i1, j_near, k1) * psi0_u_i1 * psi0_1mv_i1
677 + ftab(i1, j1, k1) * psi0_1mu_i1 * psi0_1mv_i1 ;
679 f_i1 += (dfdytab(i1, j_near, k_near) * psi1_u_i1 * psi0_v_i1
680 - dfdytab(i1, j1, k_near) * psi1_1mu_i1 * psi0_v_i1
681 + dfdytab(i1, j_near, k1) * psi1_u_i1 * psi0_1mv_i1
682 - dfdytab(i1, j1, k1) * psi1_1mu_i1 * psi0_1mv_i1) * dy_i1 ;
684 f_i1 += (dfdztab(i1, j_near, k_near) * psi0_u_i1 * psi1_v_i1
685 + dfdztab(i1, j1, k_near) * psi0_1mu_i1 * psi1_v_i1
686 - dfdztab(i1, j_near, k1) * psi0_u_i1 * psi1_1mv_i1
687 - dfdztab(i1, j1, k1) * psi0_1mu_i1 * psi1_1mv_i1) * dz_i1 ;
689 double dpsi0_u_i1 = 6.*(u2_i1 - u_i1) ;
690 double dpsi0_1mu_i1 = 6.*(u2_i1 - u_i1) ;
691 double dpsi1_u_i1 = 3.*u2_i1 - 4.*u_i1 + 1. ;
692 double dpsi1_1mu_i1 = 3.*u2_i1 - 2.*u_i1 ;
696 dfdy_i1 = (ftab(i1, j_near, k_near) * dpsi0_u_i1 * psi0_v_i1
697 - ftab(i1, j1, k_near) * dpsi0_1mu_i1 * psi0_v_i1
698 + ftab(i1, j_near, k1) * dpsi0_u_i1 * psi0_1mv_i1
699 - ftab(i1, j1, k1) * dpsi0_1mu_i1 * psi0_1mv_i1 ) / dy_i1;
701 dfdy_i1 += (dfdytab(i1, j_near, k_near) * dpsi1_u_i1 * psi0_v_i1
702 + dfdytab(i1, j1, k_near) * dpsi1_1mu_i1 * psi0_v_i1
703 + dfdytab(i1, j_near, k1) * dpsi1_u_i1 * psi0_1mv_i1
704 + dfdytab(i1, j1, k1) * dpsi1_1mu_i1 * psi0_1mv_i1) ;
706 dfdy_i1 += (dfdztab(i1, j_near, k_near) * dpsi0_u_i1 * psi1_v_i1
707 - dfdztab(i1, j1, k_near) * dpsi0_1mu_i1 * psi1_v_i1
708 - dfdztab(i1, j_near, k1) * dpsi0_u_i1 * psi1_1mv_i1
709 + dfdztab(i1, j1, k1) * dpsi0_1mu_i1 * psi1_1mv_i1) * dz_i1 /dy_i1 ;
711 double dpsi0_v_i1 = 6.*(v2_i1 - v_i1) ;
712 double dpsi0_1mv_i1 = 6.*(v2_i1 - v_i1) ;
713 double dpsi1_v_i1= 3.*v2_i1 - 4.*v_i1 + 1. ;
714 double dpsi1_1mv_i1= 3.*v2_i1 - 2.*v_i1 ;
718 dfdz_i1 = (ftab(i1, j_near, k_near) * psi0_u_i1 * dpsi0_v_i1
719 + ftab(i1, j1, k_near) * psi0_1mu_i1 * dpsi0_v_i1
720 - ftab(i1, j_near, k1) * psi0_u_i1 * dpsi0_1mv_i1
721 - ftab(i1, j1, k1) * psi0_1mu_i1 * dpsi0_1mv_i1) / dz_i1 ;
723 dfdz_i1 += (dfdytab(i1, j_near, k_near) * psi1_u_i1 * dpsi0_v_i1
724 - dfdytab(i1, j1, k_near) * psi1_1mu_i1 * dpsi0_v_i1
725 - dfdytab(i1, j_near, k1) * psi1_u_i1 * dpsi0_1mv_i1
726 + dfdytab(i1, j1, k1) * psi1_1mu_i1 * dpsi0_1mv_i1) * dy_i1 / dz_i1 ;
728 dfdz_i1 += (dfdztab(i1, j_near, k_near) * psi0_u_i1 * dpsi1_v_i1
729 + dfdztab(i1, j1, k_near) * psi0_1mu_i1 * dpsi1_v_i1
730 + dfdztab(i1, j_near, k1) * psi0_u_i1 * dpsi1_1mv_i1
731 + dfdztab(i1, j1, k1) * psi0_1mu_i1 * dpsi1_1mv_i1) ;
735 double x1 = xtab(i_near, 0, 0) ;
736 double x2 = xtab(i1, 0, 0) ;
741 double y1 = f_i_near;
743 double a = (y1-y2)/x12 ;
744 double b = (x1*y2-y1*x2)/x12 ;
749 double y1_y = dfdy_i_near;
750 double y2_y = dfdy_i1;
751 double a_y = (y1_y-y2_y)/x12 ;
752 double b_y = (x1*y2_y-y1_y*x2)/x12 ;
757 double y1_z = dfdz_i_near;
758 double y2_z = dfdz_i1;
759 double a_z = (y1_z-y2_z)/x12 ;
760 double b_z = (x1*y2_z-y1_z*x2)/x12 ;
772 void interpol_herm_2d_new_avec(
double y,
double z,
773 double mu1_11,
double mu1_21,
double mu2_11,
double mu2_12,
774 double p_11,
double p_21,
double p_12,
double p_22,
775 double n1_11,
double n1_21,
double n1_12,
double n1_22,
776 double n2_11,
double n2_21,
double n2_12,
double n2_22,
777 double cross_11,
double cross_21,
double cross_12,
double cross_22,
778 double& f,
double& dfdy,
double& dfdz) {
781 double dy = mu1_21 - mu1_11 ;
782 double dz = mu2_12 - mu2_11;
784 double u = (y - mu1_11) / dy ;
785 double v = (z - mu2_11) / dz ;
787 double u2 = u*u ;
double v2 = v*v ;
788 double u3 = u2*u ;
double v3 = v2*v ;
790 double psi0_u = 2.*u3 - 3.*u2 + 1. ;
791 double psi0_1mu = -2.*u3 + 3.*u2 ;
792 double psi1_u = u3 - 2.*u2 + u ;
793 double psi1_1mu = -u3 + u2 ;
795 double psi0_v = 2.*v3 - 3.*v2 + 1. ;
796 double psi0_1mv = -2.*v3 + 3.*v2 ;
797 double psi1_v = v3 - 2.*v2 + v ;
798 double psi1_1mv = -v3 + v2 ;
800 f = p_11 * psi0_u * psi0_v
801 + p_21 * psi0_1mu * psi0_v
802 + p_12 * psi0_u * psi0_1mv
803 + p_22 * psi0_1mu * psi0_1mv ;
805 f += (n1_11 * psi1_u * psi0_v
806 - n1_21 * psi1_1mu * psi0_v
807 + n1_12* psi1_u * psi0_1mv
808 - n1_22 * psi1_1mu * psi0_1mv) * dy ;
810 f += (n2_11 * psi0_u * psi1_v
811 + n2_21 * psi0_1mu * psi1_v
812 - n2_12 * psi0_u * psi1_1mv
813 - n2_22* psi0_1mu * psi1_1mv) * dz ;
815 f += (cross_11 * psi1_u * psi1_v
816 - cross_21 * psi1_1mu * psi1_v
817 - cross_12 * psi1_u * psi1_1mv
818 + cross_22 * psi1_1mu * psi1_1mv) * dy * dz ;
820 double dpsi0_u = 6.*(u2 - u) ;
821 double dpsi0_1mu = 6.*(u2 - u) ;
822 double dpsi1_u = 3.*u2 - 4.*u + 1. ;
823 double dpsi1_1mu = 3.*u2 - 2.*u ;
825 dfdy = (p_11 * dpsi0_u * psi0_v
826 - p_21 * dpsi0_1mu * psi0_v
827 + p_12 * dpsi0_u * psi0_1mv
828 - p_22 * dpsi0_1mu * psi0_1mv ) / dy;
830 dfdy += (n1_11* dpsi1_u * psi0_v
831 + n1_21 * dpsi1_1mu * psi0_v
832 + n1_12 * dpsi1_u * psi0_1mv
833 + n1_22 * dpsi1_1mu * psi0_1mv) ;
835 dfdy += (n2_11 * dpsi0_u * psi1_v
836 - n2_21 * dpsi0_1mu * psi1_v
837 - n2_12 * dpsi0_u * psi1_1mv
838 + n2_22 * dpsi0_1mu * psi1_1mv) * dz /dy ;
840 dfdy += (cross_11 * dpsi1_u * psi1_v
841 + cross_21* dpsi1_1mu * psi1_v
842 - cross_12 * dpsi1_u * psi1_1mv
843 - cross_22 * dpsi1_1mu * psi1_1mv) * dz ;
845 double dpsi0_v = 6.*(v2 - v) ;
846 double dpsi0_1mv = 6.*(v2 - v) ;
847 double dpsi1_v = 3.*v2 - 4.*v + 1. ;
848 double dpsi1_1mv = 3.*v2 - 2.*v ;
850 dfdz = (p_11* psi0_u * dpsi0_v
851 + p_21 * psi0_1mu * dpsi0_v
852 - p_12 * psi0_u * dpsi0_1mv
853 - p_22 * psi0_1mu * dpsi0_1mv) / dz ;
855 dfdz += (n1_11 * psi1_u * dpsi0_v
856 - n1_21 * psi1_1mu * dpsi0_v
857 - n1_12 * psi1_u * dpsi0_1mv
858 + n1_22 * psi1_1mu * dpsi0_1mv) * dy / dz ;
860 dfdz += (n2_11 * psi0_u * dpsi1_v
861 + n2_21 * psi0_1mu * dpsi1_v
862 + n2_12 * psi0_u * dpsi1_1mv
863 + n2_22 * psi0_1mu * dpsi1_1mv) ;
865 dfdz += (cross_11 * psi1_u * dpsi1_v
866 - cross_21 * psi1_1mu * dpsi1_v
867 + cross_12 * psi1_u * dpsi1_1mv
868 - cross_22 * psi1_1mu * dpsi1_1mv) * dy ;
873 void interpol_herm_2d_new_sans(
double y,
double z,
874 double mu1_11,
double mu1_21,
double mu2_11,
double mu2_12,
875 double p_11,
double p_21,
double p_12,
double p_22,
876 double n1_11,
double n1_21,
double n1_12,
double n1_22,
877 double n2_11,
double n2_21,
double n2_12,
double n2_22,
878 double& f,
double& dfdy,
double& dfdz) {
880 double dy = mu1_21 - mu1_11 ;
881 double dz = mu2_12 - mu2_11;
883 double u = (y - mu1_11) / dy ;
884 double v = (z - mu2_11) / dz ;
886 double u2 = u*u ;
double v2 = v*v ;
887 double u3 = u2*u ;
double v3 = v2*v ;
889 double psi0_u = 2.*u3 - 3.*u2 + 1. ;
890 double psi0_1mu = -2.*u3 + 3.*u2 ;
891 double psi1_u = u3 - 2.*u2 + u ;
892 double psi1_1mu = -u3 + u2 ;
894 double psi0_v = 2.*v3 - 3.*v2 + 1. ;
895 double psi0_1mv = -2.*v3 + 3.*v2 ;
896 double psi1_v = v3 - 2.*v2 + v ;
897 double psi1_1mv = -v3 + v2 ;
899 f = p_11 * psi0_u * psi0_v
900 + p_21 * psi0_1mu * psi0_v
901 + p_12 * psi0_u * psi0_1mv
902 + p_22 * psi0_1mu * psi0_1mv ;
904 f += (n1_11 * psi1_u * psi0_v
905 - n1_21 * psi1_1mu * psi0_v
906 + n1_12* psi1_u * psi0_1mv
907 - n1_22 * psi1_1mu * psi0_1mv) * dy ;
909 f += (n2_11 * psi0_u * psi1_v
910 + n2_21 * psi0_1mu * psi1_v
911 - n2_12 * psi0_u * psi1_1mv
912 - n2_22* psi0_1mu * psi1_1mv) * dz ;
914 double dpsi0_u = 6.*(u2 - u) ;
915 double dpsi0_1mu = 6.*(u2 - u) ;
916 double dpsi1_u = 3.*u2 - 4.*u + 1. ;
917 double dpsi1_1mu = 3.*u2 - 2.*u ;
919 dfdy = (p_11 * dpsi0_u * psi0_v
920 - p_21 * dpsi0_1mu * psi0_v
921 + p_12 * dpsi0_u * psi0_1mv
922 - p_22 * dpsi0_1mu * psi0_1mv ) / dy;
924 dfdy += (n1_11* dpsi1_u * psi0_v
925 + n1_21 * dpsi1_1mu * psi0_v
926 + n1_12 * dpsi1_u * psi0_1mv
927 + n1_22 * dpsi1_1mu * psi0_1mv) ;
929 dfdy += (n2_11 * dpsi0_u * psi1_v
930 - n2_21 * dpsi0_1mu * psi1_v
931 - n2_12 * dpsi0_u * psi1_1mv
932 + n2_22 * dpsi0_1mu * psi1_1mv) * dz /dy ;
934 double dpsi0_v = 6.*(v2 - v) ;
935 double dpsi0_1mv = 6.*(v2 - v) ;
936 double dpsi1_v = 3.*v2 - 4.*v + 1. ;
937 double dpsi1_1mv = 3.*v2 - 2.*v ;
940 dfdz = (p_11* psi0_u * dpsi0_v
941 + p_21 * psi0_1mu * dpsi0_v
942 - p_12 * psi0_u * dpsi0_1mv
943 - p_22 * psi0_1mu * dpsi0_1mv) / dz ;
945 dfdz += (n1_11 * psi1_u * dpsi0_v
946 - n1_21 * psi1_1mu * dpsi0_v
947 - n1_12 * psi1_u * dpsi0_1mv
948 + n1_22 * psi1_1mu * dpsi0_1mv) * dy / dz ;
950 dfdz += (n2_11 * psi0_u * dpsi1_v
951 + n2_21 * psi0_1mu * dpsi1_v
952 + n2_12 * psi0_u * dpsi1_1mv
953 + n2_22 * psi0_1mu * dpsi1_1mv) ;
972 void interpol_mixed_3d_new(
double m_1,
double m_2,
const Tbl& xtab,
const Tbl& ytab,
973 const Tbl& ztab,
const Tbl& ftab,
const Tbl& dfdytab,
974 const Tbl& dfdztab,
const Tbl& d2fdydztab,
const Tbl&
975 dlpsddelta_car,
const Tbl& d2lpsdlent1ddelta_car,
const 976 Tbl& d2lpsdlent2ddelta_car,
const Tbl& mu2_P,
const Tbl&
977 n_p_P,
const Tbl& press_P,
const Tbl& mu1_N,
const Tbl&
978 n_n_N,
const Tbl& press_N,
const Tbl& delta_car_n0,
const 979 Tbl& mu1_n0,
const Tbl& mu2_n0,
const Tbl& delta_car_p0,
980 const Tbl& mu1_p0,
const Tbl& mu2_p0,
double x,
double y,
981 double z,
double& f,
double& dfdy,
double& dfdz,
double& alpha)
983 assert(ytab.dim == xtab.dim) ;
984 assert(ztab.dim == xtab.dim) ;
985 assert(ftab.dim == xtab.dim) ;
986 assert(dfdytab.dim == xtab.dim) ;
987 assert(dfdztab.dim == xtab.dim) ;
988 assert(d2fdydztab.dim == xtab.dim) ;
990 int nbp1, nbp2, nbp3;
991 nbp1 = xtab.get_dim(2) ;
992 nbp2 = xtab.get_dim(1) ;
993 nbp3 = xtab.get_dim(0) ;
1000 while ( ( xtab(i_near,0,0) <= x ) && ( ( nbp1-1 ) > i_near ) ) {
1007 while ( ( ytab(i_near,j_near, 0) <= y ) && ( ( nbp2-1 ) > j_near ) ) {
1014 while ( ( ztab( i_near, j_near, k_near) <= z) && ( ( nbp3-1 ) > k_near ) ) {
1021 int i1 = i_near + 1 ;
1022 int j1 = j_near + 1 ;
1023 int k1 = k_near + 1 ;
1028 if ( ( xtab( i_near, j_near, k_near) > x ) || (x > xtab( i1, j_near, k_near) ) ) {
1029 cout <<
"mauvais positionnement de x dans xtab " << endl ;
1030 cout << xtab( i_near, j_near, k_near) <<
" " << x <<
" " 1031 << xtab( i1, j_near, k_near) << endl;
1035 if ( ( ytab( i_near, j_near, k_near) > y ) || (y > ytab( i1, j1, k_near) ) ) {
1036 cout <<
"mauvais positionnement de y dans ytab " << endl ;
1037 cout << ytab( i_near, j_near, k_near) * 1.009000285 * 1.66e-27 * 3e8 * 3e8
1038 /(1.6e-19 * 1e6) <<
" " << y <<
" " << ytab( i1, j1, k_near)
1039 * 1.009000285 * 1.66e-27 * 3e8 * 3e8 /(1.6e-19 * 1e6) << endl;
1043 if ( ( ztab( i_near, j_near, k_near) > z ) || ( z > ztab( i1, j_near, k1) ) ){
1044 cout <<
"mauvais positionnement de z dans ztab " << endl ;
1045 cout << ztab( i_near, j_near, k_near) <<
" " << z <<
" " 1046 << ztab( i1, j_near, k1) << endl;
1050 double f_i_near =0. ;
1051 double dfdy_i_near =0. ;
1052 double dfdz_i_near =0. ;
1053 double alpha_i_near = 0.;
1055 double dfdy_i1 =0. ;
1056 double dfdz_i1 =0. ;
1057 double alpha_i1 = 0.;
1059 int n_deltaN = delta_car_n0.get_dim(1) ;
1060 int n_mu1N = delta_car_n0.get_dim(0) ;
1061 int n_deltaP = delta_car_p0.get_dim(1) ;
1062 int n_mu2P = delta_car_p0.get_dim(0) ;
1080 while ( ( (delta_car_n0)(i_nearN_i,0) <= xtab(i_near, j_near, k_near) ) && ( ( n_deltaN-1 ) > i_nearN_i ) ) {
1083 if (i_nearN_i != 0) {
1087 while ( ( (mu1_n0)(i_nearN_i,j_nearN_i) <= y ) && ( ( n_mu1N-1 ) > j_nearN_i ) ) {
1090 if (j_nearN_i != 0) {
1115 aN_i = ((mu2_n0)(i_nearN_i,j_nearN_i+1) - (mu2_n0)(i_nearN_i,j_nearN_i) ) / ((mu1_n0)(i_nearN_i,j_nearN_i+1) - (mu1_n0)(i_nearN_i,j_nearN_i) ) ;
1116 bN_i = (mu2_n0)(i_nearN_i,j_nearN_i) - aN_i * (mu1_n0)(i_nearN_i,j_nearN_i) ;
1117 double zN_i = aN_i * y + bN_i ;
1143 while ( ( (delta_car_p0)(i_nearP_i,0) <= xtab(i_near, j_near, k_near)) && ( ( n_deltaP-1 ) > i_nearP_i ) ) {
1146 if (i_nearP_i != 0) {
1151 while ( ( (mu2_p0)(i_nearP_i,j_nearP_i) <= z ) && ( ( n_mu2P-1 ) > j_nearP_i ) ) {
1154 if (j_nearP_i != 0) {
1178 aP_i = ( (mu2_p0)(i_nearP_i,j_nearP_i+1) - (mu2_p0)(i_nearP_i,j_nearP_i) ) / ( (mu1_p0)(i_nearP_i,j_nearP_i+1) - (mu1_p0)(i_nearP_i,j_nearP_i) ) ;
1179 bP_i = (mu2_p0)(i_nearP_i,j_nearP_i) - aP_i * (mu1_p0)(i_nearP_i,j_nearP_i) ;
1180 double yP_i = (z- bP_i) /aP_i ;
1210 else if (Placei == 1 ) {
1215 interpol_herm(mu1_N, press_N, n_n_N,
1216 y, i, f_i_near , dfdy_i_near ) ;
1217 if (f_i_near < 0.) {
1218 cout <<
" INTERPOLATION FLUID N --> negative pressure " << endl ;
1222 if (dfdy_i_near < 0.) {
1223 cout <<
" INTERPOLATION FLUID N --> negative density " << endl ;
1228 else if (Placei == 2 ) {
1233 interpol_herm( mu2_P, press_P, n_p_P,
1234 z, i, f_i_near, dfdz_i_near) ;
1235 if (f_i_near < 0.) {
1236 cout <<
" INTERPOLATION FLUID P --> negative pressure " << endl ;
1240 if (dfdz_i_near < 0.) {
1241 cout <<
" INTERPOLATION FLUID P --> negative density " << endl ;
1246 else if (Placei == 0 ) {
1513 interpol_mixed_3d(xtab, ytab, ztab, ftab,
1514 dfdytab, dfdztab, d2fdydztab,
1515 xtab(i_near, j_near, k_near), y, z, f_i_near, dfdy_i_near , dfdz_i_near ) ;
1519 double der1 = 0., der2 = 0.;
1520 interpol_mixed_3d_mod(xtab, ytab, ztab, dlpsddelta_car,
1521 d2lpsdlent1ddelta_car, d2lpsdlent2ddelta_car,
1522 xtab(i_near, j_near, k_near), y, z, alpha_i_near, der1 , der2 ) ;
1524 alpha_i_near = - alpha_i_near ;
1576 while ( ( (delta_car_n0)(i_nearN_i1,0) <= xtab(i_near+1, j_near, k_near) ) && ( ( n_deltaN-1 ) > i_nearN_i1 ) ) {
1579 if (i_nearN_i1 != 0) {
1583 while ( ( (mu1_n0)(i_nearN_i1,j_nearN_i1) <= y ) && ( ( n_mu1N-1 ) > j_nearN_i1 ) ) {
1586 if (j_nearN_i1 != 0) {
1608 double aN_i1, bN_i1;
1609 aN_i1 = ((mu2_n0)(i_nearN_i1,j_nearN_i1+1) - (mu2_n0)(i_nearN_i1,j_nearN_i1) ) / ((mu1_n0)(i_nearN_i1,j_nearN_i1+1) - (mu1_n0)(i_nearN_i1,j_nearN_i1) ) ;
1610 bN_i1 = (mu2_n0)(i_nearN_i1,j_nearN_i1) - aN_i1 * (mu1_n0)(i_nearN_i1,j_nearN_i1) ;
1611 double zN_i1 = aN_i1 * y + bN_i1 ;
1635 while ( ( (delta_car_p0)(i_nearP_i1,0) <= xtab(i_near+1, j_near, k_near)) && ( ( n_deltaP-1 ) > i_nearP_i1) ) {
1638 if (i_nearP_i1 != 0) {
1642 while ( ( (mu2_p0)(i_nearP_i1,j_nearP_i1) <= z ) && ( ( n_mu2P-1 ) > j_nearP_i1 ) ) {
1645 if (j_nearP_i1 != 0) {
1667 double aP_i1, bP_i1;
1668 aP_i1 = ( (mu2_p0)(i_nearP_i1,j_nearP_i1+1) - (mu2_p0)(i_nearP_i1,j_nearP_i1) ) / ( (mu1_p0)(i_nearP_i1,j_nearP_i1+1) - (mu1_p0)(i_nearP_i1,j_nearP_i1) ) ;
1669 bP_i1 = (mu2_p0)(i_nearP_i1,j_nearP_i1) - aP_i1 * (mu1_p0)(i_nearP_i1,j_nearP_i1) ;
1670 double yP_i1 = (z- bP_i1) /aP_i1 ;
1695 if (Placei1 == 3 ) {
1701 else if (Placei1 == 1 ) {
1706 interpol_herm(mu1_N, press_N, n_n_N,
1707 y, i, f_i1 , dfdy_i1 ) ;
1709 cout <<
" INTERPOLATION FLUID N i+1 --> negative pressure " << endl ;
1714 cout <<
" INTERPOLATION FLUID N i+1--> negative density " << endl ;
1719 else if (Placei1 == 2 ) {
1724 interpol_herm( mu2_P, press_P, n_p_P,
1725 z, i, f_i1, dfdz_i1) ;
1727 cout <<
" INTERPOLATION FLUID P i+1--> negative pressure " << endl ;
1732 cout <<
" INTERPOLATION FLUID P i+1 --> negative density " << endl ;
1737 else if (Placei1 == 0 ) {
1986 interpol_mixed_3d(xtab, ytab, ztab, ftab,
1987 dfdytab, dfdztab, d2fdydztab,
1988 xtab(i1, j_near, k_near), y, z, f_i1, dfdy_i1 , dfdz_i1 ) ;
1990 double der1b = 0., der2b = 0.;
1991 interpol_mixed_3d_mod(xtab, ytab, ztab, dlpsddelta_car,
1992 d2lpsdlent1ddelta_car, d2lpsdlent2ddelta_car,
1993 xtab(i1, j_near, k_near), y, z, alpha_i1, der1b , der2b ) ;
1994 alpha_i1 = - alpha_i1 ;
2026 double x1 = xtab(i_near, 0, 0) ;
2027 double x2 = xtab(i1, 0, 0) ;
2028 double x12 = x1-x2 ;
2031 double y1 = f_i_near;
2033 double a = (y1-y2)/x12 ;
2034 double b = (x1*y2-y1*x2)/x12 ;
2039 double y1_y = dfdy_i_near;
2040 double y2_y = dfdy_i1;
2041 double a_y = (y1_y-y2_y)/x12 ;
2042 double b_y = (x1*y2_y-y1_y*x2)/x12 ;
2047 double y1_z = dfdz_i_near;
2048 double y2_z = dfdz_i1;
2049 double a_z = (y1_z-y2_z)/x12 ;
2050 double b_z = (x1*y2_z-y1_z*x2)/x12 ;
2055 double y1_alpha = alpha_i_near;
2056 double y2_alpha = alpha_i1;
2057 double a_alpha = (y1_alpha-y2_alpha)/x12 ;
2058 double b_alpha = (x1*y2_alpha-y1_alpha*x2)/x12 ;
2060 alpha = x*a_alpha+b_alpha ;