Chi-Tech
test_framework_chi_math_Quadrature_quadrature_test1_lua.h
Go to the documentation of this file.
1/** \page test_framework_chi_math_Quadrature_quadrature_test1_lua test/framework/chi_math/Quadrature/quadrature_test1.lua
2\ingroup LuaInputExamples
3
4\code
5function PrintTable(t, indent)
6 if not indent then indent = 0 end
7 strform = "%"..tostring(indent).."s"
8
9 for k,v in pairs(t) do
10 if (type(v) == "table") then
11 print(string.rep(" ", indent)..k.." ".."table")
12 PrintTable(v, indent+2)
13 else
14 print(string.rep(" ", indent)..k.." "..tostring(v))
15 end
16 end
17end
18
19print("GOLD_BEGIN")
20q = chi_math.QuadratureGaussLegendre.Create({N = 4, verbose = true})
21
22qdata = chi_math.Get1DQuadratureData(q)
23
24print("qpoints:")
25PrintTable(qdata.qpoints, 2)
26print("weights:")
27PrintTable(qdata.weights, 2)
28print()
29
30--################################################
31q = chi_math.QuadratureGaussChebyshev.Create({N = 4, verbose = true})
32
33qdata = chi_math.Get1DQuadratureData(q)
34
35print("qpoints:")
36PrintTable(qdata.qpoints, 2)
37print("weights:")
38PrintTable(qdata.weights, 2)
39
40print("chiLegendre(0, 0.25)", chiLegendre(0, 0.25))
41print("chiLegendre(1, 0.25)", chiLegendre(1, 0.25))
42print("chiLegendreDerivative(0, 0.25)", chiLegendreDerivative(0, 0.25))
43print("chiLegendreDerivative(1, 0.25)", chiLegendreDerivative(1, 0.25))
44
45print("chiYlm(0, 0, 45*math.pi/180.0, 45*math.pi/180.0)", chiYlm(0, 0, 45*math.pi/180.0, 45*math.pi/180.0))
46print("chiYlm(1, 0, 45*math.pi/180.0, 45*math.pi/180.0)", chiYlm(1, 0, 45*math.pi/180.0, 45*math.pi/180.0))
47
48print("GOLD_END")\endcode
49*/
50
51