Skip to content

Commit fcadfd3

Browse files
AxMeNilachlangrose
authored andcommitted
Update _3d_base_structured.py
1 parent f7be245 commit fcadfd3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

LoopStructural/interpolators/supports/_3d_base_structured.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,22 @@ def cell_corner_indexes(self, cell_indexes: np.ndarray) -> np.ndarray:
373373
return corner_indexes
374374

375375
def position_to_cell_corners(self, pos):
376+
"""Get the global indices of the vertices (corners) of the cell containing each point.
377+
378+
Parameters
379+
----------
380+
pos : np.array
381+
(N, 3) array of xyz coordinates representing the positions of N points.
382+
383+
Returns
384+
-------
385+
globalidx : np.array
386+
(N, 8) array of global indices corresponding to the 8 corner nodes of the cell
387+
each point lies in. If a point lies outside the support, its corresponding entry
388+
will be set to -1.
389+
inside : np.array
390+
(N,) boolean array indicating whether each point is inside the support domain.
391+
"""
376392
cell_indexes, inside = self.position_to_cell_index(pos)
377393
corner_indexes = self.cell_corner_indexes(cell_indexes)
378394
globalidx = self.global_node_indices(corner_indexes)

0 commit comments

Comments
 (0)