@@ -57,17 +57,16 @@ class VFFD(CFFD):
5757 >>> mesh = meshio.read('tests/test_datasets/test_sphere.stl')
5858 >>> original_mesh_points=mesh.points
5959 >>> triangles = mesh.cells_dict["triangle"]
60- >>> vffd = VFFD(triangles,[2,2,2])
60+ >>> b=np.random.rand()
61+ >>> vffd = VFFD(triangles,[2,2,2],b)
6162 >>> vffd.read_parameters('tests/test_datasets/parameters_test_ffd_sphere.prm')
62- >>> b=vffd.linconstraint(original_mesh_points)
63- >>> vffd.valconstraint=np.array([b])
64- >>> vffd.indices=np.arange(np.prod(vffd.n_control_points)*3).tolist()
65- >>> vffd.M=np.eye(len(vffd.indices))
63+ >>> vffd.adjust_control_points(original_mesh_points)
6664 >>> new_mesh_points = vffd(original_mesh_points)
67- >>> assert np.isclose(np.linalg.norm(vffd.linconstraint(new_mesh_points)-b),np.array([0.]))
65+ >>> assert np.isclose(np.linalg.norm(vffd.fun(new_mesh_points)-b),np.array([0.]),atol=1e-07)
66+
6867 '''
69- def __init__ (self , triangles , n_control_points = None , fun = None , fixval = None , weight_matrix = None , mask = None ):
70- super ().__init__ (n_control_points ,fun ,fixval ,weight_matrix ,mask )
68+ def __init__ (self , triangles , n_control_points = None , fixval = None , weight_matrix = None , mask = None ):
69+ super ().__init__ (n_control_points ,None ,fixval ,weight_matrix ,mask )
7170 self .triangles = triangles
7271 self .vweight = [1 / 3 , 1 / 3 , 1 / 3 ]
7372
@@ -88,5 +87,4 @@ def adjust_control_points(self, src_pts):
8887 self .weight_matrix = np .eye (np .sum (self .mask .astype (int )))
8988 self .fixval = self .fun (
9089 self .ffd (src_pts )) + self .vweight [i ] * (diffvolume )
91- super ().adjust_control_points (src_pts )
92-
90+ super ().adjust_control_points (src_pts )
0 commit comments