@@ -618,7 +618,7 @@ def test_nedelec_spatial(order, dim):
618
618
# The expression (x,y,z) is contained in the N1curl function space
619
619
# order>1
620
620
f_ex = x
621
- f = Expression (f_ex , V .element .interpolation_points () )
621
+ f = Expression (f_ex , V .element .interpolation_points )
622
622
u .interpolate (f )
623
623
assert np .abs (assemble_scalar (form (ufl .inner (u - f_ex , u - f_ex ) * ufl .dx ))) == pytest .approx (
624
624
0 , abs = 1e-10
@@ -628,7 +628,7 @@ def test_nedelec_spatial(order, dim):
628
628
# order
629
629
V2 = functionspace (mesh , ("N2curl" , 1 ))
630
630
w = Function (V2 )
631
- f2 = Expression (f_ex , V2 .element .interpolation_points () )
631
+ f2 = Expression (f_ex , V2 .element .interpolation_points )
632
632
w .interpolate (f2 )
633
633
assert np .abs (assemble_scalar (form (ufl .inner (w - f_ex , w - f_ex ) * ufl .dx ))) == pytest .approx (0 )
634
634
@@ -650,7 +650,7 @@ def test_vector_interpolation_spatial(order, dim, affine):
650
650
651
651
# The expression (x,y,z)^n is contained in space
652
652
f = ufl .as_vector ([x [i ] ** order for i in range (dim )])
653
- u .interpolate (Expression (f , V .element .interpolation_points () ))
653
+ u .interpolate (Expression (f , V .element .interpolation_points ))
654
654
assert np .abs (assemble_scalar (form (ufl .inner (u - f , u - f ) * ufl .dx ))) == pytest .approx (0 )
655
655
656
656
@@ -663,7 +663,7 @@ def test_2D_lagrange_to_curl(order):
663
663
u1 = Function (W )
664
664
u1 .interpolate (lambda x : x [0 ])
665
665
f = ufl .as_vector ((u0 , u1 ))
666
- f_expr = Expression (f , V .element .interpolation_points () )
666
+ f_expr = Expression (f , V .element .interpolation_points )
667
667
u .interpolate (f_expr )
668
668
x = ufl .SpatialCoordinate (mesh )
669
669
f_ex = ufl .as_vector ((- x [1 ], x [0 ]))
@@ -679,7 +679,7 @@ def test_de_rahm_2D(order):
679
679
g = ufl .grad (w )
680
680
Q = functionspace (mesh , ("N2curl" , order - 1 ))
681
681
q = Function (Q )
682
- q .interpolate (Expression (g , Q .element .interpolation_points () ))
682
+ q .interpolate (Expression (g , Q .element .interpolation_points ))
683
683
x = ufl .SpatialCoordinate (mesh )
684
684
g_ex = ufl .as_vector ((1 + x [1 ], 4 * x [1 ] + x [0 ]))
685
685
assert np .abs (assemble_scalar (form (ufl .inner (q - g_ex , q - g_ex ) * ufl .dx ))) == pytest .approx (
@@ -692,7 +692,7 @@ def test_de_rahm_2D(order):
692
692
def curl2D (u ):
693
693
return ufl .as_vector ((ufl .Dx (u [1 ], 0 ), - ufl .Dx (u [0 ], 1 )))
694
694
695
- v .interpolate (Expression (curl2D (ufl .grad (w )), V .element .interpolation_points () ))
695
+ v .interpolate (Expression (curl2D (ufl .grad (w )), V .element .interpolation_points ))
696
696
h_ex = ufl .as_vector ((1 , - 1 ))
697
697
assert np .abs (assemble_scalar (form (ufl .inner (v - h_ex , v - h_ex ) * ufl .dx ))) == pytest .approx (
698
698
0 , abs = np .sqrt (np .finfo (mesh .geometry .x .dtype ).eps )
@@ -720,7 +720,7 @@ def test_interpolate_subset(order, dim, affine, callable_):
720
720
x = ufl .SpatialCoordinate (mesh )
721
721
f = x [1 ] ** order
722
722
if not callable_ :
723
- expr = Expression (f , V .element .interpolation_points () )
723
+ expr = Expression (f , V .element .interpolation_points )
724
724
u .interpolate (expr , cells_local )
725
725
else :
726
726
u .interpolate (lambda x : x [1 ] ** order , cells_local )
@@ -760,7 +760,7 @@ def test_interpolate_callable_subset(bound):
760
760
u0 , u1 = Function (V ), Function (V )
761
761
x = ufl .SpatialCoordinate (mesh )
762
762
f = x [0 ]
763
- expr = Expression (f , V .element .interpolation_points () )
763
+ expr = Expression (f , V .element .interpolation_points )
764
764
u0 .interpolate (lambda x : x [0 ], cells_local )
765
765
u1 .interpolate (expr , cells_local )
766
766
assert np .allclose (u0 .x .array , u1 .x .array , rtol = 1.0e-6 , atol = 1.0e-6 )
@@ -1114,7 +1114,7 @@ def modified_grad(x):
1114
1114
V_sub = functionspace (submesh , ("N2curl" , 1 ))
1115
1115
u_sub = Function (V_sub )
1116
1116
1117
- parent_expr = Expression (ufl .grad (u ), V_sub .element .interpolation_points () )
1117
+ parent_expr = Expression (ufl .grad (u ), V_sub .element .interpolation_points )
1118
1118
1119
1119
# Map from parent to sub mesh
1120
1120
@@ -1136,7 +1136,7 @@ def modified_grad(x):
1136
1136
1137
1137
# Map exact solution (based on quadrature points) back to parent mesh
1138
1138
sub_vec = ufl .as_vector ((- 0.2 * u_sub_exact [1 ], 0.1 * u_sub_exact [0 ]))
1139
- sub_expr = Expression (sub_vec , W .element .interpolation_points () )
1139
+ sub_expr = Expression (sub_vec , W .element .interpolation_points )
1140
1140
1141
1141
# Mapping back needs to be restricted to the subset of cells in the submesh
1142
1142
w .interpolate (sub_expr , cells = sub_to_parent , expr_mesh = submesh , cell_map = parent_to_sub )
0 commit comments