41 a[1+1*4] * (
a[2+2*4] *
a[3+3*4] -
a[2+3*4] *
a[3+2*4] )
42 -
a[1+2*4] * (
a[2+1*4] *
a[3+3*4] -
a[2+3*4] *
a[3+1*4] )
43 +
a[1+3*4] * (
a[2+1*4] *
a[3+2*4] -
a[2+2*4] *
a[3+1*4] ) )
45 a[1+0*4] * (
a[2+2*4] *
a[3+3*4] -
a[2+3*4] *
a[3+2*4] )
46 -
a[1+2*4] * (
a[2+0*4] *
a[3+3*4] -
a[2+3*4] *
a[3+0*4] )
47 +
a[1+3*4] * (
a[2+0*4] *
a[3+2*4] -
a[2+2*4] *
a[3+0*4] ) )
49 a[1+0*4] * (
a[2+1*4] *
a[3+3*4] -
a[2+3*4] *
a[3+1*4] )
50 -
a[1+1*4] * (
a[2+0*4] *
a[3+3*4] -
a[2+3*4] *
a[3+0*4] )
51 +
a[1+3*4] * (
a[2+0*4] *
a[3+1*4] -
a[2+1*4] *
a[3+0*4] ) )
53 a[1+0*4] * (
a[2+1*4] *
a[3+2*4] -
a[2+2*4] *
a[3+1*4] )
54 -
a[1+1*4] * (
a[2+0*4] *
a[3+2*4] -
a[2+2*4] *
a[3+0*4] )
55 +
a[1+2*4] * (
a[2+0*4] *
a[3+1*4] -
a[2+1*4] *
a[3+0*4] ) );
111 for (
i = 0;
i < 3;
i++ )
113 for (
j = 0;
j <
n;
j++ )
115 phy[
i+
j*3] =
t[
i+0*3] * ( 1.0 - ref[0+
j*3] - ref[1+
j*3] - ref[2+
j*3] )
116 +
t[
i+1*3] * + ref[0+
j*3]
117 +
t[
i+2*3] * + ref[1+
j*3]
118 +
t[
i+3*3] * + ref[2+
j*3];
163 if ( 1 <= rule && rule <= 7 )
170 fprintf ( stderr,
"\n" );
171 fprintf ( stderr,
"TETRAHEDRON_NCC_DEGREE - Fatal error!\n" );
172 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
227 order_num = order_num + suborder[
order];
279 double *suborder_xyz;
285 suborder_xyz = (
double * ) malloc ( 4 * suborder_num *
sizeof (
double ) );
286 suborder_w = (
double * ) malloc ( suborder_num *
sizeof (
double ) );
296 for ( s = 0; s < suborder_num; s++ )
298 if ( suborder[s] == 1 )
300 xyz[0+o*3] = suborder_xyz[0+s*4];
301 xyz[1+o*3] = suborder_xyz[1+s*4];
302 xyz[2+o*3] = suborder_xyz[2+s*4];
303 w[o] = suborder_w[s];
314 else if ( suborder[s] == 4 )
316 xyz[0+o*3] = suborder_xyz[0+s*4];
317 xyz[1+o*3] = suborder_xyz[1+s*4];
318 xyz[2+o*3] = suborder_xyz[2+s*4];
319 w[o] = suborder_w[s];
322 xyz[0+o*3] = suborder_xyz[0+s*4];
323 xyz[1+o*3] = suborder_xyz[1+s*4];
324 xyz[2+o*3] = suborder_xyz[3+s*4];
325 w[o] = suborder_w[s];
328 xyz[0+o*3] = suborder_xyz[0+s*4];
329 xyz[1+o*3] = suborder_xyz[3+s*4];
330 xyz[2+o*3] = suborder_xyz[1+s*4];
331 w[o] = suborder_w[s];
334 xyz[0+o*3] = suborder_xyz[3+s*4];
335 xyz[1+o*3] = suborder_xyz[0+s*4];
336 xyz[2+o*3] = suborder_xyz[1+s*4];
337 w[o] = suborder_w[s];
350 else if ( suborder[s] == 6 )
352 xyz[0+o*3] = suborder_xyz[0+s*4];
353 xyz[1+o*3] = suborder_xyz[1+s*4];
354 xyz[2+o*3] = suborder_xyz[2+s*4];
355 w[o] = suborder_w[s];
358 xyz[0+o*3] = suborder_xyz[0+s*4];
359 xyz[1+o*3] = suborder_xyz[2+s*4];
360 xyz[2+o*3] = suborder_xyz[1+s*4];
361 w[o] = suborder_w[s];
364 xyz[0+o*3] = suborder_xyz[0+s*4];
365 xyz[1+o*3] = suborder_xyz[2+s*4];
366 xyz[2+o*3] = suborder_xyz[3+s*4];
367 w[o] = suborder_w[s];
370 xyz[0+o*3] = suborder_xyz[2+s*4];
371 xyz[1+o*3] = suborder_xyz[0+s*4];
372 xyz[2+o*3] = suborder_xyz[1+s*4];
373 w[o] = suborder_w[s];
376 xyz[0+o*3] = suborder_xyz[2+s*4];
377 xyz[1+o*3] = suborder_xyz[0+s*4];
378 xyz[2+o*3] = suborder_xyz[3+s*4];
379 w[o] = suborder_w[s];
382 xyz[0+o*3] = suborder_xyz[2+s*4];
383 xyz[1+o*3] = suborder_xyz[3+s*4];
384 xyz[2+o*3] = suborder_xyz[0+s*4];
385 w[o] = suborder_w[s];
404 else if ( suborder[s] == 12 )
406 xyz[0+o*3] = suborder_xyz[0+s*4];
407 xyz[1+o*3] = suborder_xyz[1+s*4];
408 xyz[2+o*3] = suborder_xyz[2+s*4];
409 w[o] = suborder_w[s];
412 xyz[0+o*3] = suborder_xyz[0+s*4];
413 xyz[1+o*3] = suborder_xyz[1+s*4];
414 xyz[2+o*3] = suborder_xyz[3+s*4];
415 w[o] = suborder_w[s];
418 xyz[0+o*3] = suborder_xyz[0+s*4];
419 xyz[1+o*3] = suborder_xyz[2+s*4];
420 xyz[2+o*3] = suborder_xyz[1+s*4];
421 w[o] = suborder_w[s];
424 xyz[0+o*3] = suborder_xyz[0+s*4];
425 xyz[1+o*3] = suborder_xyz[2+s*4];
426 xyz[2+o*3] = suborder_xyz[3+s*4];
427 w[o] = suborder_w[s];
430 xyz[0+o*3] = suborder_xyz[0+s*4];
431 xyz[1+o*3] = suborder_xyz[3+s*4];
432 xyz[2+o*3] = suborder_xyz[1+s*4];
433 w[o] = suborder_w[s];
436 xyz[0+o*3] = suborder_xyz[0+s*4];
437 xyz[1+o*3] = suborder_xyz[3+s*4];
438 xyz[2+o*3] = suborder_xyz[2+s*4];
439 w[o] = suborder_w[s];
442 xyz[0+o*3] = suborder_xyz[2+s*4];
443 xyz[1+o*3] = suborder_xyz[0+s*4];
444 xyz[2+o*3] = suborder_xyz[1+s*4];
445 w[o] = suborder_w[s];
448 xyz[0+o*3] = suborder_xyz[2+s*4];
449 xyz[1+o*3] = suborder_xyz[0+s*4];
450 xyz[2+o*3] = suborder_xyz[3+s*4];
451 w[o] = suborder_w[s];
454 xyz[0+o*3] = suborder_xyz[2+s*4];
455 xyz[1+o*3] = suborder_xyz[3+s*4];
456 xyz[2+o*3] = suborder_xyz[1+s*4];
457 w[o] = suborder_w[s];
460 xyz[0+o*3] = suborder_xyz[3+s*4];
461 xyz[1+o*3] = suborder_xyz[0+s*4];
462 xyz[2+o*3] = suborder_xyz[1+s*4];
463 w[o] = suborder_w[s];
466 xyz[0+o*3] = suborder_xyz[3+s*4];
467 xyz[1+o*3] = suborder_xyz[0+s*4];
468 xyz[2+o*3] = suborder_xyz[2+s*4];
469 w[o] = suborder_w[s];
472 xyz[0+o*3] = suborder_xyz[3+s*4];
473 xyz[1+o*3] = suborder_xyz[2+s*4];
474 xyz[2+o*3] = suborder_xyz[0+s*4];
475 w[o] = suborder_w[s];
506 else if ( suborder[s] == 24 )
508 xyz[0+o*3] = suborder_xyz[0+s*4];
509 xyz[1+o*3] = suborder_xyz[1+s*4];
510 xyz[2+o*3] = suborder_xyz[2+s*4];
511 w[o] = suborder_w[s];
514 xyz[0+o*3] = suborder_xyz[0+s*4];
515 xyz[1+o*3] = suborder_xyz[1+s*4];
516 xyz[2+o*3] = suborder_xyz[3+s*4];
517 w[o] = suborder_w[s];
520 xyz[0+o*3] = suborder_xyz[0+s*4];
521 xyz[1+o*3] = suborder_xyz[2+s*4];
522 xyz[2+o*3] = suborder_xyz[1+s*4];
523 w[o] = suborder_w[s];
526 xyz[0+o*3] = suborder_xyz[0+s*4];
527 xyz[1+o*3] = suborder_xyz[2+s*4];
528 xyz[2+o*3] = suborder_xyz[3+s*4];
529 w[o] = suborder_w[s];
532 xyz[0+o*3] = suborder_xyz[0+s*4];
533 xyz[1+o*3] = suborder_xyz[3+s*4];
534 xyz[2+o*3] = suborder_xyz[1+s*4];
535 w[o] = suborder_w[s];
538 xyz[0+o*3] = suborder_xyz[0+s*4];
539 xyz[1+o*3] = suborder_xyz[3+s*4];
540 xyz[2+o*3] = suborder_xyz[2+s*4];
541 w[o] = suborder_w[s];
544 xyz[0+o*3] = suborder_xyz[1+s*4];
545 xyz[1+o*3] = suborder_xyz[0+s*4];
546 xyz[2+o*3] = suborder_xyz[3+s*4];
547 w[o] = suborder_w[s];
550 xyz[0+o*3] = suborder_xyz[1+s*4];
551 xyz[1+o*3] = suborder_xyz[0+s*4];
552 xyz[2+o*3] = suborder_xyz[4+s*4];
553 w[o] = suborder_w[s];
556 xyz[0+o*3] = suborder_xyz[1+s*4];
557 xyz[1+o*3] = suborder_xyz[2+s*4];
558 xyz[2+o*3] = suborder_xyz[0+s*4];
559 w[o] = suborder_w[s];
562 xyz[0+o*3] = suborder_xyz[1+s*4];
563 xyz[1+o*3] = suborder_xyz[2+s*4];
564 xyz[2+o*3] = suborder_xyz[3+s*4];
565 w[o] = suborder_w[s];
568 xyz[0+o*3] = suborder_xyz[1+s*4];
569 xyz[1+o*3] = suborder_xyz[3+s*4];
570 xyz[2+o*3] = suborder_xyz[0+s*4];
571 w[o] = suborder_w[s];
574 xyz[0+o*3] = suborder_xyz[1+s*4];
575 xyz[1+o*3] = suborder_xyz[3+s*4];
576 xyz[2+o*3] = suborder_xyz[2+s*4];
577 w[o] = suborder_w[s];
580 xyz[0+o*3] = suborder_xyz[2+s*4];
581 xyz[1+o*3] = suborder_xyz[0+s*4];
582 xyz[2+o*3] = suborder_xyz[1+s*4];
583 w[o] = suborder_w[s];
586 xyz[0+o*3] = suborder_xyz[2+s*4];
587 xyz[1+o*3] = suborder_xyz[0+s*4];
588 xyz[2+o*3] = suborder_xyz[3+s*4];
589 w[o] = suborder_w[s];
592 xyz[0+o*3] = suborder_xyz[2+s*4];
593 xyz[1+o*3] = suborder_xyz[1+s*4];
594 xyz[2+o*3] = suborder_xyz[0+s*4];
595 w[o] = suborder_w[s];
598 xyz[0+o*3] = suborder_xyz[2+s*4];
599 xyz[1+o*3] = suborder_xyz[1+s*4];
600 xyz[2+o*3] = suborder_xyz[3+s*4];
601 w[o] = suborder_w[s];
604 xyz[0+o*3] = suborder_xyz[2+s*4];
605 xyz[1+o*3] = suborder_xyz[3+s*4];
606 xyz[2+o*3] = suborder_xyz[0+s*4];
607 w[o] = suborder_w[s];
610 xyz[0+o*3] = suborder_xyz[2+s*4];
611 xyz[1+o*3] = suborder_xyz[3+s*4];
612 xyz[2+o*3] = suborder_xyz[1+s*4];
613 w[o] = suborder_w[s];
616 xyz[0+o*3] = suborder_xyz[3+s*4];
617 xyz[1+o*3] = suborder_xyz[0+s*4];
618 xyz[2+o*3] = suborder_xyz[1+s*4];
619 w[o] = suborder_w[s];
622 xyz[0+o*3] = suborder_xyz[3+s*4];
623 xyz[1+o*3] = suborder_xyz[0+s*4];
624 xyz[2+o*3] = suborder_xyz[2+s*4];
625 w[o] = suborder_w[s];
628 xyz[0+o*3] = suborder_xyz[3+s*4];
629 xyz[1+o*3] = suborder_xyz[1+s*4];
630 xyz[2+o*3] = suborder_xyz[0+s*4];
631 w[o] = suborder_w[s];
634 xyz[0+o*3] = suborder_xyz[3+s*4];
635 xyz[1+o*3] = suborder_xyz[1+s*4];
636 xyz[2+o*3] = suborder_xyz[2+s*4];
637 w[o] = suborder_w[s];
640 xyz[0+o*3] = suborder_xyz[3+s*4];
641 xyz[1+o*3] = suborder_xyz[2+s*4];
642 xyz[2+o*3] = suborder_xyz[0+s*4];
643 w[o] = suborder_w[s];
646 xyz[0+o*3] = suborder_xyz[3+s*4];
647 xyz[1+o*3] = suborder_xyz[2+s*4];
648 xyz[2+o*3] = suborder_xyz[1+s*4];
649 w[o] = suborder_w[s];
654 fprintf ( stderr,
"\n" );
655 fprintf ( stderr,
"TETRAHEDRON_NCC_RULE - Fatal error!\n" );
656 fprintf ( stderr,
" Illegal SUBORDER(%d) = %d\n", s, suborder[s] );
662 free ( suborder_xyz );
748 suborder = (
int * ) malloc ( suborder_num *
sizeof (
int ) );
754 else if ( rule == 2 )
758 else if ( rule == 3 )
763 else if ( rule == 4 )
769 else if ( rule == 5 )
777 else if ( rule == 6 )
786 else if ( rule == 7 )
800 fprintf ( stderr,
"\n" );
801 fprintf ( stderr,
"TETRAHEDRON_NCC_SUBORDER - Fatal error!\n" );
802 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
851 else if ( rule == 2 )
855 else if ( rule == 3 )
859 else if ( rule == 4 )
863 else if ( rule == 5 )
867 else if ( rule == 6 )
871 else if ( rule == 7 )
878 fprintf ( stderr,
"\n" );
879 fprintf ( stderr,
"TETRAHEDRON_NCC_SUBORDER_NUM - Fatal error!\n" );
880 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
889 double suborder_xyz[],
double suborder_w[] )
935 suborder_xyz_n = (
int * ) malloc ( 4 * suborder_num *
sizeof (
int ) );
936 suborder_w_n = (
int * ) malloc ( suborder_num *
sizeof (
int ) );
941 suborder_w_n, &suborder_w_d );
943 else if ( rule == 2 )
946 suborder_w_n, &suborder_w_d );
948 else if ( rule == 3 )
951 suborder_w_n, &suborder_w_d );
953 else if ( rule == 4 )
956 suborder_w_n, &suborder_w_d );
958 else if ( rule == 5 )
961 suborder_w_n, &suborder_w_d );
963 else if ( rule == 6 )
966 suborder_w_n, &suborder_w_d );
968 else if ( rule == 7 )
971 suborder_w_n, &suborder_w_d );
975 fprintf ( stderr,
"\n" );
976 fprintf ( stderr,
"TETRAHEDRON_NCC_SUBRULE - Fatal error!\n" );
977 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
981 for ( s = 0; s < suborder_num; s++ )
983 for (
i = 0;
i < 4;
i++ )
985 suborder_xyz[
i+s*4] =
986 (
double ) ( suborder_xyz_n[
i+s*4] )
987 / (
double ) ( suborder_xyz_d );
990 for ( s = 0; s < suborder_num; s++ )
992 suborder_w[s] = (
double ) suborder_w_n[s] / (
double ) suborder_w_d;
995 free ( suborder_w_n );
996 free ( suborder_xyz_n );
1003 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1049 int suborder_xyz_n_01[4*1] = {
1052 int suborder_xyz_d_01 = 4;
1053 int suborder_w_n_01[1] = { 1 };
1054 int suborder_w_d_01 = 1;
1056 for ( s = 0; s < suborder_num; s++ )
1058 for (
i = 0;
i < 4;
i++ )
1060 suborder_xyz_n[
i+s*4] = suborder_xyz_n_01[
i+s*4];
1063 *suborder_xyz_d = suborder_xyz_d_01;
1065 for ( s = 0; s < suborder_num; s++ )
1067 suborder_w_n[s] = suborder_w_n_01[s];
1069 *suborder_w_d = suborder_w_d_01;
1076 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1122 int suborder_xyz_n_02[4*1] = {
1125 int suborder_xyz_d_02 = 1;
1126 int suborder_w_n_02[1] = { 1 };
1127 int suborder_w_d_02 = 4;
1129 for ( s = 0; s < suborder_num; s++ )
1131 for (
i = 0;
i < 4;
i++ )
1133 suborder_xyz_n[
i+s*4] = suborder_xyz_n_02[
i+s*4];
1136 *suborder_xyz_d = suborder_xyz_d_02;
1138 for ( s = 0; s < suborder_num; s++ )
1140 suborder_w_n[s] = suborder_w_n_02[s];
1142 *suborder_w_d = suborder_w_d_02;
1149 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1195 int suborder_xyz_n_03[4*2] = {
1199 int suborder_xyz_d_03 = 2;
1200 int suborder_w_n_03[2] = { -1, 4 };
1201 int suborder_w_d_03 = 20;
1203 for ( s = 0; s < suborder_num; s++ )
1205 for (
i = 0;
i < 4;
i++ )
1207 suborder_xyz_n[
i+s*4] = suborder_xyz_n_03[
i+s*4];
1210 *suborder_xyz_d = suborder_xyz_d_03;
1212 for ( s = 0; s < suborder_num; s++ )
1214 suborder_w_n[s] = suborder_w_n_03[s];
1216 *suborder_w_d = suborder_w_d_03;
1223 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1269 int suborder_xyz_n_04[4*3] = {
1274 int suborder_xyz_d_04 = 3;
1275 int suborder_w_n_04[3] = { 1, 0, 9 };
1276 int suborder_w_d_04 = 40;
1278 for ( s = 0; s < suborder_num; s++ )
1280 for (
i = 0;
i < 4;
i++ )
1282 suborder_xyz_n[
i+s*4] = suborder_xyz_n_04[
i+s*4];
1285 *suborder_xyz_d = suborder_xyz_d_04;
1287 for ( s = 0; s < suborder_num; s++ )
1289 suborder_w_n[s] = suborder_w_n_04[s];
1291 *suborder_w_d = suborder_w_d_04;
1298 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1344 int suborder_xyz_n_05[4*5] = {
1351 int suborder_xyz_d_05 = 4;
1352 int suborder_w_n_05[5] = { -5, 16, -12, 16, 128 };
1353 int suborder_w_d_05 = 420;
1355 for ( s = 0; s < suborder_num; s++ )
1357 for (
i = 0;
i < 4;
i++ )
1359 suborder_xyz_n[
i+s*4] = suborder_xyz_n_05[
i+s*4];
1362 *suborder_xyz_d = suborder_xyz_d_05;
1364 for ( s = 0; s < suborder_num; s++ )
1366 suborder_w_n[s] = suborder_w_n_05[s];
1368 *suborder_w_d = suborder_w_d_05;
1375 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1421 int suborder_xyz_n_06[4*6] = {
1429 int suborder_xyz_d_06 = 5;
1430 int suborder_w_n_06[6] = { 33, -35, 35, 275, -75, 375 };
1431 int suborder_w_d_06 = 4032;
1433 for ( s = 0; s < suborder_num; s++ )
1435 for (
i = 0;
i < 4;
i++ )
1437 suborder_xyz_n[
i+s*4] = suborder_xyz_n_06[
i+s*4];
1440 *suborder_xyz_d = suborder_xyz_d_06;
1442 for ( s = 0; s < suborder_num; s++ )
1444 suborder_w_n[s] = suborder_w_n_06[s];
1446 *suborder_w_d = suborder_w_d_06;
1453 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1499 int suborder_xyz_n_07[4*9] = {
1510 int suborder_xyz_d_07 = 6;
1511 int suborder_w_n_07[9] = { -7, 24, -30, 0, 40, 30, 180, -45, 0 };
1512 int suborder_w_d_07 = 1400;
1514 for ( s = 0; s < suborder_num; s++ )
1516 for (
i = 0;
i < 4;
i++ )
1518 suborder_xyz_n[
i+s*4] = suborder_xyz_n_07[
i+s*4];
1521 *suborder_xyz_d = suborder_xyz_d_07;
1523 for ( s = 0; s < suborder_num; s++ )
1525 suborder_w_n[s] = suborder_w_n_07[s];
1527 *suborder_w_d = suborder_w_d_07;
1565 for (
i = 0;
i < 3;
i++ )
1567 for (
j = 0;
j < 4;
j++ )
1569 a[
i+
j*4] = tetra[
i+
j*3];
1574 for (
j = 0;
j < 4;
j++ )