42 a[1+1*4] * (
a[2+2*4] *
a[3+3*4] -
a[2+3*4] *
a[3+2*4] )
43 -
a[1+2*4] * (
a[2+1*4] *
a[3+3*4] -
a[2+3*4] *
a[3+1*4] )
44 +
a[1+3*4] * (
a[2+1*4] *
a[3+2*4] -
a[2+2*4] *
a[3+1*4] ) )
46 a[1+0*4] * (
a[2+2*4] *
a[3+3*4] -
a[2+3*4] *
a[3+2*4] )
47 -
a[1+2*4] * (
a[2+0*4] *
a[3+3*4] -
a[2+3*4] *
a[3+0*4] )
48 +
a[1+3*4] * (
a[2+0*4] *
a[3+2*4] -
a[2+2*4] *
a[3+0*4] ) )
50 a[1+0*4] * (
a[2+1*4] *
a[3+3*4] -
a[2+3*4] *
a[3+1*4] )
51 -
a[1+1*4] * (
a[2+0*4] *
a[3+3*4] -
a[2+3*4] *
a[3+0*4] )
52 +
a[1+3*4] * (
a[2+0*4] *
a[3+1*4] -
a[2+1*4] *
a[3+0*4] ) )
54 a[1+0*4] * (
a[2+1*4] *
a[3+2*4] -
a[2+2*4] *
a[3+1*4] )
55 -
a[1+1*4] * (
a[2+0*4] *
a[3+2*4] -
a[2+2*4] *
a[3+0*4] )
56 +
a[1+2*4] * (
a[2+0*4] *
a[3+1*4] -
a[2+1*4] *
a[3+0*4] ) );
112 for (
i = 0;
i < 3;
i++ )
114 for (
j = 0;
j <
n;
j++ )
116 phy[
i+
j*3] =
t[
i+0*3] * ( 1.0 - ref[0+
j*3] - ref[1+
j*3] - ref[2+
j*3] )
117 +
t[
i+1*3] * + ref[0+
j*3]
118 +
t[
i+2*3] * + ref[1+
j*3]
119 +
t[
i+3*3] * + ref[2+
j*3];
164 if ( 1 <= rule && rule <= 7 )
171 fprintf ( stderr,
"\n" );
172 fprintf ( stderr,
"TETRAHEDRON_NCO_DEGREE - Fatal error!\n" );
173 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
228 order_num = order_num + suborder[
order];
280 double *suborder_xyz;
286 suborder_xyz = (
double * ) malloc ( 4 * suborder_num *
sizeof (
double ) );
287 suborder_w = (
double * ) malloc ( suborder_num *
sizeof (
double ) );
297 for ( s = 0; s < suborder_num; s++ )
299 if ( suborder[s] == 1 )
301 xyz[0+o*3] = suborder_xyz[0+s*4];
302 xyz[1+o*3] = suborder_xyz[1+s*4];
303 xyz[2+o*3] = suborder_xyz[2+s*4];
304 w[o] = suborder_w[s];
315 else if ( suborder[s] == 4 )
317 xyz[0+o*3] = suborder_xyz[0+s*4];
318 xyz[1+o*3] = suborder_xyz[1+s*4];
319 xyz[2+o*3] = suborder_xyz[2+s*4];
320 w[o] = suborder_w[s];
323 xyz[0+o*3] = suborder_xyz[0+s*4];
324 xyz[1+o*3] = suborder_xyz[1+s*4];
325 xyz[2+o*3] = suborder_xyz[3+s*4];
326 w[o] = suborder_w[s];
329 xyz[0+o*3] = suborder_xyz[0+s*4];
330 xyz[1+o*3] = suborder_xyz[3+s*4];
331 xyz[2+o*3] = suborder_xyz[1+s*4];
332 w[o] = suborder_w[s];
335 xyz[0+o*3] = suborder_xyz[3+s*4];
336 xyz[1+o*3] = suborder_xyz[0+s*4];
337 xyz[2+o*3] = suborder_xyz[1+s*4];
338 w[o] = suborder_w[s];
351 else if ( suborder[s] == 6 )
353 xyz[0+o*3] = suborder_xyz[0+s*4];
354 xyz[1+o*3] = suborder_xyz[1+s*4];
355 xyz[2+o*3] = suborder_xyz[2+s*4];
356 w[o] = suborder_w[s];
359 xyz[0+o*3] = suborder_xyz[0+s*4];
360 xyz[1+o*3] = suborder_xyz[2+s*4];
361 xyz[2+o*3] = suborder_xyz[1+s*4];
362 w[o] = suborder_w[s];
365 xyz[0+o*3] = suborder_xyz[0+s*4];
366 xyz[1+o*3] = suborder_xyz[2+s*4];
367 xyz[2+o*3] = suborder_xyz[3+s*4];
368 w[o] = suborder_w[s];
371 xyz[0+o*3] = suborder_xyz[2+s*4];
372 xyz[1+o*3] = suborder_xyz[0+s*4];
373 xyz[2+o*3] = suborder_xyz[1+s*4];
374 w[o] = suborder_w[s];
377 xyz[0+o*3] = suborder_xyz[2+s*4];
378 xyz[1+o*3] = suborder_xyz[0+s*4];
379 xyz[2+o*3] = suborder_xyz[3+s*4];
380 w[o] = suborder_w[s];
383 xyz[0+o*3] = suborder_xyz[2+s*4];
384 xyz[1+o*3] = suborder_xyz[3+s*4];
385 xyz[2+o*3] = suborder_xyz[0+s*4];
386 w[o] = suborder_w[s];
405 else if ( suborder[s] == 12 )
407 xyz[0+o*3] = suborder_xyz[0+s*4];
408 xyz[1+o*3] = suborder_xyz[1+s*4];
409 xyz[2+o*3] = suborder_xyz[2+s*4];
410 w[o] = suborder_w[s];
413 xyz[0+o*3] = suborder_xyz[0+s*4];
414 xyz[1+o*3] = suborder_xyz[1+s*4];
415 xyz[2+o*3] = suborder_xyz[3+s*4];
416 w[o] = suborder_w[s];
419 xyz[0+o*3] = suborder_xyz[0+s*4];
420 xyz[1+o*3] = suborder_xyz[2+s*4];
421 xyz[2+o*3] = suborder_xyz[1+s*4];
422 w[o] = suborder_w[s];
425 xyz[0+o*3] = suborder_xyz[0+s*4];
426 xyz[1+o*3] = suborder_xyz[2+s*4];
427 xyz[2+o*3] = suborder_xyz[3+s*4];
428 w[o] = suborder_w[s];
431 xyz[0+o*3] = suborder_xyz[0+s*4];
432 xyz[1+o*3] = suborder_xyz[3+s*4];
433 xyz[2+o*3] = suborder_xyz[1+s*4];
434 w[o] = suborder_w[s];
437 xyz[0+o*3] = suborder_xyz[0+s*4];
438 xyz[1+o*3] = suborder_xyz[3+s*4];
439 xyz[2+o*3] = suborder_xyz[2+s*4];
440 w[o] = suborder_w[s];
443 xyz[0+o*3] = suborder_xyz[2+s*4];
444 xyz[1+o*3] = suborder_xyz[0+s*4];
445 xyz[2+o*3] = suborder_xyz[1+s*4];
446 w[o] = suborder_w[s];
449 xyz[0+o*3] = suborder_xyz[2+s*4];
450 xyz[1+o*3] = suborder_xyz[0+s*4];
451 xyz[2+o*3] = suborder_xyz[3+s*4];
452 w[o] = suborder_w[s];
455 xyz[0+o*3] = suborder_xyz[2+s*4];
456 xyz[1+o*3] = suborder_xyz[3+s*4];
457 xyz[2+o*3] = suborder_xyz[1+s*4];
458 w[o] = suborder_w[s];
461 xyz[0+o*3] = suborder_xyz[3+s*4];
462 xyz[1+o*3] = suborder_xyz[0+s*4];
463 xyz[2+o*3] = suborder_xyz[1+s*4];
464 w[o] = suborder_w[s];
467 xyz[0+o*3] = suborder_xyz[3+s*4];
468 xyz[1+o*3] = suborder_xyz[0+s*4];
469 xyz[2+o*3] = suborder_xyz[2+s*4];
470 w[o] = suborder_w[s];
473 xyz[0+o*3] = suborder_xyz[3+s*4];
474 xyz[1+o*3] = suborder_xyz[2+s*4];
475 xyz[2+o*3] = suborder_xyz[0+s*4];
476 w[o] = suborder_w[s];
507 else if ( suborder[s] == 24 )
509 xyz[0+o*3] = suborder_xyz[0+s*4];
510 xyz[1+o*3] = suborder_xyz[1+s*4];
511 xyz[2+o*3] = suborder_xyz[2+s*4];
512 w[o] = suborder_w[s];
515 xyz[0+o*3] = suborder_xyz[0+s*4];
516 xyz[1+o*3] = suborder_xyz[1+s*4];
517 xyz[2+o*3] = suborder_xyz[3+s*4];
518 w[o] = suborder_w[s];
521 xyz[0+o*3] = suborder_xyz[0+s*4];
522 xyz[1+o*3] = suborder_xyz[2+s*4];
523 xyz[2+o*3] = suborder_xyz[1+s*4];
524 w[o] = suborder_w[s];
527 xyz[0+o*3] = suborder_xyz[0+s*4];
528 xyz[1+o*3] = suborder_xyz[2+s*4];
529 xyz[2+o*3] = suborder_xyz[3+s*4];
530 w[o] = suborder_w[s];
533 xyz[0+o*3] = suborder_xyz[0+s*4];
534 xyz[1+o*3] = suborder_xyz[3+s*4];
535 xyz[2+o*3] = suborder_xyz[1+s*4];
536 w[o] = suborder_w[s];
539 xyz[0+o*3] = suborder_xyz[0+s*4];
540 xyz[1+o*3] = suborder_xyz[3+s*4];
541 xyz[2+o*3] = suborder_xyz[2+s*4];
542 w[o] = suborder_w[s];
545 xyz[0+o*3] = suborder_xyz[1+s*4];
546 xyz[1+o*3] = suborder_xyz[0+s*4];
547 xyz[2+o*3] = suborder_xyz[3+s*4];
548 w[o] = suborder_w[s];
551 xyz[0+o*3] = suborder_xyz[1+s*4];
552 xyz[1+o*3] = suborder_xyz[0+s*4];
553 xyz[2+o*3] = suborder_xyz[4+s*4];
554 w[o] = suborder_w[s];
557 xyz[0+o*3] = suborder_xyz[1+s*4];
558 xyz[1+o*3] = suborder_xyz[2+s*4];
559 xyz[2+o*3] = suborder_xyz[0+s*4];
560 w[o] = suborder_w[s];
563 xyz[0+o*3] = suborder_xyz[1+s*4];
564 xyz[1+o*3] = suborder_xyz[2+s*4];
565 xyz[2+o*3] = suborder_xyz[3+s*4];
566 w[o] = suborder_w[s];
569 xyz[0+o*3] = suborder_xyz[1+s*4];
570 xyz[1+o*3] = suborder_xyz[3+s*4];
571 xyz[2+o*3] = suborder_xyz[0+s*4];
572 w[o] = suborder_w[s];
575 xyz[0+o*3] = suborder_xyz[1+s*4];
576 xyz[1+o*3] = suborder_xyz[3+s*4];
577 xyz[2+o*3] = suborder_xyz[2+s*4];
578 w[o] = suborder_w[s];
581 xyz[0+o*3] = suborder_xyz[2+s*4];
582 xyz[1+o*3] = suborder_xyz[0+s*4];
583 xyz[2+o*3] = suborder_xyz[1+s*4];
584 w[o] = suborder_w[s];
587 xyz[0+o*3] = suborder_xyz[2+s*4];
588 xyz[1+o*3] = suborder_xyz[0+s*4];
589 xyz[2+o*3] = suborder_xyz[3+s*4];
590 w[o] = suborder_w[s];
593 xyz[0+o*3] = suborder_xyz[2+s*4];
594 xyz[1+o*3] = suborder_xyz[1+s*4];
595 xyz[2+o*3] = suborder_xyz[0+s*4];
596 w[o] = suborder_w[s];
599 xyz[0+o*3] = suborder_xyz[2+s*4];
600 xyz[1+o*3] = suborder_xyz[1+s*4];
601 xyz[2+o*3] = suborder_xyz[3+s*4];
602 w[o] = suborder_w[s];
605 xyz[0+o*3] = suborder_xyz[2+s*4];
606 xyz[1+o*3] = suborder_xyz[3+s*4];
607 xyz[2+o*3] = suborder_xyz[0+s*4];
608 w[o] = suborder_w[s];
611 xyz[0+o*3] = suborder_xyz[2+s*4];
612 xyz[1+o*3] = suborder_xyz[3+s*4];
613 xyz[2+o*3] = suborder_xyz[1+s*4];
614 w[o] = suborder_w[s];
617 xyz[0+o*3] = suborder_xyz[3+s*4];
618 xyz[1+o*3] = suborder_xyz[0+s*4];
619 xyz[2+o*3] = suborder_xyz[1+s*4];
620 w[o] = suborder_w[s];
623 xyz[0+o*3] = suborder_xyz[3+s*4];
624 xyz[1+o*3] = suborder_xyz[0+s*4];
625 xyz[2+o*3] = suborder_xyz[2+s*4];
626 w[o] = suborder_w[s];
629 xyz[0+o*3] = suborder_xyz[3+s*4];
630 xyz[1+o*3] = suborder_xyz[1+s*4];
631 xyz[2+o*3] = suborder_xyz[0+s*4];
632 w[o] = suborder_w[s];
635 xyz[0+o*3] = suborder_xyz[3+s*4];
636 xyz[1+o*3] = suborder_xyz[1+s*4];
637 xyz[2+o*3] = suborder_xyz[2+s*4];
638 w[o] = suborder_w[s];
641 xyz[0+o*3] = suborder_xyz[3+s*4];
642 xyz[1+o*3] = suborder_xyz[2+s*4];
643 xyz[2+o*3] = suborder_xyz[0+s*4];
644 w[o] = suborder_w[s];
647 xyz[0+o*3] = suborder_xyz[3+s*4];
648 xyz[1+o*3] = suborder_xyz[2+s*4];
649 xyz[2+o*3] = suborder_xyz[1+s*4];
650 w[o] = suborder_w[s];
655 fprintf ( stderr,
"\n" );
656 fprintf ( stderr,
"TETRAHEDRON_NCO_RULE - Fatal error!\n" );
657 fprintf ( stderr,
" Illegal SUBORDER(%d) = %d\n", s, suborder[s] );
663 free ( suborder_xyz );
749 suborder = (
int * ) malloc ( suborder_num *
sizeof (
int ) );
755 else if ( rule == 2 )
759 else if ( rule == 3 )
764 else if ( rule == 4 )
770 else if ( rule == 5 )
778 else if ( rule == 6 )
787 else if ( rule == 7 )
801 fprintf ( stderr,
"\n" );
802 fprintf ( stderr,
"TETRAHEDRON_NCO_SUBORDER - Fatal error!\n" );
803 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
852 else if ( rule == 2 )
856 else if ( rule == 3 )
860 else if ( rule == 4 )
864 else if ( rule == 5 )
868 else if ( rule == 6 )
872 else if ( rule == 7 )
879 fprintf ( stderr,
"\n" );
880 fprintf ( stderr,
"TETRAHEDRON_NCO_SUBORDER_NUM - Fatal error!\n" );
881 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
890 double suborder_xyz[],
double suborder_w[] )
936 suborder_xyz_n = (
int * ) malloc ( 4 * suborder_num *
sizeof (
int ) );
937 suborder_w_n = (
int * ) malloc ( suborder_num *
sizeof (
int ) );
942 suborder_w_n, &suborder_w_d );
944 else if ( rule == 2 )
947 suborder_w_n, &suborder_w_d );
949 else if ( rule == 3 )
952 suborder_w_n, &suborder_w_d );
954 else if ( rule == 4 )
957 suborder_w_n, &suborder_w_d );
959 else if ( rule == 5 )
962 suborder_w_n, &suborder_w_d );
964 else if ( rule == 6 )
967 suborder_w_n, &suborder_w_d );
969 else if ( rule == 7 )
972 suborder_w_n, &suborder_w_d );
976 fprintf ( stderr,
"\n" );
977 fprintf ( stderr,
"TETRAHEDRON_NCO_SUBRULE - Fatal error!\n" );
978 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
982 for ( s = 0; s < suborder_num; s++ )
984 for (
i = 0;
i < 4;
i++ )
986 suborder_xyz[
i+s*4] =
987 (
double ) ( 1 + suborder_xyz_n[
i+s*4] )
988 / (
double ) ( 4 + suborder_xyz_d );
991 for ( s = 0; s < suborder_num; s++ )
993 suborder_w[s] = (
double ) suborder_w_n[s] / (
double ) suborder_w_d;
996 free ( suborder_w_n );
997 free ( suborder_xyz_n );
1004 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1050 int suborder_xyz_n_01[4*1] = {
1053 int suborder_xyz_d_01 = 0;
1054 int suborder_w_n_01[1] = { 1 };
1055 int suborder_w_d_01 = 1;
1057 for ( s = 0; s < suborder_num; s++ )
1059 for (
i = 0;
i < 4;
i++ )
1061 suborder_xyz_n[
i+s*4] = suborder_xyz_n_01[
i+s*4];
1064 *suborder_xyz_d = suborder_xyz_d_01;
1066 for ( s = 0; s < suborder_num; s++ )
1068 suborder_w_n[s] = suborder_w_n_01[s];
1070 *suborder_w_d = suborder_w_d_01;
1077 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1123 int suborder_xyz_n_02[4*1] = {
1126 int suborder_xyz_d_02 = 1;
1127 int suborder_w_n_02[1] = { 1 };
1128 int suborder_w_d_02 = 4;
1130 for ( s = 0; s < suborder_num; s++ )
1132 for (
i = 0;
i < 4;
i++ )
1134 suborder_xyz_n[
i+s*4] = suborder_xyz_n_02[
i+s*4];
1137 *suborder_xyz_d = suborder_xyz_d_02;
1139 for ( s = 0; s < suborder_num; s++ )
1141 suborder_w_n[s] = suborder_w_n_02[s];
1143 *suborder_w_d = suborder_w_d_02;
1150 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1196 int suborder_xyz_n_03[4*2] = {
1200 int suborder_xyz_d_03 = 2;
1201 int suborder_w_n_03[2] = { 11, -4 };
1202 int suborder_w_d_03 = 20;
1204 for ( s = 0; s < suborder_num; s++ )
1206 for (
i = 0;
i < 4;
i++ )
1208 suborder_xyz_n[
i+s*4] = suborder_xyz_n_03[
i+s*4];
1211 *suborder_xyz_d = suborder_xyz_d_03;
1213 for ( s = 0; s < suborder_num; s++ )
1215 suborder_w_n[s] = suborder_w_n_03[s];
1217 *suborder_w_d = suborder_w_d_03;
1224 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1270 int suborder_xyz_n_04[4*3] = {
1275 int suborder_xyz_d_04 = 3;
1276 int suborder_w_n_04[3] = { 20, 13, -29 };
1277 int suborder_w_d_04 = 120;
1279 for ( s = 0; s < suborder_num; s++ )
1281 for (
i = 0;
i < 4;
i++ )
1283 suborder_xyz_n[
i+s*4] = suborder_xyz_n_04[
i+s*4];
1286 *suborder_xyz_d = suborder_xyz_d_04;
1288 for ( s = 0; s < suborder_num; s++ )
1290 suborder_w_n[s] = suborder_w_n_04[s];
1292 *suborder_w_d = suborder_w_d_04;
1299 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1345 int suborder_xyz_n_05[4*5] = {
1352 int suborder_xyz_d_05 = 4;
1353 int suborder_w_n_05[5] = { 79, -68, 142, -12, 2 };
1354 int suborder_w_d_05 = 210;
1356 for ( s = 0; s < suborder_num; s++ )
1358 for (
i = 0;
i < 4;
i++ )
1360 suborder_xyz_n[
i+s*4] = suborder_xyz_n_05[
i+s*4];
1363 *suborder_xyz_d = suborder_xyz_d_05;
1365 for ( s = 0; s < suborder_num; s++ )
1367 suborder_w_n[s] = suborder_w_n_05[s];
1369 *suborder_w_d = suborder_w_d_05;
1376 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1422 int suborder_xyz_n_06[4*6] = {
1430 int suborder_xyz_d_06 = 5;
1431 int suborder_w_n_06[6] = { 277, 97, 223, -713, 505, -53 };
1432 int suborder_w_d_06 = 2240;
1434 for ( s = 0; s < suborder_num; s++ )
1436 for (
i = 0;
i < 4;
i++ )
1438 suborder_xyz_n[
i+s*4] = suborder_xyz_n_06[
i+s*4];
1441 *suborder_xyz_d = suborder_xyz_d_06;
1443 for ( s = 0; s < suborder_num; s++ )
1445 suborder_w_n[s] = suborder_w_n_06[s];
1447 *suborder_w_d = suborder_w_d_06;
1454 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1500 int suborder_xyz_n_07[4*9] = {
1511 int suborder_xyz_d_07 = 6;
1512 int suborder_w_n_07[9] = { 430, -587, 1327, 187, -1298, -398, 22, 1537, -38 };
1513 int suborder_w_d_07 = 1512;
1515 for ( s = 0; s < suborder_num; s++ )
1517 for (
i = 0;
i < 4;
i++ )
1519 suborder_xyz_n[
i+s*4] = suborder_xyz_n_07[
i+s*4];
1522 *suborder_xyz_d = suborder_xyz_d_07;
1524 for ( s = 0; s < suborder_num; s++ )
1526 suborder_w_n[s] = suborder_w_n_07[s];
1528 *suborder_w_d = suborder_w_d_07;
1566 for (
i = 0;
i < 3;
i++ )
1568 for (
j = 0;
j < 4;
j++ )
1570 a[
i+
j*4] = tetra[
i+
j*3];
1575 for (
j = 0;
j < 4;
j++ )