|
6 | 6 | # py.test excludes classes with a constructor by default, so define parameter here |
7 | 7 | t_start = 0.0 |
8 | 8 | t_end = 1.0 |
9 | | -classes = [ ["CollGaussLegendre", 2, 2]] |
10 | | -#classes = [ ["CollGaussLegendre", 2, 12], ["CollGaussLobatto", 2, 12], ["CollGaussRadau_Right", 2, 12] ] |
| 9 | +#classes = [ ["CollGaussLegendre", 2, 2]] |
| 10 | +classes = [ ["CollGaussLegendre", 2, 12], ["CollGaussLobatto", 2, 12], ["CollGaussRadau_Right", 2, 12] ] |
11 | 11 |
|
12 | 12 | class TestCollocation: |
13 | 13 |
|
@@ -45,20 +45,14 @@ def test_2(self): |
45 | 45 | for type in classes: |
46 | 46 | for M in range(type[1],type[2]+1): |
47 | 47 | coll = getattr(pySDC.CollocationClasses, type[0])(M, t_start, t_end) |
48 | | - Q = coll.Qmat |
49 | | - Q = Q[1:,1:] |
50 | | - S = coll.Smat |
51 | | - S = S[1:,1:] |
52 | | - #print Q |
53 | | - #print S |
| 48 | + Q = coll.Qmat[1:,1:] |
| 49 | + S = coll.Smat[1:,1:] |
54 | 50 | assert np.shape(Q) == np.shape(S), "For node type " + type[0] + ", Qmat and Smat have different shape" |
55 | 51 | shape = np.shape(Q) |
56 | 52 | assert shape[0] == shape[1], "For node type " + type[0] + ", Qmat / Smat are not quadratic" |
| 53 | + SSum = np.cumsum(S[:,:],axis=0) |
57 | 54 | for i in range(0,M): |
58 | | - Ssum = np.sum(S[0:i,:], axis=0) |
59 | | - #print Ssum |
60 | | - #print Q[i,:] |
61 | | - # ...the matrices do not have size MxM, but rather (M+1)x(M+1)... how does the summation property look like here |
| 55 | + assert np.linalg.norm( Q[i,:] - SSum[i,:] ) < 1e-15, "For node type " + type[0] + ", Qmat and Smat did not satisfy the expected summation property." |
62 | 56 |
|
63 | 57 | # TEST 3: |
64 | 58 | # Check that the partial quadrature rules from Qmat entries have order equal to number of nodes M |
|
0 commit comments