03 March 2022 09:49:11 AM TETRAHEDRON_KEAST_RULE_TEST: 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.1666666666666667 X Y Z W 0 0.5854101966249685 0.1381966011250105 0.1381966011250105 0.25 1 0.1381966011250105 0.1381966011250105 0.1381966011250105 0.25 2 0.1381966011250105 0.1381966011250105 0.5854101966249685 0.25 3 0.1381966011250105 0.5854101966249685 0.1381966011250105 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.585410196624968 2.13819660112501 3.829179606750063 0.25 1 1.13819660112501 2.13819660112501 3.829179606750063 0.25 2 1.13819660112501 2.13819660112501 6.512461179749811 0.25 3 1.13819660112501 2.585410196624968 3.829179606750063 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 0.9999999999999998 4 10 1 5 11 0.9999999999999999 6 14 1 7 15 0.9999999999999999 8 24 0.9999999999999996 9 31 1 10 45 0.999999999999999 F(X,Y,Z) = X^1 * Y^0 * Z^0 1 1 0.25 2 4 0.25 3 5 0.2499999999999999 4 10 0.2500000000000001 5 11 0.25 6 14 0.25 7 15 0.2500000000000001 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.2499999999999999 4 10 0.2500000000000001 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.2499999999999999 4 10 0.2500000000000001 5 11 0.25 6 14 0.25 7 15 0.2500000000000001 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.09999999999999998 4 10 0.09999999999999992 5 11 0.09999999999999999 6 14 0.1 7 15 0.1 8 24 0.1 9 31 0.09999999999999978 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.04999999999999998 4 10 0.05000000000000004 5 11 0.05 6 14 0.05 7 15 0.05 8 24 0.04999999999999999 9 31 0.05000000000000007 10 45 0.05000000000000001 F(X,Y,Z) = X^0 * Y^2 * Z^0 1 1 0.0625 2 4 0.1 3 5 0.09999999999999998 4 10 0.09999999999999991 5 11 0.09999999999999999 6 14 0.1 7 15 0.1 8 24 0.1 9 31 0.09999999999999977 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.04999999999999998 4 10 0.05000000000000004 5 11 0.05 6 14 0.05 7 15 0.05 8 24 0.04999999999999998 9 31 0.05000000000000007 10 45 0.05000000000000001 F(X,Y,Z) = X^0 * Y^1 * Z^1 1 1 0.0625 2 4 0.05 3 5 0.04999999999999998 4 10 0.05000000000000004 5 11 0.05 6 14 0.05 7 15 0.05 8 24 0.04999999999999998 9 31 0.05000000000000008 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.09999999999999998 4 10 0.09999999999999991 5 11 0.09999999999999999 6 14 0.1 7 15 0.1 8 24 0.1 9 31 0.09999999999999976 10 45 0.1 F(X,Y,Z) = X^3 * Y^0 * Z^0 1 1 0.015625 2 4 0.05213525491562423 3 5 0.05 4 10 0.04999999999999985 5 11 0.05000000000000001 6 14 0.05 7 15 0.05 8 24 0.05000000000000001 9 31 0.04999999999999982 10 45 0.04999999999999996 F(X,Y,Z) = X^2 * Y^1 * Z^0 1 1 0.015625 2 4 0.01595491502812526 3 5 0.01666666666666666 4 10 0.01666666666666669 5 11 0.01666666666666667 6 14 0.01666666666666667 7 15 0.01666666666666666 8 24 0.01666666666666667 9 31 0.01666666666666666 10 45 0.01666666666666667 F(X,Y,Z) = X^1 * Y^2 * Z^0 1 1 0.015625 2 4 0.01595491502812527 3 5 0.01666666666666666 4 10 0.01666666666666669 5 11 0.01666666666666667 6 14 0.01666666666666667 7 15 0.01666666666666667 8 24 0.01666666666666666 9 31 0.01666666666666666 10 45 0.01666666666666667 F(X,Y,Z) = X^0 * Y^3 * Z^0 1 1 0.015625 2 4 0.05213525491562423 3 5 0.04999999999999999 4 10 0.04999999999999986 5 11 0.05 6 14 0.05 7 15 0.05000000000000001 8 24 0.05000000000000001 9 31 0.04999999999999982 10 45 0.04999999999999998 F(X,Y,Z) = X^2 * Y^0 * Z^1 1 1 0.015625 2 4 0.01595491502812526 3 5 0.01666666666666666 4 10 0.01666666666666669 5 11 0.01666666666666666 6 14 0.01666666666666667 7 15 0.01666666666666666 8 24 0.01666666666666666 9 31 0.01666666666666666 10 45 0.01666666666666667 F(X,Y,Z) = X^1 * Y^1 * Z^1 1 1 0.015625 2 4 0.009045084971874735 3 5 0.008333333333333328 4 10 0.008333333333333337 5 11 0.008333333333333333 6 14 0.008333333333333335 7 15 0.008333333333333333 8 24 0.008333333333333335 9 31 0.008333333333333387 10 45 0.008333333333333338 F(X,Y,Z) = X^0 * Y^2 * Z^1 1 1 0.015625 2 4 0.01595491502812527 3 5 0.01666666666666666 4 10 0.01666666666666669 5 11 0.01666666666666667 6 14 0.01666666666666667 7 15 0.01666666666666667 8 24 0.01666666666666667 9 31 0.01666666666666666 10 45 0.01666666666666667 F(X,Y,Z) = X^1 * Y^0 * Z^2 1 1 0.015625 2 4 0.01595491502812526 3 5 0.01666666666666666 4 10 0.01666666666666669 5 11 0.01666666666666667 6 14 0.01666666666666667 7 15 0.01666666666666667 8 24 0.01666666666666667 9 31 0.01666666666666666 10 45 0.01666666666666667 F(X,Y,Z) = X^0 * Y^1 * Z^2 1 1 0.015625 2 4 0.01595491502812526 3 5 0.01666666666666666 4 10 0.01666666666666669 5 11 0.01666666666666667 6 14 0.01666666666666667 7 15 0.01666666666666667 8 24 0.01666666666666667 9 31 0.01666666666666666 10 45 0.01666666666666667 F(X,Y,Z) = X^0 * Y^0 * Z^3 1 1 0.015625 2 4 0.05213525491562423 3 5 0.05 4 10 0.04999999999999986 5 11 0.05000000000000001 6 14 0.05 7 15 0.05 8 24 0.05 9 31 0.04999999999999982 10 45 0.04999999999999997 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 = 45 I W X Y Z 0 -0.2359620398477557 0.25 0.25 0.25 1 0.02448789635605623 0.617587190300083 0.127470936566639 0.127470936566639 2 0.02448789635605623 0.127470936566639 0.127470936566639 0.127470936566639 3 0.02448789635605623 0.127470936566639 0.127470936566639 0.617587190300083 4 0.02448789635605623 0.127470936566639 0.617587190300083 0.127470936566639 5 0.003948520639826051 0.9037635088221031 0.0320788303926323 0.0320788303926323 6 0.003948520639826051 0.0320788303926323 0.0320788303926323 0.0320788303926323 7 0.003948520639826051 0.0320788303926323 0.0320788303926323 0.9037635088221031 8 0.003948520639826051 0.0320788303926323 0.9037635088221031 0.0320788303926323 9 0.02630555295073708 0.450222904356719 0.04977709564328102 0.04977709564328102 10 0.02630555295073708 0.04977709564328102 0.450222904356719 0.04977709564328102 11 0.02630555295073708 0.04977709564328102 0.04977709564328102 0.450222904356719 12 0.02630555295073708 0.04977709564328102 0.450222904356719 0.450222904356719 13 0.02630555295073708 0.450222904356719 0.04977709564328102 0.450222904356719 14 0.02630555295073708 0.450222904356719 0.450222904356719 0.04977709564328102 15 0.08298038305505891 0.3162695526014501 0.1837304473985499 0.1837304473985499 16 0.08298038305505891 0.1837304473985499 0.3162695526014501 0.1837304473985499 17 0.08298038305505891 0.1837304473985499 0.1837304473985499 0.3162695526014501 18 0.08298038305505891 0.1837304473985499 0.3162695526014501 0.3162695526014501 19 0.08298038305505891 0.3162695526014501 0.1837304473985499 0.3162695526014501 20 0.08298038305505891 0.3162695526014501 0.3162695526014501 0.1837304473985499 21 0.02544262454810235 0.02291778784481712 0.2319010893971509 0.2319010893971509 22 0.02544262454810235 0.2319010893971509 0.02291778784481712 0.2319010893971509 23 0.02544262454810235 0.2319010893971509 0.2319010893971509 0.02291778784481712 24 0.02544262454810235 0.5132800333608811 0.2319010893971509 0.2319010893971509 25 0.02544262454810235 0.2319010893971509 0.5132800333608811 0.2319010893971509 26 0.02544262454810235 0.2319010893971509 0.2319010893971509 0.5132800333608811 27 0.02544262454810235 0.2319010893971509 0.02291778784481712 0.5132800333608811 28 0.02544262454810235 0.02291778784481712 0.5132800333608811 0.2319010893971509 29 0.02544262454810235 0.5132800333608811 0.2319010893971509 0.02291778784481712 30 0.02544262454810235 0.2319010893971509 0.5132800333608811 0.02291778784481712 31 0.02544262454810235 0.02291778784481712 0.2319010893971509 0.5132800333608811 32 0.02544262454810235 0.5132800333608811 0.02291778784481712 0.2319010893971509 33 0.01343243843768521 0.7303134278075384 0.03797004847182861 0.03797004847182861 34 0.01343243843768521 0.03797004847182861 0.7303134278075384 0.03797004847182861 35 0.01343243843768521 0.03797004847182861 0.03797004847182861 0.7303134278075384 36 0.01343243843768521 0.1937464752488044 0.03797004847182861 0.03797004847182861 37 0.01343243843768521 0.03797004847182861 0.1937464752488044 0.03797004847182861 38 0.01343243843768521 0.03797004847182861 0.03797004847182861 0.1937464752488044 39 0.01343243843768521 0.03797004847182861 0.7303134278075384 0.1937464752488044 40 0.01343243843768521 0.7303134278075384 0.1937464752488044 0.03797004847182861 41 0.01343243843768521 0.1937464752488044 0.03797004847182861 0.7303134278075384 42 0.01343243843768521 0.03797004847182861 0.1937464752488044 0.7303134278075384 43 0.01343243843768521 0.7303134278075384 0.03797004847182861 0.1937464752488044 44 0.01343243843768521 0.1937464752488044 0.7303134278075384 0.03797004847182861 TETRAHEDRON_KEAST_RULE_TEST: Normal end of execution. 03 March 2022 09:49:11 AM