PISM, A Parallel Ice Sheet Model  stable v2.0.6 committed by Constantine Khrulev on 2023-01-23 15:14:38 -0900

◆ compute_point_neighbors() [2/2]

void pism::IceGrid::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
| |
| + |
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 770 of file IceGrid.cc.

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

Referenced by compute_interp_weights(), and compute_point_neighbors().