Skip to content

Commit 02a4d70

Browse files
committed
fix: all tests passing
1 parent eafdef7 commit 02a4d70

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

LoopStructural/interpolators/supports/_3d_structured_grid.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ def position_to_dof_coefs(self, pos):
141141
weights = self.trilinear(x_local, y_local, local_z)
142142
return weights
143143

144-
145-
146144
def neighbour_global_indexes(self, mask=None, **kwargs):
147145
"""
148146
Get neighbour indexes
@@ -458,8 +456,11 @@ def get_element_for_location(self, pos):
458456
[description]
459457
"""
460458
vertices, inside = self.position_to_cell_vertices(pos)
459+
vertices = np.array(vertices)
460+
vertices = vertices.reshape((vertices.shape[1], 8, 3))
461461
elements, inside = self.position_to_cell_corners(pos)
462462
a = self.position_to_dof_coefs(pos)
463463
return vertices, a.T, elements, inside
464+
464465
def get_elements(self):
465-
return
466+
return

tests/unit/interpolator/test_discrete_supports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ def test_evaluate_gradient2(support_class):
9696
def test_get_element(support):
9797
point = support.barycentre[[0], :]
9898
vertices, dof, idc, inside = support.get_element_for_location(point)
99-
print(vertices)
99+
# vertices = vertices.reshape(-1, 3)
100100
bary = np.mean(vertices, axis=1)
101-
assert np.sum(point - bary) == 0
101+
assert np.isclose(np.sum(point - bary), 0)
102102

103103

104104
def test_global_to_local_coordinates():

0 commit comments

Comments
 (0)