28 October 2016 07:00:01 PM

TETRAHEDRON_KEAST_RULE_PRB:
  C version
  Test the TETRAHEDRON_KEAST_RULE library.

TEST01
  KEAST_RULE_NUM returns the number of rules;
  KEAST_DEGREE returns the degree of a rule;
  KEAST_ORDER_NUM returns the order of a rule.

  Number of available rules = 10

      Rule    Degree     Order

         1         0         1
         2         1         4
         3         2         5
         4         3        10
         5         4        11
         6         4        14
         7         5        15
         8         6        24
         9         7        31
        10         8        45

TEST02
  KEAST_RULE returns the points and weights
  of a Keast rule for the triangle.

  In this test, we simply check that the weights
  sum to 1.

  Number of available rules = 10

      Rule      Order     Sum of weights

         1         1               1
         2         4               1
         3         5               1
         4        10               1
         5        11               1
         6        14               1
         7        15               1
         8        24               1
         9        31               1
        10        45               1

TEST03
  KEAST_RULE returns the points and weights
  of a Keast rule for the triangle.

  In this test, we simply check that, for each
  quadrature point, the barycentric coordinates
  add up to 1.

      Rule    Suborder    Sum of coordinates


         1         1
                                              1

         2         1
                                              1

         3         2
                                              1
                             0.9999999999999999

         4         2
                                              1
                                              1

         5         3
                                              1
                             0.9999999999999999
                                              1

         6         3
                                              1
                             0.9999999999999999
                                              1

         7         4
                                              1
                                              1
                                              1
                                              1

         8         4
                                              1
                             0.9999999999999999
                                              1
                                              1

         9         6
                                              1
                                              1
                                              1
                                              1
                                              1
                                              1

        10         7
                                              1
                                              1
                             0.9999999999999999
                                              1
                                              1
                                              1
                                              1

TEST04
  TETRAHEDRON_REFERENCE_TO_PHYSICAL transforms a rule
  on the unit (reference) tetrahedron to a rule on 
  an arbitrary (physical) tetrahedron.

  The reference tetrahedron:

         1               0               0               0
         2               1               0               0
         3               0               1               0
         4               0               0               1

  Rule 2 for reference tetrahedron
  with volume = 0.166667

                X               Y               Z             W

         0         0.58541        0.138197        0.138197            0.25
         1        0.138197        0.138197        0.138197            0.25
         2        0.138197        0.138197         0.58541            0.25
         3        0.138197         0.58541        0.138197            0.25

  The physical tetrahedron:

         1               1               2               3
         2               2               2               3
         3               1               3               3
         4               1               2               9

  Rule 2 for physical tetrahedron
  with volume = 1

                X               Y               Z             W

         0         1.58541          2.1382         3.82918            0.25
         1          1.1382          2.1382         3.82918            0.25
         2          1.1382          2.1382         6.51246            0.25
         3          1.1382         2.58541         3.82918            0.25

TEST05
  Demonstrate the KEAST rules on a sequence of
  monomial integrands X^A Y^B Z^C
  on the unit tetrahedron.

      Rule     Order     Quad


  F(X,Y,Z) = X^0 * Y^0 * Z^0

         1         1               1
         2         4               1
         3         5               1
         4        10               1
         5        11               1
         6        14               1
         7        15               1
         8        24               1
         9        31               1
        10        45               1

  F(X,Y,Z) = X^1 * Y^0 * Z^0

         1         1            0.25
         2         4            0.25
         3         5            0.25
         4        10            0.25
         5        11            0.25
         6        14            0.25
         7        15            0.25
         8        24            0.25
         9        31            0.25
        10        45            0.25

  F(X,Y,Z) = X^0 * Y^1 * Z^0

         1         1            0.25
         2         4            0.25
         3         5            0.25
         4        10            0.25
         5        11            0.25
         6        14            0.25
         7        15            0.25
         8        24            0.25
         9        31            0.25
        10        45            0.25

  F(X,Y,Z) = X^0 * Y^0 * Z^1

         1         1            0.25
         2         4            0.25
         3         5            0.25
         4        10            0.25
         5        11            0.25
         6        14            0.25
         7        15            0.25
         8        24            0.25
         9        31            0.25
        10        45            0.25

  F(X,Y,Z) = X^2 * Y^0 * Z^0

         1         1          0.0625
         2         4             0.1
         3         5             0.1
         4        10             0.1
         5        11             0.1
         6        14             0.1
         7        15             0.1
         8        24             0.1
         9        31             0.1
        10        45             0.1

  F(X,Y,Z) = X^1 * Y^1 * Z^0

         1         1          0.0625
         2         4            0.05
         3         5            0.05
         4        10            0.05
         5        11            0.05
         6        14            0.05
         7        15            0.05
         8        24            0.05
         9        31            0.05
        10        45            0.05

  F(X,Y,Z) = X^0 * Y^2 * Z^0

         1         1          0.0625
         2         4             0.1
         3         5             0.1
         4        10             0.1
         5        11             0.1
         6        14             0.1
         7        15             0.1
         8        24             0.1
         9        31             0.1
        10        45             0.1

  F(X,Y,Z) = X^1 * Y^0 * Z^1

         1         1          0.0625
         2         4            0.05
         3         5            0.05
         4        10            0.05
         5        11            0.05
         6        14            0.05
         7        15            0.05
         8        24            0.05
         9        31            0.05
        10        45            0.05

  F(X,Y,Z) = X^0 * Y^1 * Z^1

         1         1          0.0625
         2         4            0.05
         3         5            0.05
         4        10            0.05
         5        11            0.05
         6        14            0.05
         7        15            0.05
         8        24            0.05
         9        31            0.05
        10        45            0.05

  F(X,Y,Z) = X^0 * Y^0 * Z^2

         1         1          0.0625
         2         4             0.1
         3         5             0.1
         4        10             0.1
         5        11             0.1
         6        14             0.1
         7        15             0.1
         8        24             0.1
         9        31             0.1
        10        45             0.1

  F(X,Y,Z) = X^3 * Y^0 * Z^0

         1         1        0.015625
         2         4       0.0521353
         3         5            0.05
         4        10            0.05
         5        11            0.05
         6        14            0.05
         7        15            0.05
         8        24            0.05
         9        31            0.05
        10        45            0.05

  F(X,Y,Z) = X^2 * Y^1 * Z^0

         1         1        0.015625
         2         4       0.0159549
         3         5       0.0166667
         4        10       0.0166667
         5        11       0.0166667
         6        14       0.0166667
         7        15       0.0166667
         8        24       0.0166667
         9        31       0.0166667
        10        45       0.0166667

  F(X,Y,Z) = X^1 * Y^2 * Z^0

         1         1        0.015625
         2         4       0.0159549
         3         5       0.0166667
         4        10       0.0166667
         5        11       0.0166667
         6        14       0.0166667
         7        15       0.0166667
         8        24       0.0166667
         9        31       0.0166667
        10        45       0.0166667

  F(X,Y,Z) = X^0 * Y^3 * Z^0

         1         1        0.015625
         2         4       0.0521353
         3         5            0.05
         4        10            0.05
         5        11            0.05
         6        14            0.05
         7        15            0.05
         8        24            0.05
         9        31            0.05
        10        45            0.05

  F(X,Y,Z) = X^2 * Y^0 * Z^1

         1         1        0.015625
         2         4       0.0159549
         3         5       0.0166667
         4        10       0.0166667
         5        11       0.0166667
         6        14       0.0166667
         7        15       0.0166667
         8        24       0.0166667
         9        31       0.0166667
        10        45       0.0166667

  F(X,Y,Z) = X^1 * Y^1 * Z^1

         1         1        0.015625
         2         4      0.00904508
         3         5      0.00833333
         4        10      0.00833333
         5        11      0.00833333
         6        14      0.00833333
         7        15      0.00833333
         8        24      0.00833333
         9        31      0.00833333
        10        45      0.00833333

  F(X,Y,Z) = X^0 * Y^2 * Z^1

         1         1        0.015625
         2         4       0.0159549
         3         5       0.0166667
         4        10       0.0166667
         5        11       0.0166667
         6        14       0.0166667
         7        15       0.0166667
         8        24       0.0166667
         9        31       0.0166667
        10        45       0.0166667

  F(X,Y,Z) = X^1 * Y^0 * Z^2

         1         1        0.015625
         2         4       0.0159549
         3         5       0.0166667
         4        10       0.0166667
         5        11       0.0166667
         6        14       0.0166667
         7        15       0.0166667
         8        24       0.0166667
         9        31       0.0166667
        10        45       0.0166667

  F(X,Y,Z) = X^0 * Y^1 * Z^2

         1         1        0.015625
         2         4       0.0159549
         3         5       0.0166667
         4        10       0.0166667
         5        11       0.0166667
         6        14       0.0166667
         7        15       0.0166667
         8        24       0.0166667
         9        31       0.0166667
        10        45       0.0166667

  F(X,Y,Z) = X^0 * Y^0 * Z^3

         1         1        0.015625
         2         4       0.0521353
         3         5            0.05
         4        10            0.05
         5        11            0.05
         6        14            0.05
         7        15            0.05
         8        24            0.05
         9        31            0.05
        10        45            0.05

TEST06
  KEAST_RULE returns the points and weights
  of a Keast rule for the triangle.

  In this test, we simply print a rule.

  Rule =   10
  Degree = 8
  Order =  4

         I      W               X               Y               Z

         0       -0.235962            0.25            0.25            0.25
         1       0.0244879        0.617587        0.127471        0.127471
         2       0.0244879        0.127471        0.127471        0.127471
         3       0.0244879        0.127471        0.127471        0.617587
         4       0.0244879        0.127471        0.617587        0.127471
         5      0.00394852        0.903764       0.0320788       0.0320788
         6      0.00394852       0.0320788       0.0320788       0.0320788
         7      0.00394852       0.0320788       0.0320788        0.903764
         8      0.00394852       0.0320788        0.903764       0.0320788
         9       0.0263056        0.450223       0.0497771       0.0497771
        10       0.0263056       0.0497771        0.450223       0.0497771
        11       0.0263056       0.0497771       0.0497771        0.450223
        12       0.0263056       0.0497771        0.450223        0.450223
        13       0.0263056        0.450223       0.0497771        0.450223
        14       0.0263056        0.450223        0.450223       0.0497771
        15       0.0829804         0.31627         0.18373         0.18373
        16       0.0829804         0.18373         0.31627         0.18373
        17       0.0829804         0.18373         0.18373         0.31627
        18       0.0829804         0.18373         0.31627         0.31627
        19       0.0829804         0.31627         0.18373         0.31627
        20       0.0829804         0.31627         0.31627         0.18373
        21       0.0254426       0.0229178        0.231901        0.231901
        22       0.0254426        0.231901       0.0229178        0.231901
        23       0.0254426        0.231901        0.231901       0.0229178
        24       0.0254426         0.51328        0.231901        0.231901
        25       0.0254426        0.231901         0.51328        0.231901
        26       0.0254426        0.231901        0.231901         0.51328
        27       0.0254426        0.231901       0.0229178         0.51328
        28       0.0254426       0.0229178         0.51328        0.231901
        29       0.0254426         0.51328        0.231901       0.0229178
        30       0.0254426        0.231901         0.51328       0.0229178
        31       0.0254426       0.0229178        0.231901         0.51328
        32       0.0254426         0.51328       0.0229178        0.231901
        33       0.0134324        0.730313         0.03797         0.03797
        34       0.0134324         0.03797        0.730313         0.03797
        35       0.0134324         0.03797         0.03797        0.730313
        36       0.0134324        0.193746         0.03797         0.03797
        37       0.0134324         0.03797        0.193746         0.03797
        38       0.0134324         0.03797         0.03797        0.193746
        39       0.0134324         0.03797        0.730313        0.193746
        40       0.0134324        0.730313        0.193746         0.03797
        41       0.0134324        0.193746         0.03797        0.730313
        42       0.0134324         0.03797        0.193746        0.730313
        43       0.0134324        0.730313         0.03797        0.193746
        44       0.0134324        0.193746        0.730313         0.03797

TETRAHEDRON_KEAST_RULE_PRB:
  Normal end of execution.

28 October 2016 07:00:01 PM