Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages

◆ compute_point_neighbors()

void pism::Grid::compute_point_neighbors ( double  X,
double  Y,
int &  i_left,
int &  i_right,
int &  j_bottom,
int &  j_top 
) const

Computes indices of grid points to the lower left and upper right from (X,Y).

3 2
o-------o
| |
| + |
o-------o
0 1

If "+" is the point (X,Y), then (i_left, j_bottom) corresponds to point "0" and (i_right, j_top) corresponds to point "2".

Does not check if the resulting indexes are in the current processor's domain. Ensures that computed indexes are within the grid.

Definition at line 601 of file Grid.cc.

References pism::Grid::Impl::dx, pism::Grid::Impl::dy, m_impl, pism::array::max(), pism::array::min(), pism::Grid::Impl::Mx, pism::Grid::Impl::My, pism::Grid::Impl::x, and pism::Grid::Impl::y.

Referenced by interpolation_weights(), and point_neighbors().