@@ -51,14 +51,14 @@ def plot_dg1_tri():
51
51
52
52
def test_dg_examples ():
53
53
dg0 = construct_dg0 ()
54
- test_func = MyTestFunction (lambda : 3 )
54
+ test_func = FuseFunction (lambda : 3 )
55
55
56
56
for dof in dg0 .generate ():
57
57
assert np .allclose (dof .eval (test_func ), 3 )
58
58
59
59
dg1 = construct_dg1 ()
60
60
x = sp .Symbol ("x" )
61
- test_func = MyTestFunction (2 * x , symbols = (x ,))
61
+ test_func = FuseFunction (2 * x , symbols = (x ,))
62
62
63
63
dof_vals = [- 2 , 2 ]
64
64
@@ -72,7 +72,7 @@ def test_dg_examples():
72
72
73
73
x = sp .Symbol ("x" )
74
74
y = sp .Symbol ("y" )
75
- test_func = MyTestFunction (10 * x + 3 * y / np .sqrt (3 ), symbols = (x , y ))
75
+ test_func = FuseFunction (10 * x + 3 * y / np .sqrt (3 ), symbols = (x , y ))
76
76
77
77
for dof in dg1 .generate ():
78
78
assert any (np .isclose (val , dof .eval (test_func )) for val in dof_vals )
@@ -137,7 +137,7 @@ def test_cg_examples():
137
137
cg1 = construct_cg1 ()
138
138
139
139
x = sp .Symbol ("x" )
140
- test_func = MyTestFunction (2 * x , symbols = (x ,))
140
+ test_func = FuseFunction (2 * x , symbols = (x ,))
141
141
142
142
val_set = set ([- 2 , 2 ])
143
143
@@ -149,7 +149,7 @@ def test_cg_examples():
149
149
150
150
x = sp .Symbol ("x" )
151
151
y = sp .Symbol ("y" )
152
- test_func = MyTestFunction (sp .Matrix ([10 * x , 3 * y / np .sqrt (3 )]), symbols = (x , y ))
152
+ test_func = FuseFunction (sp .Matrix ([10 * x , 3 * y / np .sqrt (3 )]), symbols = (x , y ))
153
153
154
154
dof_vals = np .array ([[- 10 , - 1 ], [0 , 2 ], [10 , - 1 ],
155
155
[- 10 / 3 , 1 ], [- 20 / 3 , 0 ], [10 / 3 , 1 ],
@@ -196,10 +196,10 @@ def test_nd_example():
196
196
x = sp .Symbol ("x" )
197
197
y = sp .Symbol ("y" )
198
198
199
- phi_2 = MyTestFunction (sp .Matrix ([1 / 3 - (np .sqrt (3 )/ 6 )* y , (np .sqrt (3 )/ 6 )* x ]), symbols = (x , y ))
200
- phi_0 = MyTestFunction (sp .Matrix ([- 1 / 6 - (np .sqrt (3 )/ 6 )* y , (- np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ]), symbols = (x , y ))
201
- phi_1 = MyTestFunction (sp .Matrix ([- 1 / 6 - (np .sqrt (3 )/ 6 )* y ,
202
- (np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ]), symbols = (x , y ))
199
+ phi_2 = FuseFunction (sp .Matrix ([1 / 3 - (np .sqrt (3 )/ 6 )* y , (np .sqrt (3 )/ 6 )* x ]), symbols = (x , y ))
200
+ phi_0 = FuseFunction (sp .Matrix ([- 1 / 6 - (np .sqrt (3 )/ 6 )* y , (- np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ]), symbols = (x , y ))
201
+ phi_1 = FuseFunction (sp .Matrix ([- 1 / 6 - (np .sqrt (3 )/ 6 )* y ,
202
+ (np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ]), symbols = (x , y ))
203
203
basis_funcs = [phi_0 , phi_1 , phi_2 ]
204
204
205
205
for dof in ned .generate ():
@@ -236,12 +236,12 @@ def construct_rt(tri=None):
236
236
def test_rt_example ():
237
237
x = sp .Symbol ("x" )
238
238
y = sp .Symbol ("y" )
239
- phi_2 = MyTestFunction (sp .Matrix ([(np .sqrt (3 )/ 6 )* x ,
240
- - 1 / 3 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
241
- phi_0 = MyTestFunction (sp .Matrix ([(- np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ,
242
- 1 / 6 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
243
- phi_1 = MyTestFunction (sp .Matrix ([(np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ,
244
- 1 / 6 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
239
+ phi_2 = FuseFunction (sp .Matrix ([(np .sqrt (3 )/ 6 )* x ,
240
+ - 1 / 3 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
241
+ phi_0 = FuseFunction (sp .Matrix ([(- np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ,
242
+ 1 / 6 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
243
+ phi_1 = FuseFunction (sp .Matrix ([(np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ,
244
+ 1 / 6 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
245
245
246
246
rt = construct_rt ()
247
247
@@ -282,7 +282,7 @@ def test_hermite_example():
282
282
# TODO improve this test
283
283
x = sp .Symbol ("x" )
284
284
y = sp .Symbol ("y" )
285
- phi_0 = MyTestFunction (x ** 2 + 3 * y ** 3 + 4 * x * y , symbols = (x , y ))
285
+ phi_0 = FuseFunction (x ** 2 + 3 * y ** 3 + 4 * x * y , symbols = (x , y ))
286
286
ls = her .generate ()
287
287
print ("num dofs " , her .num_dofs ())
288
288
for dof in ls :
@@ -317,7 +317,7 @@ def test_square_cg():
317
317
[v_dofs , e_dofs , i_dofs ])
318
318
x = sp .Symbol ("x" )
319
319
y = sp .Symbol ("y" )
320
- test_func = MyTestFunction (x ** 2 + y ** 2 , symbols = (x , y ))
320
+ test_func = FuseFunction (x ** 2 + y ** 2 , symbols = (x , y ))
321
321
322
322
dof_vals = np .array ([0 , 1 , 2 ])
323
323
for dof in cg3 .generate ():
@@ -344,8 +344,8 @@ def test_rt_second_order():
344
344
vecP3 = PolynomialSpace (3 , set_shape = True )
345
345
rt2 = ElementTriple (tri , (vecP3 , CellHDiv , C0 ), [tri_dofs , i_dofs ])
346
346
347
- phi = MyTestFunction (sp .Matrix ([(np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ,
348
- 1 / 6 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
347
+ phi = FuseFunction (sp .Matrix ([(np .sqrt (3 )/ 6 ) + (np .sqrt (3 )/ 6 )* x ,
348
+ 1 / 6 + (np .sqrt (3 )/ 6 )* y ]), symbols = (x , y ))
349
349
350
350
for dof in rt2 .generate ():
351
351
dof .eval (phi )
0 commit comments