@@ -45,7 +45,7 @@ def add_norm_constraints(self, w=1.0):
4545 points = self .get_norm_constraints ()
4646 if points .shape [0 ] > 0 :
4747 grad , elements , inside = self .support .evaluate_shape_derivatives (points [:, :3 ])
48- size = self .support .element_size [elements [inside ]]
48+ size = self .support .element_scale [elements [inside ]]
4949 wt = np .ones (size .shape [0 ])
5050 wt *= w # s* size
5151 elements = np .tile (self .support .elements [elements [inside ]], (3 , 1 , 1 ))
@@ -70,6 +70,7 @@ def add_value_constraints(self, w=1.0):
7070 if points .shape [0 ] > 1 :
7171 N , elements , inside = self .support .evaluate_shape (points [:, :3 ])
7272 size = self .support .element_size [elements [inside ]]
73+
7374 wt = np .ones (size .shape [0 ])
7475 wt *= w # * size
7576 self .add_constraints_to_least_squares (
@@ -110,13 +111,16 @@ def minimise_edge_jumps(self, w=0.1, vector_func=None, vector=None, name="edge j
110111 const_n = - np .einsum ("ij,ijk->ik" , norm , Dn )
111112 # const_t_cp2 = np.einsum('ij,ikj->ik',normal,cp2_Dt)
112113 # const_n_cp2 = -np.einsum('ij,ikj->ik',normal,cp2_Dn)
113-
114+ # shared_element_size = self.support.shared_element_size
115+ # const_t /= shared_element_size[:, None] # normalise by element size
116+ # const_n /= shared_element_size[:, None] # normalise by element size
114117 const = np .hstack ([const_t , const_n ])
115118
116119 # get vertex indexes
117120 tri_cp1 = np .hstack ([self .support .elements [tri1 ], self .support .elements [tri2 ]])
118121 # tri_cp2 = np.hstack([self.support.elements[cp2_tri1],self.support.elements[tri2]])
119122 # add cp1 and cp2 to the least squares system
123+
120124 self .add_constraints_to_least_squares (
121125 const ,
122126 np .zeros (const .shape [0 ]),
0 commit comments