diff --git a/src/underworld3/discretisation.py b/src/underworld3/discretisation.py index 40be63bd7..9e1ad0410 100644 --- a/src/underworld3/discretisation.py +++ b/src/underworld3/discretisation.py @@ -1946,13 +1946,13 @@ def _mark_local_boundary_faces_inside_and_out(self): for pt in range(0, face_num_points): outside_control_point = ( - 1e-8 * normal + 0.8 * points[pt] + 0.2 * face_centroid + 1e-8 * normal + 0.8 * point_coords[pt] + 0.2 * face_centroid ) control_points_list.append(outside_control_point) control_point_sign_list.append(-1) inside_control_point = ( - -1e-8 * normal + 0.8 * points[pt] + 0.2 * face_centroid + -1e-8 * normal + 0.8 * point_coords[pt] + 0.2 * face_centroid ) control_points_list.append(inside_control_point) control_point_sign_list.append(1) @@ -2098,7 +2098,7 @@ def get_closest_local_cells(self, coords: numpy.ndarray) -> numpy.ndarray: # Part 2 - try to find the lost points by walking nearby cells - num_local_cells = self._centroid_index.n + num_local_cells = self._centroids.shape[0] num_testable_neighbours = min(num_local_cells, 50) dist2, closest_centroids = self._centroid_index.query( diff --git a/src/underworld3/function/_function.pyx b/src/underworld3/function/_function.pyx index 24dc9fa45..c3a4399e2 100644 --- a/src/underworld3/function/_function.pyx +++ b/src/underworld3/function/_function.pyx @@ -278,6 +278,7 @@ def evaluate( expr, mesh, simplify=simplify, verbose=verbose, ) + evaluation_interior = np.atleast_1d(evaluation_interior) # handle case where there is only 1 interior point if np.count_nonzero(in_or_not == False) > 0: evaluation_exterior = rbf_evaluate( expr, @@ -297,7 +298,7 @@ def evaluate( expr, evaluation[in_or_not] = evaluation_interior evaluation[~in_or_not] = evaluation_exterior - + evaluation = evaluation.squeeze() # consistent behavior with mesh is None and only 1 coord input return evaluation diff --git a/src/underworld3/swarm.py b/src/underworld3/swarm.py index 70bda4e15..479382aa6 100644 --- a/src/underworld3/swarm.py +++ b/src/underworld3/swarm.py @@ -726,7 +726,7 @@ def _update(self): kd_swarm = uw.kdtree.KDTree(self.swarm.particle_coordinates.data) # n, d, b = kd_swarm.find_closest_point(self._meshLevelSetVars[0].coords) d, n = kd_swarm.query( - self._meshLevelSetVars[0].coords, k=1, sqr_dist=True + self._meshLevelSetVars[0].coords, k=1, sqr_dists=True ) for ii in range(self.indices): @@ -763,7 +763,7 @@ def _update(self): with self.swarm.access(): kd = uw.kdtree.KDTree(self.swarm.particle_coordinates.data) n_distance, n_indices = kd.query( - self._meshLevelSetVars[0].coords, k=self.nnn, sqr_dist=True + self._meshLevelSetVars[0].coords, k=self.nnn, sqr_dists=True ) for ii in range(self.indices):