@@ -17,6 +17,9 @@ class VFFD(CFFD):
1717 '''
1818 Class that handles the Volumetric Free Form Deformation on the mesh points.
1919
20+ :param list n_control_points: number of control points in the x, y, and z
21+ direction. Default is [2, 2, 2].
22+
2023 :param list n_control_points: number of control points in the x, y, and z
2124 direction. Default is [2, 2, 2].
2225
@@ -34,12 +37,16 @@ class VFFD(CFFD):
3437 y, normalized with the box length y.
3538 :cvar numpy.ndarray array_mu_z: collects the displacements (weights) along
3639 z, normalized with the box length z.
37- :cvar callable linconstraint: it defines the F of the constraint F(x)=c.
38- :cvar numpy.ndarray valconstraint: it defines the c of the constraint F(x)=c.
39- :cvar list indices: it defines the indices of the control points
40- that are moved to enforce the constraint. The control index is obtained by doing:
41- all_indices=np.arange(n_x*n_y*n_z*3).reshape(n_x,n_y,n_z,3).tolist().
42- :cvar numpy.ndarray M: a SDP weigth matrix. It must be of size len(indices) x len(indices).
40+ :cvar callable fun: it defines the F of the constraint F(x)=c. Default is the constant 1 function.
41+ :cvar numpy.ndarray fixval: it defines the c of the constraint F(x)=c. Default is 1.
42+ :cvar numpy.ndarray mask: a boolean tensor that tells to the class
43+ which control points can be moved, and in what direction, to enforce the constraint.
44+ The tensor has shape (n_x,n_y,n_z,3), where the last dimension indicates movement
45+ on x,y,z respectively. Default is all true.
46+ :cvar numpy.ndarray weight_matrix: a symmetric positive definite weigth matrix.
47+ It must be of row and column size the number of trues in the mask.
48+ It weights the movemement of the control points which have a true flag in the mask.
49+ Default is identity.
4350 :cvar np.ndarray vweight: specifies the weight of every step of the volume enforcement.
4451
4552 :Example:
@@ -59,8 +66,8 @@ class VFFD(CFFD):
5966 >>> new_mesh_points = vffd(original_mesh_points)
6067 >>> assert np.isclose(np.linalg.norm(vffd.linconstraint(new_mesh_points)-b),np.array([0.]))
6168 '''
62- def __init__ (self , triangles , n_control_points = None ):
63- super ().__init__ (n_control_points )
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 )
6471 self .triangles = triangles
6572 self .vweight = [1 / 3 , 1 / 3 , 1 / 3 ]
6673
0 commit comments