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