v0.9.0
triangle_ncc_rule.c
Go to the documentation of this file.
1 /* Output from c_comment */
2 
3 # include <stdlib.h>
4 # include <stdio.h>
5 # include <math.h>
6 # include <time.h>
7 
8 # include "triangle_ncc_rule.h"
9 
10 /******************************************************************************/
11 
12 //int i4_max ( int i1, int i2 ) //NOTE: it is defined in gm_rule.c
13 
14 /******************************************************************************/
15 /*
16  Purpose:
17 
18  I4_MAX returns the maximum of two I4's.
19 
20  Licensing:
21 
22  This code is distributed under the GNU LGPL license.
23 
24  Modified:
25 
26  29 August 2006
27 
28  Author:
29 
30  John Burkardt
31 
32  Parameters:
33 
34  Input, int I1, I2, are two integers to be compared.
35 
36  Output, int I4_MAX, the larger of I1 and I2.
37 */
38 /*{
39  int value;
40 
41  if ( i2 < i1 )
42  {
43  value = i1;
44  }
45  else
46  {
47  value = i2;
48  }
49  return value;
50 }*/
51 /******************************************************************************/
52 
53 //int i4_min ( int i1, int i2 ) //NOTE: it is defined in gm_rule.c
54 
55 /******************************************************************************/
56 /*
57  Purpose:
58 
59  I4_MIN returns the smaller of two I4's.
60 
61  Licensing:
62 
63  This code is distributed under the GNU LGPL license.
64 
65  Modified:
66 
67  29 August 2006
68 
69  Author:
70 
71  John Burkardt
72 
73  Parameters:
74 
75  Input, int I1, I2, two integers to be compared.
76 
77  Output, int I4_MIN, the smaller of I1 and I2.
78 */
79 /*{
80  int value;
81 
82  if ( i1 < i2 )
83  {
84  value = i1;
85  }
86  else
87  {
88  value = i2;
89  }
90  return value;
91 }*/
92 /******************************************************************************/
93 
94 int i4_modp ( int i, int j )
95 
96 /******************************************************************************/
97 /*
98  Purpose:
99 
100  I4_MODP returns the nonnegative remainder of I4 division.
101 
102  Discussion:
103 
104  If
105  NREM = I4_MODP ( I, J )
106  NMULT = ( I - NREM ) / J
107  then
108  I = J * NMULT + NREM
109  where NREM is always nonnegative.
110 
111  The MOD function computes a result with the same sign as the
112  quantity being divided. Thus, suppose you had an angle A,
113  and you wanted to ensure that it was between 0 and 360.
114  Then mod(A,360) would do, if A was positive, but if A
115  was negative, your result would be between -360 and 0.
116 
117  On the other hand, I4_MODP(A,360) is between 0 and 360, always.
118 
119  Example:
120 
121  I J MOD I4_MODP I4_MODP Factorization
122 
123  107 50 7 7 107 = 2 * 50 + 7
124  107 -50 7 7 107 = -2 * -50 + 7
125  -107 50 -7 43 -107 = -3 * 50 + 43
126  -107 -50 -7 43 -107 = 3 * -50 + 43
127 
128  Licensing:
129 
130  This code is distributed under the GNU LGPL license.
131 
132  Modified:
133 
134  12 January 2007
135 
136  Author:
137 
138  John Burkardt
139 
140  Parameters:
141 
142  Input, int I, the number to be divided.
143 
144  Input, int J, the number that divides I.
145 
146  Output, int I4_MODP, the nonnegative remainder when I is
147  divided by J.
148 */
149 {
150  int value;
151 
152  if ( j == 0 )
153  {
154  fprintf ( stderr, "\n" );
155  fprintf ( stderr, "I4_MODP - Fatal error!\n" );
156  fprintf ( stderr, " I4_MODP ( I, J ) called with J = %d\n", j );
157  exit ( 1 );
158  }
159 
160  value = i % j;
161 
162  if ( value < 0 )
163  {
164  value = value + abs ( j );
165  }
166 
167  return value;
168 }
169 /******************************************************************************/
170 
171 int i4_wrap ( int ival, int ilo, int ihi )
172 
173 /******************************************************************************/
174 /*
175  Purpose:
176 
177  I4_WRAP forces an I4 to lie between given limits by wrapping.
178 
179  Example:
180 
181  ILO = 4, IHI = 8
182 
183  I Value
184 
185  -2 8
186  -1 4
187  0 5
188  1 6
189  2 7
190  3 8
191  4 4
192  5 5
193  6 6
194  7 7
195  8 8
196  9 4
197  10 5
198  11 6
199  12 7
200  13 8
201  14 4
202 
203  Licensing:
204 
205  This code is distributed under the GNU LGPL license.
206 
207  Modified:
208 
209  26 December 2012
210 
211  Author:
212 
213  John Burkardt
214 
215  Parameters:
216 
217  Input, int IVAL, an integer value.
218 
219  Input, int ILO, IHI, the desired bounds for the integer value.
220 
221  Output, int I4_WRAP, a "wrapped" version of IVAL.
222 */
223 {
224  int jhi;
225  int jlo;
226  int value;
227  int wide;
228 
229  if ( ilo < ihi )
230  {
231  jlo = ilo;
232  jhi = ihi;
233  }
234  else
235  {
236  jlo = ihi;
237  jhi = ilo;
238  }
239 
240  wide = jhi + 1 - jlo;
241 
242  if ( wide == 1 )
243  {
244  value = jlo;
245  }
246  else
247  {
248  value = jlo + i4_modp ( ival - jlo, wide );
249  }
250 
251  return value;
252 }
253 /******************************************************************************/
254 
255 double r8_huge ( )
256 
257 /******************************************************************************/
258 /*
259  Purpose:
260 
261  R8_HUGE returns a "huge" R8.
262 
263  Discussion:
264 
265  The value returned by this function is NOT required to be the
266  maximum representable R8. This value varies from machine to machine,
267  from compiler to compiler, and may cause problems when being printed.
268  We simply want a "very large" but non-infinite number.
269 
270  Licensing:
271 
272  This code is distributed under the GNU LGPL license.
273 
274  Modified:
275 
276  06 October 2007
277 
278  Author:
279 
280  John Burkardt
281 
282  Parameters:
283 
284  Output, double R8_HUGE, a "huge" R8 value.
285 */
286 {
287  double value;
288 
289  value = 1.0E+30;
290 
291  return value;
292 }
293 /******************************************************************************/
294 
295 int r8_nint ( double x )
296 
297 /******************************************************************************/
298 /*
299  Purpose:
300 
301  R8_NINT returns the nearest integer to an R8.
302 
303  Example:
304 
305  X R8_NINT
306 
307  1.3 1
308  1.4 1
309  1.5 1 or 2
310  1.6 2
311  0.0 0
312  -0.7 -1
313  -1.1 -1
314  -1.6 -2
315 
316  Licensing:
317 
318  This code is distributed under the GNU LGPL license.
319 
320  Modified:
321 
322  05 May 2006
323 
324  Author:
325 
326  John Burkardt
327 
328  Parameters:
329 
330  Input, double X, the value.
331 
332  Output, int R8_NINT, the nearest integer to X.
333 */
334 {
335  int s;
336  int value;
337 
338  if ( x < 0.0 )
339  {
340  s = - 1;
341  }
342  else
343  {
344  s = + 1;
345  }
346  value = s * ( int ) ( fabs ( x ) + 0.5 );
347 
348  return value;
349 }
350 /******************************************************************************/
351 
352 void reference_to_physical_t3 ( double t[], int n, double ref[], double phy[] )
353 
354 /******************************************************************************/
355 /*
356  Purpose:
357 
358  REFERENCE_TO_PHYSICAL_T3 maps T3 reference points to physical points.
359 
360  Discussion:
361 
362  Given the vertices of an order 3 physical triangle and a point
363  (XSI,ETA) in the reference triangle, the routine computes the value
364  of the corresponding image point (X,Y) in physical space.
365 
366  Note that this routine may also be appropriate for an order 6
367  triangle, if the mapping between reference and physical space
368  is linear. This implies, in particular, that the sides of the
369  image triangle are straight and that the "midside" nodes in the
370  physical triangle are literally halfway along the sides of
371  the physical triangle.
372 
373  Reference Element T3:
374 
375  |
376  1 3
377  | |\
378  | | \
379  S | \
380  | | \
381  | | \
382  0 1-----2
383  |
384  +--0--R--1-->
385 
386  Licensing:
387 
388  This code is distributed under the GNU LGPL license.
389 
390  Modified:
391 
392  24 June 2005
393 
394  Author:
395 
396  John Burkardt
397 
398  Parameters:
399 
400  Input, double T[2*3], the coordinates of the vertices.
401  The vertices are assumed to be the images of (0,0), (1,0) and
402  (0,1) respectively.
403 
404  Input, int N, the number of objects to transform.
405 
406  Input, double REF[2*N], points in the reference triangle.
407 
408  Output, double PHY[2*N], corresponding points in the
409  physical triangle.
410 */
411 {
412  int i;
413  int j;
414 
415  for ( i = 0; i < 2; i++ )
416  {
417  for ( j = 0; j < n; j++ )
418  {
419  phy[i+j*2] = t[i+0*2] * ( 1.0 - ref[0+j*2] - ref[1+j*2] )
420  + t[i+1*2] * + ref[0+j*2]
421  + t[i+2*2] * + ref[1+j*2];
422  }
423  }
424 
425  return;
426 }
427 /******************************************************************************/
428 
429 //void timestamp ( ) //NOTE: it is defined in gm_rule.c
430 
431 /******************************************************************************/
432 /*
433  Purpose:
434 
435  TIMESTAMP prints the current YMDHMS date as a time stamp.
436 
437  Example:
438 
439  31 May 2001 09:45:54 AM
440 
441  Licensing:
442 
443  This code is distributed under the GNU LGPL license.
444 
445  Modified:
446 
447  24 September 2003
448 
449  Author:
450 
451  John Burkardt
452 
453  Parameters:
454 
455  None
456 */
457 /*{
458 # define TIME_SIZE 40
459 
460  static char time_buffer[TIME_SIZE];
461  const struct tm *tm;
462  size_t len;
463  time_t now;
464 
465  now = time ( NULL );
466  tm = localtime ( &now );
467 
468  len = strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm );
469 
470  fprintf ( stdout, "%s\n", time_buffer );
471 
472  return;
473 # undef TIME_SIZE
474 }*/
475 /******************************************************************************/
476 
477 double triangle_area ( double t[2*3] )
478 
479 /******************************************************************************/
480 /*
481  Purpose:
482 
483  TRIANGLE_AREA computes the area of a triangle.
484 
485  Discussion:
486 
487  If the triangle's vertices are given in counter clockwise order,
488  the area will be positive. If the triangle's vertices are given
489  in clockwise order, the area will be negative!
490 
491  An earlier version of this routine always returned the absolute
492  value of the computed area. I am convinced now that that is
493  a less useful result! For instance, by returning the signed
494  area of a triangle, it is possible to easily compute the area
495  of a nonconvex polygon as the sum of the (possibly negative)
496  areas of triangles formed by node 1 and successive pairs of vertices.
497 
498  Licensing:
499 
500  This code is distributed under the GNU LGPL license.
501 
502  Modified:
503 
504  17 October 2005
505 
506  Author:
507 
508  John Burkardt
509 
510  Parameters:
511 
512  Input, double T[2*3], the vertices of the triangle.
513 
514  Output, double TRIANGLE_AREA, the area of the triangle.
515 */
516 {
517  double area;
518 
519  area = 0.5 * (
520  t[0+0*2] * ( t[1+1*2] - t[1+2*2] ) +
521  t[0+1*2] * ( t[1+2*2] - t[1+0*2] ) +
522  t[0+2*2] * ( t[1+0*2] - t[1+1*2] ) );
523 
524  return area;
525 }
526 /******************************************************************************/
527 
528 int triangle_ncc_degree ( int rule )
529 
530 /******************************************************************************/
531 /*
532  Purpose:
533 
534  TRIANGLE_NCC_DEGREE returns the degree of an NCC rule for the triangle.
535 
536  Licensing:
537 
538  This code is distributed under the GNU LGPL license.
539 
540  Modified:
541 
542  30 January 2007
543 
544  Author:
545 
546  John Burkardt
547 
548  Reference:
549 
550  Peter Silvester,
551  Symmetric Quadrature Formulae for Simplexes,
552  Mathematics of Computation,
553  Volume 24, Number 109, January 1970, pages 95-100.
554 
555  Parameters:
556 
557  Input, int RULE, the index of the rule.
558 
559  Output, int TRIANGLE_NCC_DEGREE, the polynomial degree of exactness of
560  the rule.
561 */
562 {
563  int degree;
564 
565  if ( 1 <= rule && rule <= 9 )
566  {
567  degree = rule - 1;
568  }
569  else
570  {
571  degree = -1;
572  fprintf ( stderr, "\n" );
573  fprintf ( stderr, "TRIANGLE_NCC_DEGREE - Fatal error!\n" );
574  fprintf ( stderr, " Illegal RULE = %d\n", rule );
575  exit ( 1 );
576  }
577 
578  return degree;
579 }
580 /******************************************************************************/
581 
582 int triangle_ncc_order_num ( int rule )
583 
584 /******************************************************************************/
585 /*
586  Purpose:
587 
588  TRIANGLE_NCC_ORDER_NUM returns the order of an NCC rule for the triangle.
589 
590  Licensing:
591 
592  This code is distributed under the GNU LGPL license.
593 
594  Modified:
595 
596  30 January 2007
597 
598  Author:
599 
600  John Burkardt
601 
602  Reference:
603 
604  Peter Silvester,
605  Symmetric Quadrature Formulae for Simplexes,
606  Mathematics of Computation,
607  Volume 24, Number 109, January 1970, pages 95-100.
608 
609  Parameters:
610 
611  Input, int RULE, the index of the rule.
612 
613  Output, int TRIANGLE_NCC_ORDER_NUM, the order (number of points)
614  of the rule.
615 */
616 {
617  int order;
618  int order_num;
619  int *suborder;
620  int suborder_num;
621 
622  suborder_num = triangle_ncc_suborder_num ( rule );
623 
624  suborder = triangle_ncc_suborder ( rule, suborder_num );
625 
626  order_num = 0;
627  for ( order = 0; order < suborder_num; order++ )
628  {
629  order_num = order_num + suborder[order];
630  }
631 
632  free ( suborder );
633 
634  return order_num;
635 }
636 /******************************************************************************/
637 
638 void triangle_ncc_rule ( int rule, int order_num, double xy[], double w[] )
639 
640 /******************************************************************************/
641 /*
642  Purpose:
643 
644  TRIANGLE_NCC_RULE returns the points and weights of an NCC rule.
645 
646  Licensing:
647 
648  This code is distributed under the GNU LGPL license.
649 
650  Modified:
651 
652  30 January 2007
653 
654  Author:
655 
656  John Burkardt
657 
658  Reference:
659 
660  Peter Silvester,
661  Symmetric Quadrature Formulae for Simplexes,
662  Mathematics of Computation,
663  Volume 24, Number 109, January 1970, pages 95-100.
664 
665  Parameters:
666 
667  Input, int RULE, the index of the rule.
668 
669  Input, int ORDER_NUM, the order (number of points) of the rule.
670 
671  Output, double XY[2*ORDER_NUM], the points of the rule.
672 
673  Output, double W[ORDER_NUM], the weights of the rule.
674 */
675 {
676  int k;
677  int o;
678  int s;
679  int *suborder;
680  int suborder_num;
681  double *suborder_w;
682  double *suborder_xyz;
683 /*
684  Get the suborder information.
685 */
686  suborder_num = triangle_ncc_suborder_num ( rule );
687 
688  suborder_xyz = ( double * ) malloc ( 3 * suborder_num * sizeof ( double ) );
689  suborder_w = ( double * ) malloc ( suborder_num * sizeof ( double ) );
690 
691  suborder = triangle_ncc_suborder ( rule, suborder_num );
692 
693  triangle_ncc_subrule ( rule, suborder_num, suborder_xyz, suborder_w );
694 /*
695  Expand the suborder information to a full order rule.
696 */
697  o = 0;
698 
699  for ( s = 0; s < suborder_num; s++ )
700  {
701  if ( suborder[s] == 1 )
702  {
703  xy[0+o*2] = suborder_xyz[0+s*3];
704  xy[1+o*2] = suborder_xyz[1+s*3];
705  w[o] = suborder_w[s];
706  o = o + 1;
707  }
708  else if ( suborder[s] == 3 )
709  {
710  for ( k = 0; k < 3; k++ )
711  {
712  xy[0+o*2] = suborder_xyz [ i4_wrap(k, 0,2) + s*3 ];
713  xy[1+o*2] = suborder_xyz [ i4_wrap(k+1,0,2) + s*3 ];
714  w[o] = suborder_w[s];
715  o = o + 1;
716  }
717  }
718  else if ( suborder[s] == 6 )
719  {
720  for ( k = 0; k < 3; k++ )
721  {
722  xy[0+o*2] = suborder_xyz [ i4_wrap(k, 0,2) + s*3 ];
723  xy[1+o*2] = suborder_xyz [ i4_wrap(k+1,0,2) + s*3 ];
724  w[o] = suborder_w[s];
725  o = o + 1;
726  }
727 
728  for ( k = 0; k < 3; k++ )
729  {
730  xy[0+o*2] = suborder_xyz [ i4_wrap(k+1,0,2) + s*3 ];
731  xy[1+o*2] = suborder_xyz [ i4_wrap(k, 0,2) + s*3 ];
732  w[o] = suborder_w[s];
733  o = o + 1;
734  }
735  }
736  else
737  {
738  fprintf ( stderr, "\n" );
739  fprintf ( stderr, "TRIANGLE_NCC_RULE - Fatal error!\n" );
740  fprintf ( stderr, " Illegal SUBORDER(%d) = %d\n", s, suborder[s] );
741  exit ( 1 );
742  }
743  }
744 
745  free ( suborder );
746  free ( suborder_xyz );
747  free ( suborder_w );
748 
749  return;
750 }
751 /******************************************************************************/
752 
754 
755 /******************************************************************************/
756 /*
757  Purpose:
758 
759  TRIANGLE_NCC_RULE_NUM returns the number of NCC rules available.
760 
761  Licensing:
762 
763  This code is distributed under the GNU LGPL license.
764 
765  Modified:
766 
767  30 January 2007
768 
769  Author:
770 
771  John Burkardt
772 
773  Reference:
774 
775  Peter Silvester,
776  Symmetric Quadrature Formulae for Simplexes,
777  Mathematics of Computation,
778  Volume 24, Number 109, January 1970, pages 95-100.
779 
780  Parameters:
781 
782  Output, int TRIANGLE_NCC_RULE_NUM, the number of rules available.
783 */
784 {
785  int rule_num;
786 
787  rule_num = 9;
788 
789  return rule_num;
790 }
791 /******************************************************************************/
792 
793 int *triangle_ncc_suborder ( int rule, int suborder_num )
794 
795 /******************************************************************************/
796 /*
797  Purpose:
798 
799  TRIANGLE_NCC_SUBORDER returns the suborders for an NCC rule.
800 
801  Licensing:
802 
803  This code is distributed under the GNU LGPL license.
804 
805  Modified:
806 
807  30 January 2007
808 
809  Author:
810 
811  John Burkardt
812 
813  Reference:
814 
815  Peter Silvester,
816  Symmetric Quadrature Formulae for Simplexes,
817  Mathematics of Computation,
818  Volume 24, Number 109, January 1970, pages 95-100.
819 
820  Parameters:
821 
822  Input, int RULE, the index of the rule.
823 
824  Input, int SUBORDER_NUM, the number of suborders of the rule.
825 
826  Output, int TRIANGLE_NCC_SUBORDER[SUBORDER_NUM],
827  the suborders of the rule.
828 */
829 {
830  int *suborder;
831 
832  suborder = ( int * ) malloc ( suborder_num * sizeof ( int ) );
833 
834  if ( rule == 1 )
835  {
836  suborder[0] = 1;
837  }
838  else if ( rule == 2 )
839  {
840  suborder[0] = 3;
841  }
842  else if ( rule == 3 )
843  {
844  suborder[0] = 3;
845  }
846  else if ( rule == 4 )
847  {
848  suborder[0] = 3;
849  suborder[1] = 6;
850  suborder[2] = 1;
851  }
852  else if ( rule == 5 )
853  {
854  suborder[0] = 6;
855  suborder[1] = 3;
856  suborder[2] = 3;
857  }
858  else if ( rule == 6 )
859  {
860  suborder[0] = 3;
861  suborder[1] = 6;
862  suborder[2] = 6;
863  suborder[3] = 3;
864  suborder[4] = 3;
865  }
866  else if ( rule == 7 )
867  {
868  suborder[0] = 6;
869  suborder[1] = 6;
870  suborder[2] = 3;
871  suborder[3] = 3;
872  suborder[4] = 6;
873  suborder[5] = 1;
874  }
875  else if ( rule == 8 )
876  {
877  suborder[0] = 3;
878  suborder[1] = 6;
879  suborder[2] = 6;
880  suborder[3] = 3;
881  suborder[4] = 6;
882  suborder[5] = 6;
883  suborder[6] = 3;
884  suborder[7] = 3;
885  }
886  else if ( rule == 9 )
887  {
888  suborder[0] = 6;
889  suborder[1] = 6;
890  suborder[2] = 3;
891  suborder[3] = 6;
892  suborder[4] = 6;
893  suborder[5] = 3;
894  suborder[6] = 6;
895  suborder[7] = 3;
896  suborder[8] = 3;
897  }
898  else
899  {
900  fprintf ( stderr, "\n" );
901  fprintf ( stderr, "TRIANGLE_NCC_SUBORDER - Fatal error!\n" );
902  fprintf ( stderr, " Illegal RULE = %d\n", rule );
903  exit ( 1 );
904  }
905 
906  return suborder;
907 }
908 /******************************************************************************/
909 
911 
912 /******************************************************************************/
913 /*
914  Purpose:
915 
916  TRIANGLE_NCC_SUBORDER_NUM returns the number of suborders for an NCC rule.
917 
918  Licensing:
919 
920  This code is distributed under the GNU LGPL license.
921 
922  Modified:
923 
924  30 January 2007
925 
926  Author:
927 
928  John Burkardt
929 
930  Reference:
931 
932  Peter Silvester,
933  Symmetric Quadrature Formulae for Simplexes,
934  Mathematics of Computation,
935  Volume 24, Number 109, January 1970, pages 95-100.
936 
937  Parameters:
938 
939  Input, int RULE, the index of the rule.
940 
941  Output, int TRIANGLE_NCC_SUBORDER_NUM, the number of suborders
942  of the rule.
943 */
944 {
945  int suborder_num;
946 
947  if ( rule == 1 )
948  {
949  suborder_num = 1;
950  }
951  else if ( rule == 2 )
952  {
953  suborder_num = 1;
954  }
955  else if ( rule == 3 )
956  {
957  suborder_num = 1;
958  }
959  else if ( rule == 4 )
960  {
961  suborder_num = 3;
962  }
963  else if ( rule == 5 )
964  {
965  suborder_num = 3;
966  }
967  else if ( rule == 6 )
968  {
969  suborder_num = 5;
970  }
971  else if ( rule == 7 )
972  {
973  suborder_num = 6;
974  }
975  else if ( rule == 8 )
976  {
977  suborder_num = 8;
978  }
979  else if ( rule == 9 )
980  {
981  suborder_num = 9;
982  }
983  else
984  {
985  suborder_num = -1;
986  fprintf ( stderr, "\n" );
987  fprintf ( stderr, "TRIANGLE_NCC_SUBORDER_NUM - Fatal error!\n" );
988  fprintf ( stderr, " Illegal RULE = %d\n", rule );
989  exit ( 1 );
990  }
991 
992  return suborder_num;
993 }
994 /******************************************************************************/
995 
996 void triangle_ncc_subrule ( int rule, int suborder_num, double suborder_xyz[],
997  double suborder_w[] )
998 
999 /******************************************************************************/
1000 /*
1001  Purpose:
1002 
1003  TRIANGLE_NCC_SUBRULE returns a compressed NCC rule.
1004 
1005  Licensing:
1006 
1007  This code is distributed under the GNU LGPL license.
1008 
1009  Modified:
1010 
1011  30 January 2007
1012 
1013  Author:
1014 
1015  John Burkardt
1016 
1017  Reference:
1018 
1019  Peter Silvester,
1020  Symmetric Quadrature Formulae for Simplexes,
1021  Mathematics of Computation,
1022  Volume 24, Number 109, January 1970, pages 95-100.
1023 
1024  Parameters:
1025 
1026  Input, int RULE, the index of the rule.
1027 
1028  Input, int SUBORDER_NUM, the number of suborders of the rule.
1029 
1030  Output, double SUBORDER_XYZ[3*SUBORDER_NUM],
1031  the barycentric coordinates of the abscissas.
1032 
1033  Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights.
1034 */
1035 {
1036  int i;
1037  int s;
1038  int suborder_w_d;
1039  int *suborder_w_n;
1040  int suborder_xyz_d;
1041  int *suborder_xyz_n;
1042 
1043  suborder_xyz_n = ( int * ) malloc ( 3 * suborder_num * sizeof ( int ) );
1044  suborder_w_n = ( int * ) malloc ( suborder_num * sizeof ( int ) );
1045 
1046  if ( rule == 1 )
1047  {
1048  triangle_ncc_subrule_01 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1049  suborder_w_n, &suborder_w_d );
1050  }
1051  else if ( rule == 2 )
1052  {
1053  triangle_ncc_subrule_02 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1054  suborder_w_n, &suborder_w_d );
1055  }
1056  else if ( rule == 3 )
1057  {
1058  triangle_ncc_subrule_03 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1059  suborder_w_n, &suborder_w_d );
1060  }
1061  else if ( rule == 4 )
1062  {
1063  triangle_ncc_subrule_04 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1064  suborder_w_n, &suborder_w_d );
1065  }
1066  else if ( rule == 5 )
1067  {
1068  triangle_ncc_subrule_05 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1069  suborder_w_n, &suborder_w_d );
1070  }
1071  else if ( rule == 6 )
1072  {
1073  triangle_ncc_subrule_06 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1074  suborder_w_n, &suborder_w_d );
1075  }
1076  else if ( rule == 7 )
1077  {
1078  triangle_ncc_subrule_07 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1079  suborder_w_n, &suborder_w_d );
1080  }
1081  else if ( rule == 8 )
1082  {
1083  triangle_ncc_subrule_08 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1084  suborder_w_n, &suborder_w_d );
1085  }
1086  else if ( rule == 9 )
1087  {
1088  triangle_ncc_subrule_09 ( suborder_num, suborder_xyz_n, &suborder_xyz_d,
1089  suborder_w_n, &suborder_w_d );
1090  }
1091  else
1092  {
1093  fprintf ( stderr, "\n" );
1094  fprintf ( stderr, "TRIANGLE_NCC_SUBRULE - Fatal error!\n" );
1095  fprintf ( stderr, " Illegal RULE = %d\n", rule );
1096  exit ( 1 );
1097  }
1098 
1099  for ( s = 0; s < suborder_num; s++ )
1100  {
1101  for ( i = 0; i < 3; i++ )
1102  {
1103  suborder_xyz[i+s*3] =
1104  ( double ) ( suborder_xyz_n[i+s*3] )
1105  / ( double ) ( suborder_xyz_d );
1106  }
1107  }
1108  for ( s = 0; s < suborder_num; s++ )
1109  {
1110  suborder_w[s] = ( double ) suborder_w_n[s] / ( double ) suborder_w_d;
1111  }
1112 
1113  free ( suborder_w_n );
1114  free ( suborder_xyz_n );
1115 
1116  return;
1117 }
1118 /******************************************************************************/
1119 
1120 void triangle_ncc_subrule_01 ( int suborder_num, int suborder_xyz_n[],
1121  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1122 
1123 /******************************************************************************/
1124 /*
1125  Purpose:
1126 
1127  TRIANGLE_NCC_SUBRULE_01 returns a compressed NCC rule 1.
1128 
1129  Licensing:
1130 
1131  This code is distributed under the GNU LGPL license.
1132 
1133  Modified:
1134 
1135  30 January 2007
1136 
1137  Author:
1138 
1139  John Burkardt
1140 
1141  Reference:
1142 
1143  Peter Silvester,
1144  Symmetric Quadrature Formulae for Simplexes,
1145  Mathematics of Computation,
1146  Volume 24, Number 109, January 1970, pages 95-100.
1147 
1148  Parameters:
1149 
1150  Input, int SUBORDER_NUM, the number of suborders of the rule.
1151 
1152  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1153  the numerators of the barycentric coordinates of the abscissas.
1154 
1155  Output, int *SUBORDER_XYZ_D,
1156  the denominator of the barycentric coordinates of the abscissas.
1157 
1158  Output, int SUBORDER_W_N[SUBORDER_NUM],
1159  the numerator of the suborder weights.
1160 
1161  Output, int SUBORDER_W_D,
1162  the denominator of the suborder weights.
1163 */
1164 {
1165  int i;
1166  int s;
1167  int suborder_xyz_n_01[3*1] = {
1168  1, 1, 1
1169  };
1170  int suborder_xyz_d_01 = 3;
1171  int suborder_w_n_01[1] = { 1 };
1172  int suborder_w_d_01 = 1;
1173 
1174  for ( s = 0; s < suborder_num; s++ )
1175  {
1176  for ( i = 0; i < 3; i++ )
1177  {
1178  suborder_xyz_n[i+s*3] = suborder_xyz_n_01[i+s*3];
1179  }
1180  }
1181  *suborder_xyz_d = suborder_xyz_d_01;
1182 
1183  for ( s = 0; s < suborder_num; s++ )
1184  {
1185  suborder_w_n[s] = suborder_w_n_01[s];
1186  }
1187  *suborder_w_d = suborder_w_d_01;
1188 
1189  return;
1190 }
1191 /******************************************************************************/
1192 
1193 void triangle_ncc_subrule_02 ( int suborder_num, int suborder_xyz_n[],
1194  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1195 
1196 /******************************************************************************/
1197 /*
1198  Purpose:
1199 
1200  TRIANGLE_NCC_SUBRULE_02 returns a compressed NCC rule 2.
1201 
1202  Licensing:
1203 
1204  This code is distributed under the GNU LGPL license.
1205 
1206  Modified:
1207 
1208  30 January 2007
1209 
1210  Author:
1211 
1212  John Burkardt
1213 
1214  Reference:
1215 
1216  Peter Silvester,
1217  Symmetric Quadrature Formulae for Simplexes,
1218  Mathematics of Computation,
1219  Volume 24, Number 109, January 1970, pages 95-100.
1220 
1221  Parameters:
1222 
1223  Input, int SUBORDER_NUM, the number of suborders of the rule.
1224 
1225  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1226  the numerators of the barycentric coordinates of the abscissas.
1227 
1228  Output, int *SUBORDER_XYZ_D,
1229  the denominator of the barycentric coordinates of the abscissas.
1230 
1231  Output, int SUBORDER_W_N[SUBORDER_NUM],
1232  the numerator of the suborder weights.
1233 
1234  Output, int SUBORDER_W_D,
1235  the denominator of the suborder weights.
1236 */
1237 {
1238  int i;
1239  int s;
1240  int suborder_xyz_n_02[3*1] = {
1241  1, 0, 0
1242  };
1243  int suborder_xyz_d_02 = 1;
1244  int suborder_w_n_02[1] = { 1 };
1245  int suborder_w_d_02 = 3;
1246 
1247  for ( s = 0; s < suborder_num; s++ )
1248  {
1249  for ( i = 0; i < 3; i++ )
1250  {
1251  suborder_xyz_n[i+s*3] = suborder_xyz_n_02[i+s*3];
1252  }
1253  }
1254  *suborder_xyz_d = suborder_xyz_d_02;
1255 
1256  for ( s = 0; s < suborder_num; s++ )
1257  {
1258  suborder_w_n[s] = suborder_w_n_02[s];
1259  }
1260  *suborder_w_d = suborder_w_d_02;
1261 
1262  return;
1263 }
1264 /******************************************************************************/
1265 
1266 void triangle_ncc_subrule_03 ( int suborder_num, int suborder_xyz_n[],
1267  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1268 
1269 /******************************************************************************/
1270 /*
1271  Purpose:
1272 
1273  TRIANGLE_NCC_SUBRULE_03 returns a compressed NCC rule 3.
1274 
1275  Licensing:
1276 
1277  This code is distributed under the GNU LGPL license.
1278 
1279  Modified:
1280 
1281  30 January 2007
1282 
1283  Author:
1284 
1285  John Burkardt
1286 
1287  Reference:
1288 
1289  Peter Silvester,
1290  Symmetric Quadrature Formulae for Simplexes,
1291  Mathematics of Computation,
1292  Volume 24, Number 109, January 1970, pages 95-100.
1293 
1294  Parameters:
1295 
1296  Input, int SUBORDER_NUM, the number of suborders of the rule.
1297 
1298  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1299  the numerators of the barycentric coordinates of the abscissas.
1300 
1301  Output, int *SUBORDER_XYZ_D,
1302  the denominator of the barycentric coordinates of the abscissas.
1303 
1304  Output, int SUBORDER_W_N[SUBORDER_NUM],
1305  the numerator of the suborder weights.
1306 
1307  Output, int SUBORDER_W_D,
1308  the denominator of the suborder weights.
1309 */
1310 {
1311  int i;
1312  int s;
1313  int suborder_xyz_n_03[3*1] = {
1314  1, 1, 0
1315  };
1316  int suborder_xyz_d_03 = 2;
1317  int suborder_w_n_03[1] = { 1 };
1318  int suborder_w_d_03 = 3;
1319 
1320  for ( s = 0; s < suborder_num; s++ )
1321  {
1322  for ( i = 0; i < 3; i++ )
1323  {
1324  suborder_xyz_n[i+s*3] = suborder_xyz_n_03[i+s*3];
1325  }
1326  }
1327  *suborder_xyz_d = suborder_xyz_d_03;
1328 
1329  for ( s = 0; s < suborder_num; s++ )
1330  {
1331  suborder_w_n[s] = suborder_w_n_03[s];
1332  }
1333  *suborder_w_d = suborder_w_d_03;
1334 
1335  return;
1336 }
1337 /******************************************************************************/
1338 
1339 void triangle_ncc_subrule_04 ( int suborder_num, int suborder_xyz_n[],
1340  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1341 
1342 /******************************************************************************/
1343 /*
1344  Purpose:
1345 
1346  TRIANGLE_NCC_SUBRULE_04 returns a compressed NCC rule 4.
1347 
1348  Licensing:
1349 
1350  This code is distributed under the GNU LGPL license.
1351 
1352  Modified:
1353 
1354  30 January 2007
1355 
1356  Author:
1357 
1358  John Burkardt
1359 
1360  Reference:
1361 
1362  Peter Silvester,
1363  Symmetric Quadrature Formulae for Simplexes,
1364  Mathematics of Computation,
1365  Volume 24, Number 109, January 1970, pages 95-100.
1366 
1367  Parameters:
1368 
1369  Input, int SUBORDER_NUM, the number of suborders of the rule.
1370 
1371  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1372  the numerators of the barycentric coordinates of the abscissas.
1373 
1374  Output, int *SUBORDER_XYZ_D,
1375  the denominator of the barycentric coordinates of the abscissas.
1376 
1377  Output, int SUBORDER_W_N[SUBORDER_NUM],
1378  the numerator of the suborder weights.
1379 
1380  Output, int SUBORDER_W_D,
1381  the denominator of the suborder weights.
1382 */
1383 {
1384  int i;
1385  int s;
1386  int suborder_xyz_n_04[3*3] = {
1387  3, 0, 0,
1388  2, 1, 0,
1389  1, 1, 1
1390  };
1391  int suborder_xyz_d_04 = 3;
1392  int suborder_w_n_04[3] = { 4, 9, 54 };
1393  int suborder_w_d_04 = 120;
1394 
1395  for ( s = 0; s < suborder_num; s++ )
1396  {
1397  for ( i = 0; i < 3; i++ )
1398  {
1399  suborder_xyz_n[i+s*3] = suborder_xyz_n_04[i+s*3];
1400  }
1401  }
1402  *suborder_xyz_d = suborder_xyz_d_04;
1403 
1404  for ( s = 0; s < suborder_num; s++ )
1405  {
1406  suborder_w_n[s] = suborder_w_n_04[s];
1407  }
1408  *suborder_w_d = suborder_w_d_04;
1409 
1410  return;
1411 }
1412 /******************************************************************************/
1413 
1414 void triangle_ncc_subrule_05 ( int suborder_num, int suborder_xyz_n[],
1415  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1416 
1417 /******************************************************************************/
1418 /*
1419  Purpose:
1420 
1421  TRIANGLE_NCC_SUBRULE_05 returns a compressed NCC rule 5.
1422 
1423  Licensing:
1424 
1425  This code is distributed under the GNU LGPL license.
1426 
1427  Modified:
1428 
1429  30 January 2007
1430 
1431  Author:
1432 
1433  John Burkardt
1434 
1435  Reference:
1436 
1437  Peter Silvester,
1438  Symmetric Quadrature Formulae for Simplexes,
1439  Mathematics of Computation,
1440  Volume 24, Number 109, January 1970, pages 95-100.
1441 
1442  Parameters:
1443 
1444  Input, int SUBORDER_NUM, the number of suborders of the rule.
1445 
1446  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1447  the numerators of the barycentric coordinates of the abscissas.
1448 
1449  Output, int *SUBORDER_XYZ_D,
1450  the denominator of the barycentric coordinates of the abscissas.
1451 
1452  Output, int SUBORDER_W_N[SUBORDER_NUM],
1453  the numerator of the suborder weights.
1454 
1455  Output, int SUBORDER_W_D,
1456  the denominator of the suborder weights.
1457 */
1458 {
1459  int i;
1460  int s;
1461  int suborder_xyz_n_05[3*3] = {
1462  3, 1, 0,
1463  2, 2, 0,
1464  2, 1, 1
1465  };
1466  int suborder_xyz_d_05 = 4;
1467  int suborder_w_n_05[3] = { 4, -1, 8 };
1468  int suborder_w_d_05 = 45;
1469 
1470  for ( s = 0; s < suborder_num; s++ )
1471  {
1472  for ( i = 0; i < 3; i++ )
1473  {
1474  suborder_xyz_n[i+s*3] = suborder_xyz_n_05[i+s*3];
1475  }
1476  }
1477  *suborder_xyz_d = suborder_xyz_d_05;
1478 
1479  for ( s = 0; s < suborder_num; s++ )
1480  {
1481  suborder_w_n[s] = suborder_w_n_05[s];
1482  }
1483  *suborder_w_d = suborder_w_d_05;
1484 
1485  return;
1486 }
1487 /******************************************************************************/
1488 
1489 void triangle_ncc_subrule_06 ( int suborder_num, int suborder_xyz_n[],
1490  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1491 
1492 /******************************************************************************/
1493 /*
1494  Purpose:
1495 
1496  TRIANGLE_NCC_SUBRULE_06 returns a compressed NCC rule 6.
1497 
1498  Licensing:
1499 
1500  This code is distributed under the GNU LGPL license.
1501 
1502  Modified:
1503 
1504  30 January 2007
1505 
1506  Author:
1507 
1508  John Burkardt
1509 
1510  Reference:
1511 
1512  Peter Silvester,
1513  Symmetric Quadrature Formulae for Simplexes,
1514  Mathematics of Computation,
1515  Volume 24, Number 109, January 1970, pages 95-100.
1516 
1517  Parameters:
1518 
1519  Input, int SUBORDER_NUM, the number of suborders of the rule.
1520 
1521  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1522  the numerators of the barycentric coordinates of the abscissas.
1523 
1524  Output, int *SUBORDER_XYZ_D,
1525  the denominator of the barycentric coordinates of the abscissas.
1526 
1527  Output, int SUBORDER_W_N[SUBORDER_NUM],
1528  the numerator of the suborder weights.
1529 
1530  Output, int SUBORDER_W_D,
1531  the denominator of the suborder weights.
1532 */
1533 {
1534  int i;
1535  int s;
1536  int suborder_xyz_n_06[3*5] = {
1537  5, 0, 0,
1538  4, 1, 0,
1539  3, 2, 0,
1540  3, 1, 1,
1541  2, 2, 1
1542  };
1543  int suborder_xyz_d_06 = 5;
1544  int suborder_w_n_06[5] = { 11, 25, 25, 200, 25 };
1545  int suborder_w_d_06 = 1008;
1546 
1547  for ( s = 0; s < suborder_num; s++ )
1548  {
1549  for ( i = 0; i < 3; i++ )
1550  {
1551  suborder_xyz_n[i+s*3] = suborder_xyz_n_06[i+s*3];
1552  }
1553  }
1554  *suborder_xyz_d = suborder_xyz_d_06;
1555 
1556  for ( s = 0; s < suborder_num; s++ )
1557  {
1558  suborder_w_n[s] = suborder_w_n_06[s];
1559  }
1560  *suborder_w_d = suborder_w_d_06;
1561 
1562  return;
1563 }
1564 /******************************************************************************/
1565 
1566 void triangle_ncc_subrule_07 ( int suborder_num, int suborder_xyz_n[],
1567  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1568 
1569 /******************************************************************************/
1570 /*
1571  Purpose:
1572 
1573  TRIANGLE_NCC_SUBRULE_07 returns a compressed NCC rule 7.
1574 
1575  Licensing:
1576 
1577  This code is distributed under the GNU LGPL license.
1578 
1579  Modified:
1580 
1581  30 January 2007
1582 
1583  Author:
1584 
1585  John Burkardt
1586 
1587  Reference:
1588 
1589  Peter Silvester,
1590  Symmetric Quadrature Formulae for Simplexes,
1591  Mathematics of Computation,
1592  Volume 24, Number 109, January 1970, pages 95-100.
1593 
1594  Parameters:
1595 
1596  Input, int SUBORDER_NUM, the number of suborders of the rule.
1597 
1598  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1599  the numerators of the barycentric coordinates of the abscissas.
1600 
1601  Output, int *SUBORDER_XYZ_D,
1602  the denominator of the barycentric coordinates of the abscissas.
1603 
1604  Output, int SUBORDER_W_N[SUBORDER_NUM],
1605  the numerator of the suborder weights.
1606 
1607  Output, int SUBORDER_W_D,
1608  the denominator of the suborder weights.
1609 */
1610 {
1611  int i;
1612  int s;
1613  int suborder_xyz_n_07[3*6] = {
1614  5, 1, 0,
1615  4, 2, 0,
1616  4, 1, 1,
1617  3, 3, 0,
1618  3, 2, 1,
1619  2, 2, 2
1620  };
1621  int suborder_xyz_d_07 = 6;
1622  int suborder_w_n_07[6] = { 36, -27, 72, 64, 72, -54 };
1623  int suborder_w_d_07 = 840;
1624 
1625  for ( s = 0; s < suborder_num; s++ )
1626  {
1627  for ( i = 0; i < 3; i++ )
1628  {
1629  suborder_xyz_n[i+s*3] = suborder_xyz_n_07[i+s*3];
1630  }
1631  }
1632  *suborder_xyz_d = suborder_xyz_d_07;
1633 
1634  for ( s = 0; s < suborder_num; s++ )
1635  {
1636  suborder_w_n[s] = suborder_w_n_07[s];
1637  }
1638  *suborder_w_d = suborder_w_d_07;
1639 
1640  return;
1641 }
1642 /******************************************************************************/
1643 
1644 void triangle_ncc_subrule_08 ( int suborder_num, int suborder_xyz_n[],
1645  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1646 
1647 /******************************************************************************/
1648 /*
1649  Purpose:
1650 
1651  TRIANGLE_NCC_SUBRULE_08 returns a compressed NCC rule 8.
1652 
1653  Licensing:
1654 
1655  This code is distributed under the GNU LGPL license.
1656 
1657  Modified:
1658 
1659  30 January 2007
1660 
1661  Author:
1662 
1663  John Burkardt
1664 
1665  Reference:
1666 
1667  Peter Silvester,
1668  Symmetric Quadrature Formulae for Simplexes,
1669  Mathematics of Computation,
1670  Volume 24, Number 109, January 1970, pages 95-100.
1671 
1672  Parameters:
1673 
1674  Input, int SUBORDER_NUM, the number of suborders of the rule.
1675 
1676  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1677  the numerators of the barycentric coordinates of the abscissas.
1678 
1679  Output, int *SUBORDER_XYZ_D,
1680  the denominator of the barycentric coordinates of the abscissas.
1681 
1682  Output, int SUBORDER_W_N[SUBORDER_NUM],
1683  the numerator of the suborder weights.
1684 
1685  Output, int SUBORDER_W_D,
1686  the denominator of the suborder weights.
1687 */
1688 {
1689  int i;
1690  int s;
1691  int suborder_xyz_n_08[3*8] = {
1692  7, 0, 0,
1693  6, 1, 0,
1694  5, 2, 0,
1695  5, 1, 1,
1696  4, 3, 0,
1697  4, 2, 1,
1698  3, 3, 1,
1699  3, 2, 2
1700  };
1701  int suborder_xyz_d_08 = 7;
1702  int suborder_w_n_08[8] = { 1336, 2989, 3577, 32242, 2695, -6860, 44590, 3430 };
1703  int suborder_w_d_08 = 259200;
1704 
1705  for ( s = 0; s < suborder_num; s++ )
1706  {
1707  for ( i = 0; i < 3; i++ )
1708  {
1709  suborder_xyz_n[i+s*3] = suborder_xyz_n_08[i+s*3];
1710  }
1711  }
1712  *suborder_xyz_d = suborder_xyz_d_08;
1713 
1714  for ( s = 0; s < suborder_num; s++ )
1715  {
1716  suborder_w_n[s] = suborder_w_n_08[s];
1717  }
1718  *suborder_w_d = suborder_w_d_08;
1719 
1720  return;
1721 }
1722 /******************************************************************************/
1723 
1724 void triangle_ncc_subrule_09 ( int suborder_num, int suborder_xyz_n[],
1725  int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d )
1726 
1727 /******************************************************************************/
1728 /*
1729  Purpose:
1730 
1731  TRIANGLE_NCC_SUBRULE_09 returns a compressed NCC rule 9.
1732 
1733  Licensing:
1734 
1735  This code is distributed under the GNU LGPL license.
1736 
1737  Modified:
1738 
1739  30 January 2007
1740 
1741  Author:
1742 
1743  John Burkardt
1744 
1745  Reference:
1746 
1747  Peter Silvester,
1748  Symmetric Quadrature Formulae for Simplexes,
1749  Mathematics of Computation,
1750  Volume 24, Number 109, January 1970, pages 95-100.
1751 
1752  Parameters:
1753 
1754  Input, int SUBORDER_NUM, the number of suborders of the rule.
1755 
1756  Output, int SUBORDER_XYZ_N[3*SUBORDER_NUM],
1757  the numerators of the barycentric coordinates of the abscissas.
1758 
1759  Output, int *SUBORDER_XYZ_D,
1760  the denominator of the barycentric coordinates of the abscissas.
1761 
1762  Output, int SUBORDER_W_N[SUBORDER_NUM],
1763  the numerator of the suborder weights.
1764 
1765  Output, int SUBORDER_W_D,
1766  the denominator of the suborder weights.
1767 */
1768 {
1769  int i;
1770  int s;
1771  int suborder_xyz_n_09[3*9] = {
1772  7, 1, 0,
1773  6, 2, 0,
1774  6, 1, 1,
1775  5, 3, 0,
1776  5, 2, 1,
1777  4, 4, 0,
1778  4, 3, 1,
1779  4, 2, 2,
1780  3, 3, 2
1781  };
1782  int suborder_xyz_d_09 = 8;
1783  int suborder_w_n_09[9] = {
1784  368, -468, 704, 1136, 832, -1083, 672, -1448, 1472 };
1785  int suborder_w_d_09 = 14175;
1786 
1787  for ( s = 0; s < suborder_num; s++ )
1788  {
1789  for ( i = 0; i < 3; i++ )
1790  {
1791  suborder_xyz_n[i+s*3] = suborder_xyz_n_09[i+s*3];
1792  }
1793  }
1794  *suborder_xyz_d = suborder_xyz_d_09;
1795 
1796  for ( s = 0; s < suborder_num; s++ )
1797  {
1798  suborder_w_n[s] = suborder_w_n_09[s];
1799  }
1800  *suborder_w_d = suborder_w_d_09;
1801 
1802  return;
1803 }
void triangle_ncc_subrule_04(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
void triangle_ncc_subrule_02(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
int r8_nint(double x)
void triangle_ncc_subrule_07(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
int triangle_ncc_rule_num()
void triangle_ncc_subrule_06(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
void triangle_ncc_subrule(int rule, int suborder_num, double suborder_xyz[], double suborder_w[])
void triangle_ncc_subrule_03(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
double r8_huge()
void triangle_ncc_rule(int rule, int order_num, double xy[], double w[])
int triangle_ncc_suborder_num(int rule)
void triangle_ncc_subrule_08(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
double triangle_area(double t[2 *3])
void triangle_ncc_subrule_05(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
int * triangle_ncc_suborder(int rule, int suborder_num)
void reference_to_physical_t3(double t[], int n, double ref[], double phy[])
void triangle_ncc_subrule_01(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
int triangle_ncc_order_num(int rule)
int triangle_ncc_degree(int rule)
void triangle_ncc_subrule_09(int suborder_num, int suborder_xyz_n[], int *suborder_xyz_d, int suborder_w_n[], int *suborder_w_d)
int i4_wrap(int ival, int ilo, int ihi)
int i4_modp(int i, int j)