Skip to content

Commit

Permalink
Adding more crumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Nov 22, 2023
1 parent c13885a commit 4a269e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion armi/reactor/grids/structuredgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ def restoreBackup(self):
self._unitSteps, self._bounds, self._offset = self._backup

def getCoordinates(self, indices, nativeCoords=False) -> numpy.ndarray:
"""Return the coordinates of the center of the mesh cell at the given given indices in cm."""
"""Return the coordinates of the center of the mesh cell at the given given indices in cm.
.. test:: Get the coordinates from a location in a grid.
:id: T_ARMI_GRID_GLOBAL_POS
:tests: R_ARMI_GRID_GLOBAL_POS
"""
indices = numpy.array(indices)
return self._evaluateMesh(
indices, self._centroidBySteps, self._centroidByBounds
Expand Down
4 changes: 4 additions & 0 deletions armi/reactor/grids/tests/test_grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ def test_adjustPitch(self):
.. test:: Construct a hexagonal lattice with three rings.
:id: T_ARMI_GRID_HEX
:tests: R_ARMI_GRID_HEX
.. test:: Return the grid coordinates of different locations.
:id: T_ARMI_GRID_GLOBAL_POS0
:tests: R_ARMI_GRID_GLOBAL_POS
"""
grid = grids.HexGrid.fromPitch(1.0, numRings=3)
v1 = grid.getCoordinates((1, 0, 0))
Expand Down

0 comments on commit 4a269e4

Please sign in to comment.