v0.14.0
Functions
tetrahedron_ncc_rule.h File Reference

Go to the source code of this file.

Functions

double r8mat_det_4d (double a[])
 
void reference_to_physical_t4 (double t[], int n, double ref[], double phy[])
 
int tetrahedron_ncc_degree (int rule)
 
int tetrahedron_ncc_order_num (int rule)
 
void tetrahedron_ncc_rule (int rule, int order_num, double xyz[], double w[])
 
int tetrahedron_ncc_rule_num ()
 
int * tetrahedron_ncc_suborder (int rule, int suborder_num)
 
int tetrahedron_ncc_suborder_num (int rule)
 
void tetrahedron_ncc_subrule (int rule, int suborder_num, double suborder_xyz[], double suborder_w[])
 
void tetrahedron_ncc_subrule_01 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
void tetrahedron_ncc_subrule_02 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
void tetrahedron_ncc_subrule_03 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
void tetrahedron_ncc_subrule_04 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
void tetrahedron_ncc_subrule_05 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
void tetrahedron_ncc_subrule_06 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
void tetrahedron_ncc_subrule_07 (int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
 
double tetrahedron_volume (double t[3 *4])
 
void timestamp ()
 

Function Documentation

◆ r8mat_det_4d()

double r8mat_det_4d ( double  a[])

Definition at line 5 of file tetrahedron_ncc_rule.c.

36 {
37  double det;
38 
39  det =
40  a[0+0*4] * (
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] ) )
44  - a[0+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] ) )
48  + a[0+2*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] ) )
52  - a[0+3*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] ) );
56 
57  return det;
58 }

◆ reference_to_physical_t4()

void reference_to_physical_t4 ( double  t[],
int  n,
double  ref[],
double  phy[] 
)

Definition at line 61 of file tetrahedron_ncc_rule.c.

107 {
108  int i;
109  int j;
110 
111  for ( i = 0; i < 3; i++ )
112  {
113  for ( j = 0; j < n; j++ )
114  {
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];
119  }
120  }
121 
122  return;
123 }

◆ tetrahedron_ncc_degree()

int tetrahedron_ncc_degree ( int  rule)

Definition at line 126 of file tetrahedron_ncc_rule.c.

160 {
161  int degree;
162 
163  if ( 1 <= rule && rule <= 7 )
164  {
165  degree = rule - 1;
166  }
167  else
168  {
169  degree = -1;
170  fprintf ( stderr, "\n" );
171  fprintf ( stderr, "TETRAHEDRON_NCC_DEGREE - Fatal error!\n" );
172  fprintf ( stderr, " Illegal RULE = %d\n", rule );
173  exit ( 1 );
174  }
175 
176  return degree;
177 }

◆ tetrahedron_ncc_order_num()

int tetrahedron_ncc_order_num ( int  rule)

Definition at line 180 of file tetrahedron_ncc_rule.c.

214 {
215  int order;
216  int order_num;
217  int *suborder;
218  int suborder_num;
219 
220  suborder_num = tetrahedron_ncc_suborder_num ( rule );
221 
222  suborder = tetrahedron_ncc_suborder ( rule, suborder_num );
223 
224  order_num = 0;
225  for ( order = 0; order < suborder_num; order++ )
226  {
227  order_num = order_num + suborder[order];
228  }
229 
230  free ( suborder );
231 
232  return order_num;
233 }

◆ tetrahedron_ncc_rule()

void tetrahedron_ncc_rule ( int  rule,
int  order_num,
double  xyz[],
double  w[] 
)

Definition at line 236 of file tetrahedron_ncc_rule.c.

273 {
274  int o;
275  int s;
276  int *suborder;
277  int suborder_num;
278  double *suborder_w;
279  double *suborder_xyz;
280 /*
281  Get the suborder information.
282 */
283  suborder_num = tetrahedron_ncc_suborder_num ( rule );
284 
285  suborder_xyz = ( double * ) malloc ( 4 * suborder_num * sizeof ( double ) );
286  suborder_w = ( double * ) malloc ( suborder_num * sizeof ( double ) );
287 
288  suborder = tetrahedron_ncc_suborder ( rule, suborder_num );
289 
290  tetrahedron_ncc_subrule ( rule, suborder_num, suborder_xyz, suborder_w );
291 /*
292  Expand the suborder information to a full order rule.
293 */
294  o = 0;
295 
296  for ( s = 0; s < suborder_num; s++ )
297  {
298  if ( suborder[s] == 1 )
299  {
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];
304  o = o + 1;
305  }
306 /*
307  Fourfold symmetry on (A,A,A,B)
308 
309  123 AAA
310  124 AAB
311  142 ABA
312  412 BAA
313 */
314  else if ( suborder[s] == 4 )
315  {
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];
320  o = o + 1;
321 
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];
326  o = o + 1;
327 
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];
332  o = o + 1;
333 
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];
338  o = o + 1;
339  }
340 /*
341  Sixfold symmetry on (A,A,B,B):
342 
343  123 (A,A,B)
344  132 (A,B,A),
345  134 (A,B,B)
346  312 (B,A,A)
347  314 (B,A,B)
348  341 (B,B,A)
349 */
350  else if ( suborder[s] == 6 )
351  {
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];
356  o = o + 1;
357 
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];
362  o = o + 1;
363 
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];
368  o = o + 1;
369 
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];
374  o = o + 1;
375 
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];
380  o = o + 1;
381 
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];
386  o = o + 1;
387  }
388 /*
389  Twelvefold symmetry on (A,A,B,C):
390 
391  123 (A,A,B)
392  124 (A,A,C)
393  132 (A,B,A)
394  134 (A,B,C)
395  142 (A,C,A)
396  143 (A,C,B)
397  312 (B,A,A)
398  314 (B,A,C)
399  341 (B,C,A)
400  412 (C,A,A)
401  413 (C,A,B)
402  431 (C,B,A)
403 */
404  else if ( suborder[s] == 12 )
405  {
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];
410  o = o + 1;
411 
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];
416  o = o + 1;
417 
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];
422  o = o + 1;
423 
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];
428  o = o + 1;
429 
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];
434  o = o + 1;
435 
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];
440  o = o + 1;
441 
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];
446  o = o + 1;
447 
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];
452  o = o + 1;
453 
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];
458  o = o + 1;
459 
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];
464  o = o + 1;
465 
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];
470  o = o + 1;
471 
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];
476  o = o + 1;
477  }
478 /*
479  24 fold symmetry on (A,B,C,D):
480 
481  123 (A,B,C)
482  124 (A,B,D)
483  132 (A,C,B)
484  134 (A,C,D)
485  142 (A,D,B)
486  143 (A,D,C)
487  213 (B,A,C)
488  214 (B,A,D)
489  231 (B,C,A)
490  234 (B,C,D)
491  241 (B,D,A)
492  243 (B,D,C)
493  312 (C,A,B)
494  314 (C,A,D)
495  321 (C,B,A)
496  324 (C,B,D)
497  341 (C,D,A)
498  342 (C,D,B)
499  412 (D,A,B)
500  413 (D,A,C)
501  421 (D,B,A)
502  423 (D,B,C)
503  431 (D,C,A)
504  432 (D,C,B)
505 */
506  else if ( suborder[s] == 24 )
507  {
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];
512  o = o + 1;
513 
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];
518  o = o + 1;
519 
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];
524  o = o + 1;
525 
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];
530  o = o + 1;
531 
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];
536  o = o + 1;
537 
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];
542  o = o + 1;
543 
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];
548  o = o + 1;
549 
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];
554  o = o + 1;
555 
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];
560  o = o + 1;
561 
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];
566  o = o + 1;
567 
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];
572  o = o + 1;
573 
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];
578  o = o + 1;
579 
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];
584  o = o + 1;
585 
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];
590  o = o + 1;
591 
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];
596  o = o + 1;
597 
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];
602  o = o + 1;
603 
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];
608  o = o + 1;
609 
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];
614  o = o + 1;
615 
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];
620  o = o + 1;
621 
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];
626  o = o + 1;
627 
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];
632  o = o + 1;
633 
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];
638  o = o + 1;
639 
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];
644  o = o + 1;
645 
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];
650  o = o + 1;
651  }
652  else
653  {
654  fprintf ( stderr, "\n" );
655  fprintf ( stderr, "TETRAHEDRON_NCC_RULE - Fatal error!\n" );
656  fprintf ( stderr, " Illegal SUBORDER(%d) = %d\n", s, suborder[s] );
657  exit ( 1 );
658  }
659  }
660 
661  free ( suborder );
662  free ( suborder_xyz );
663  free ( suborder_w );
664 
665  return;
666 }

◆ tetrahedron_ncc_rule_num()

int tetrahedron_ncc_rule_num ( )

Definition at line 669 of file tetrahedron_ncc_rule.c.

700 {
701  int rule_num;
702 
703  rule_num = 7;
704 
705  return rule_num;
706 }

◆ tetrahedron_ncc_suborder()

int* tetrahedron_ncc_suborder ( int  rule,
int  suborder_num 
)

Definition at line 709 of file tetrahedron_ncc_rule.c.

745 {
746  int *suborder;
747 
748  suborder = ( int * ) malloc ( suborder_num * sizeof ( int ) );
749 
750  if ( rule == 1 )
751  {
752  suborder[0] = 1;
753  }
754  else if ( rule == 2 )
755  {
756  suborder[0] = 4;
757  }
758  else if ( rule == 3 )
759  {
760  suborder[0] = 4;
761  suborder[1] = 6;
762  }
763  else if ( rule == 4 )
764  {
765  suborder[0] = 4;
766  suborder[1] = 12;
767  suborder[2] = 4;
768  }
769  else if ( rule == 5 )
770  {
771  suborder[0] = 4;
772  suborder[1] = 12;
773  suborder[2] = 6;
774  suborder[3] = 12;
775  suborder[4] = 1;
776  }
777  else if ( rule == 6 )
778  {
779  suborder[0] = 4;
780  suborder[1] = 12;
781  suborder[2] = 12;
782  suborder[3] = 12;
783  suborder[4] = 12;
784  suborder[5] = 4;
785  }
786  else if ( rule == 7 )
787  {
788  suborder[0] = 4;
789  suborder[1] = 12;
790  suborder[2] = 12;
791  suborder[3] = 12;
792  suborder[4] = 6;
793  suborder[5] = 24;
794  suborder[6] = 4;
795  suborder[7] = 4;
796  suborder[8] = 6;
797  }
798  else
799  {
800  fprintf ( stderr, "\n" );
801  fprintf ( stderr, "TETRAHEDRON_NCC_SUBORDER - Fatal error!\n" );
802  fprintf ( stderr, " Illegal RULE = %d\n", rule );
803  exit ( 1 );
804  }
805 
806  return suborder;
807 }

◆ tetrahedron_ncc_suborder_num()

int tetrahedron_ncc_suborder_num ( int  rule)

Definition at line 810 of file tetrahedron_ncc_rule.c.

844 {
845  int suborder_num;
846 
847  if ( rule == 1 )
848  {
849  suborder_num = 1;
850  }
851  else if ( rule == 2 )
852  {
853  suborder_num = 1;
854  }
855  else if ( rule == 3 )
856  {
857  suborder_num = 2;
858  }
859  else if ( rule == 4 )
860  {
861  suborder_num = 3;
862  }
863  else if ( rule == 5 )
864  {
865  suborder_num = 5;
866  }
867  else if ( rule == 6 )
868  {
869  suborder_num = 6;
870  }
871  else if ( rule == 7 )
872  {
873  suborder_num = 9;
874  }
875  else
876  {
877  suborder_num = -1;
878  fprintf ( stderr, "\n" );
879  fprintf ( stderr, "TETRAHEDRON_NCC_SUBORDER_NUM - Fatal error!\n" );
880  fprintf ( stderr, " Illegal RULE = %d\n", rule );
881  exit ( 1 );
882  }
883 
884  return suborder_num;
885 }

◆ tetrahedron_ncc_subrule()

void tetrahedron_ncc_subrule ( int  rule,
int  suborder_num,
double  suborder_xyz[],
double  suborder_w[] 
)

Definition at line 888 of file tetrahedron_ncc_rule.c.

927 {
928  int i;
929  int s;
930  int suborder_w_d;
931  int *suborder_w_n;
932  int suborder_xyz_d;
933  int *suborder_xyz_n;
934 
935  suborder_xyz_n = ( int * ) malloc ( 4 * suborder_num * sizeof ( int ) );
936  suborder_w_n = ( int * ) malloc ( suborder_num * sizeof ( int ) );
937 
938  if ( rule == 1 )
939  {
940  tetrahedron_ncc_subrule_01 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
941  suborder_w_n, &suborder_w_d );
942  }
943  else if ( rule == 2 )
944  {
945  tetrahedron_ncc_subrule_02 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
946  suborder_w_n, &suborder_w_d );
947  }
948  else if ( rule == 3 )
949  {
950  tetrahedron_ncc_subrule_03 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
951  suborder_w_n, &suborder_w_d );
952  }
953  else if ( rule == 4 )
954  {
955  tetrahedron_ncc_subrule_04 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
956  suborder_w_n, &suborder_w_d );
957  }
958  else if ( rule == 5 )
959  {
960  tetrahedron_ncc_subrule_05 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
961  suborder_w_n, &suborder_w_d );
962  }
963  else if ( rule == 6 )
964  {
965  tetrahedron_ncc_subrule_06 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
966  suborder_w_n, &suborder_w_d );
967  }
968  else if ( rule == 7 )
969  {
970  tetrahedron_ncc_subrule_07 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
971  suborder_w_n, &suborder_w_d );
972  }
973  else
974  {
975  fprintf ( stderr, "\n" );
976  fprintf ( stderr, "TETRAHEDRON_NCC_SUBRULE - Fatal error!\n" );
977  fprintf ( stderr, " Illegal RULE = %d\n", rule );
978  exit ( 1 );
979  }
980 
981  for ( s = 0; s < suborder_num; s++ )
982  {
983  for ( i = 0; i < 4; i++ )
984  {
985  suborder_xyz[i+s*4] =
986  ( double ) ( suborder_xyz_n[i+s*4] )
987  / ( double ) ( suborder_xyz_d );
988  }
989  }
990  for ( s = 0; s < suborder_num; s++ )
991  {
992  suborder_w[s] = ( double ) suborder_w_n[s] / ( double ) suborder_w_d;
993  }
994 
995  free ( suborder_w_n );
996  free ( suborder_xyz_n );
997 
998  return;
999 }

◆ tetrahedron_ncc_subrule_01()

void tetrahedron_ncc_subrule_01 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1002 of file tetrahedron_ncc_rule.c.

1046 {
1047  int i;
1048  int s;
1049  int suborder_xyz_n_01[4*1] = {
1050  1, 1, 1, 1
1051  };
1052  int suborder_xyz_d_01 = 4;
1053  int suborder_w_n_01[1] = { 1 };
1054  int suborder_w_d_01 = 1;
1055 
1056  for ( s = 0; s < suborder_num; s++ )
1057  {
1058  for ( i = 0; i < 4; i++ )
1059  {
1060  suborder_xyz_n[i+s*4] = suborder_xyz_n_01[i+s*4];
1061  }
1062  }
1063  *suborder_xyz_d = suborder_xyz_d_01;
1064 
1065  for ( s = 0; s < suborder_num; s++ )
1066  {
1067  suborder_w_n[s] = suborder_w_n_01[s];
1068  }
1069  *suborder_w_d = suborder_w_d_01;
1070 
1071  return;
1072 }

◆ tetrahedron_ncc_subrule_02()

void tetrahedron_ncc_subrule_02 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1075 of file tetrahedron_ncc_rule.c.

1119 {
1120  int i;
1121  int s;
1122  int suborder_xyz_n_02[4*1] = {
1123  0, 0, 0, 1
1124  };
1125  int suborder_xyz_d_02 = 1;
1126  int suborder_w_n_02[1] = { 1 };
1127  int suborder_w_d_02 = 4;
1128 
1129  for ( s = 0; s < suborder_num; s++ )
1130  {
1131  for ( i = 0; i < 4; i++ )
1132  {
1133  suborder_xyz_n[i+s*4] = suborder_xyz_n_02[i+s*4];
1134  }
1135  }
1136  *suborder_xyz_d = suborder_xyz_d_02;
1137 
1138  for ( s = 0; s < suborder_num; s++ )
1139  {
1140  suborder_w_n[s] = suborder_w_n_02[s];
1141  }
1142  *suborder_w_d = suborder_w_d_02;
1143 
1144  return;
1145 }

◆ tetrahedron_ncc_subrule_03()

void tetrahedron_ncc_subrule_03 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1148 of file tetrahedron_ncc_rule.c.

1192 {
1193  int i;
1194  int s;
1195  int suborder_xyz_n_03[4*2] = {
1196  0, 0, 0, 2,
1197  1, 1, 0, 0
1198  };
1199  int suborder_xyz_d_03 = 2;
1200  int suborder_w_n_03[2] = { -1, 4 };
1201  int suborder_w_d_03 = 20;
1202 
1203  for ( s = 0; s < suborder_num; s++ )
1204  {
1205  for ( i = 0; i < 4; i++ )
1206  {
1207  suborder_xyz_n[i+s*4] = suborder_xyz_n_03[i+s*4];
1208  }
1209  }
1210  *suborder_xyz_d = suborder_xyz_d_03;
1211 
1212  for ( s = 0; s < suborder_num; s++ )
1213  {
1214  suborder_w_n[s] = suborder_w_n_03[s];
1215  }
1216  *suborder_w_d = suborder_w_d_03;
1217 
1218  return;
1219 }

◆ tetrahedron_ncc_subrule_04()

void tetrahedron_ncc_subrule_04 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1222 of file tetrahedron_ncc_rule.c.

1266 {
1267  int i;
1268  int s;
1269  int suborder_xyz_n_04[4*3] = {
1270  0, 0, 0, 3,
1271  0, 0, 1, 2,
1272  1, 1, 1, 0
1273  };
1274  int suborder_xyz_d_04 = 3;
1275  int suborder_w_n_04[3] = { 1, 0, 9 };
1276  int suborder_w_d_04 = 40;
1277 
1278  for ( s = 0; s < suborder_num; s++ )
1279  {
1280  for ( i = 0; i < 4; i++ )
1281  {
1282  suborder_xyz_n[i+s*4] = suborder_xyz_n_04[i+s*4];
1283  }
1284  }
1285  *suborder_xyz_d = suborder_xyz_d_04;
1286 
1287  for ( s = 0; s < suborder_num; s++ )
1288  {
1289  suborder_w_n[s] = suborder_w_n_04[s];
1290  }
1291  *suborder_w_d = suborder_w_d_04;
1292 
1293  return;
1294 }

◆ tetrahedron_ncc_subrule_05()

void tetrahedron_ncc_subrule_05 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1297 of file tetrahedron_ncc_rule.c.

1341 {
1342  int i;
1343  int s;
1344  int suborder_xyz_n_05[4*5] = {
1345  0, 0, 0, 4,
1346  0, 0, 3, 1,
1347  2, 2, 0, 0,
1348  1, 1, 0, 2,
1349  1, 1, 1, 1
1350  };
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;
1354 
1355  for ( s = 0; s < suborder_num; s++ )
1356  {
1357  for ( i = 0; i < 4; i++ )
1358  {
1359  suborder_xyz_n[i+s*4] = suborder_xyz_n_05[i+s*4];
1360  }
1361  }
1362  *suborder_xyz_d = suborder_xyz_d_05;
1363 
1364  for ( s = 0; s < suborder_num; s++ )
1365  {
1366  suborder_w_n[s] = suborder_w_n_05[s];
1367  }
1368  *suborder_w_d = suborder_w_d_05;
1369 
1370  return;
1371 }

◆ tetrahedron_ncc_subrule_06()

void tetrahedron_ncc_subrule_06 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1374 of file tetrahedron_ncc_rule.c.

1418 {
1419  int i;
1420  int s;
1421  int suborder_xyz_n_06[4*6] = {
1422  0, 0, 0, 5,
1423  0, 0, 4, 1,
1424  0, 0, 3, 2,
1425  1, 1, 0, 3,
1426  2, 2, 1, 0,
1427  1, 1, 1, 2
1428  };
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;
1432 
1433  for ( s = 0; s < suborder_num; s++ )
1434  {
1435  for ( i = 0; i < 4; i++ )
1436  {
1437  suborder_xyz_n[i+s*4] = suborder_xyz_n_06[i+s*4];
1438  }
1439  }
1440  *suborder_xyz_d = suborder_xyz_d_06;
1441 
1442  for ( s = 0; s < suborder_num; s++ )
1443  {
1444  suborder_w_n[s] = suborder_w_n_06[s];
1445  }
1446  *suborder_w_d = suborder_w_d_06;
1447 
1448  return;
1449 }

◆ tetrahedron_ncc_subrule_07()

void tetrahedron_ncc_subrule_07 ( int  suborder_num,
int  suborder_xyz_n[],
int *  suborder_xyz_d,
int  suborder_w_n[],
int *  suborder_w_d 
)

Definition at line 1452 of file tetrahedron_ncc_rule.c.

1496 {
1497  int i;
1498  int s;
1499  int suborder_xyz_n_07[4*9] = {
1500  0, 0, 0, 6,
1501  0, 0, 5, 1,
1502  0, 0, 4, 2,
1503  1, 1, 0, 4,
1504  3, 3, 0, 0,
1505  3, 2, 1, 0,
1506  1, 1, 1, 3,
1507  2, 2, 2, 0,
1508  2, 2, 1, 1
1509  };
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;
1513 
1514  for ( s = 0; s < suborder_num; s++ )
1515  {
1516  for ( i = 0; i < 4; i++ )
1517  {
1518  suborder_xyz_n[i+s*4] = suborder_xyz_n_07[i+s*4];
1519  }
1520  }
1521  *suborder_xyz_d = suborder_xyz_d_07;
1522 
1523  for ( s = 0; s < suborder_num; s++ )
1524  {
1525  suborder_w_n[s] = suborder_w_n_07[s];
1526  }
1527  *suborder_w_d = suborder_w_d_07;
1528 
1529  return;
1530 }

◆ tetrahedron_volume()

double tetrahedron_volume ( double  t[3 *4])

Definition at line 1533 of file tetrahedron_ncc_rule.c.

1559 {
1560  double a[4*4];
1561  int i;
1562  int j;
1563  double volume;
1564 
1565  for ( i = 0; i < 3; i++ )
1566  {
1567  for ( j = 0; j < 4; j++ )
1568  {
1569  a[i+j*4] = tetra[i+j*3];
1570  }
1571  }
1572 
1573  i = 3;
1574  for ( j = 0; j < 4; j++ )
1575  {
1576  a[i+j*4] = 1.0;
1577  }
1578 
1579  volume = fabs ( r8mat_det_4d ( a ) ) / 6.0;
1580 
1581  return volume;
1582 }

◆ timestamp()

void timestamp ( )

Definition at line 1268 of file gm_rule.c.

1296 {
1297 # define TIME_SIZE 40
1298 
1299  static char time_buffer[TIME_SIZE];
1300  const struct tm *tm;
1301  size_t len;
1302  time_t now;
1303 
1304  (void)(len);
1305 
1306  now = time ( NULL );
1307  tm = localtime ( &now );
1308 
1309  len = strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm );
1310 
1311  fprintf ( stdout, "%s\n", time_buffer );
1312 
1313  return;
1314 # undef TIME_SIZE
1315 }
tetrahedron_ncc_suborder
int * tetrahedron_ncc_suborder(int rule, int suborder_num)
Definition: tetrahedron_ncc_rule.c:709
tetrahedron_ncc_subrule_01
void tetrahedron_ncc_subrule_01(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1002
tetrahedron_ncc_subrule_07
void tetrahedron_ncc_subrule_07(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1452
order
constexpr int order
Definition: dg_projection.cpp:18
tetrahedron_ncc_subrule_03
void tetrahedron_ncc_subrule_03(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1148
r8mat_det_4d
double r8mat_det_4d(double a[])
Definition: tetrahedron_ncc_rule.c:5
tetrahedron_ncc_subrule_04
void tetrahedron_ncc_subrule_04(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1222
tetrahedron_ncc_suborder_num
int tetrahedron_ncc_suborder_num(int rule)
Definition: tetrahedron_ncc_rule.c:810
tetrahedron_ncc_subrule
void tetrahedron_ncc_subrule(int rule, int suborder_num, double suborder_xyz[], double suborder_w[])
Definition: tetrahedron_ncc_rule.c:888
a
constexpr double a
Definition: approx_sphere.cpp:30
double
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
convert.n
n
Definition: convert.py:82
tetrahedron_ncc_subrule_05
void tetrahedron_ncc_subrule_05(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1297
TIME_SIZE
#define TIME_SIZE
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
tetrahedron_ncc_subrule_02
void tetrahedron_ncc_subrule_02(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1075
tetrahedron_ncc_subrule_06
void tetrahedron_ncc_subrule_06(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
Definition: tetrahedron_ncc_rule.c:1374
sdf_wavy_2d.w
int w
Definition: sdf_wavy_2d.py:6