Skip to content

Commit 8a2ec05

Browse files
AxMeNilachlangrose
authored andcommitted
Update _2d_structured_grid.py
1 parent fcadfd3 commit 8a2ec05

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

LoopStructural/interpolators/supports/_2d_structured_grid.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,22 @@ def node_indexes_to_position(self, node_indexes: np.ndarray) -> np.ndarray:
372372
return xy
373373

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

0 commit comments

Comments
 (0)