gpytoolbox
gpytoolbox copied to clipboard
Upper envelope crashing (maybe only at low resolutions?)
This crashes, and it shouldn't. My current thinking is that the low resolution means there are labels that cause empty regions (e.g., labels with no associated tets). For example, I up-ed the resolution to 10, and that seems to run without issue.
import gpytoolbox, time
import numpy as np
labels = 4
resolution = 5
v, t = gpytoolbox.regular_cube_mesh(resolution)
w = np.zeros((v.shape[0],labels))
for i in range(labels):
p = np.random.rand(3)
print( "Center: ", p )
for j in range(v.shape[0]):
w[j,i] = -np.linalg.norm( v[j] - p )
print("Number of nodes: ", v.shape[0])
print("Number of labels: ", w.shape[1])
time_0 = time.time()
u, g, l = gpytoolbox.upper_envelope(v,t,w)
time_1 = time.time()
print("UE time: ", time_1-time_0)
print("Output tets: " , g.shape[0] )