diff --git a/ngsPETSc/utils/firedrake/meshes.py b/ngsPETSc/utils/firedrake/meshes.py index c6cb755..4fc10a9 100644 --- a/ngsPETSc/utils/firedrake/meshes.py +++ b/ngsPETSc/utils/firedrake/meshes.py @@ -11,12 +11,7 @@ import numpy as np from petsc4py import PETSc - -try: - from scipy.spatial.distance import cdist - HAVE_SCIPY = True -except ImportError: - HAVE_SCIPY = False +from scipy.spatial.distance import cdist import netgen import netgen.meshing as ngm @@ -77,18 +72,6 @@ def refineMarkedElements(self, mark): raise NotImplementedError("No implementation for dimension other than 2 and 3.") -def _slow_cdist(XA, XB): - dist = np.zeros([len(XA), len(XB)]) - for ii, a in enumerate(XA): - for jj, b in enumerate(XB): - dist[ii, jj] = np.linalg.norm(b - a) - return dist - - -if not HAVE_SCIPY: - cdist = PETSc.Log.EventDecorator()(_slow_cdist) - - @PETSc.Log.EventDecorator() def find_permutation(points_a, points_b, tol=1e-5): """ Find all permutations between a list of two sets of points.