PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches

◆ 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 425 of file Grid.cc.

References pism::grid::DistributedGridInfo::dx, pism::grid::DistributedGridInfo::dy, m_impl, pism::grid::DistributedGridInfo::Mx, pism::grid::DistributedGridInfo::My, pism::grid::GridInfo::x, and pism::grid::GridInfo::y.

Referenced by interpolation_weights(), and point_neighbors().