예제 #1
0
 /// <summary>
 /// Returns the index of the nearest point in the grid.
 /// Assumes the point is within the bounds of the grid.
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public int IndexAtUnchecked(Vec3d point)
 {
     (int i, int j, int k) = IndicesAt(point);
     return(GridUtil.FlattenIndices(i, j, k, _nx, _nxy));
 }
예제 #2
0
 /// <summary>
 /// Expands a 1 dimensional index into a 3 dimensional index.
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 public (int, int, int) IndicesAt(int index)
 {
     return(GridUtil.ExpandIndex(index, _nx, _nxy));
 }
예제 #3
0
 /// <summary>
 /// Flattens a 3 dimensional index into a 1 dimensional index.
 /// Assumes the given indices are within the valid range.
 /// </summary>
 /// <param name="i"></param>
 /// <param name="j"></param>
 /// <param name="k"></param>
 /// <returns></returns>
 public int IndexAtUnchecked(int i, int j, int k)
 {
     return(GridUtil.FlattenIndices(i, j, k, _nx, _nxy));
 }
예제 #4
0
 /// <summary>
 /// Returns the index of the nearest point in the grid.
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public int IndexAt(Vec3d point)
 {
     (int i, int j, int k) = IndicesAt(point);
     return(GridUtil.FlattenIndices(WrapX(i), WrapY(j), WrapZ(k), _nx, _nxy));
 }
예제 #5
0
 /// <summary>
 /// Applies a wrap function to the given index based on the current wrap mode.
 /// </summary>
 /// <param name="k"></param>
 /// <returns></returns>
 public int WrapZ(int k)
 {
     return(GridUtil.Wrap(k, _nz, _wrapModeZ));
 }
예제 #6
0
 /// <summary>
 /// Flattens a 3 dimensional index into a 1 dimensional index.
 /// </summary>
 /// <param name="i"></param>
 /// <param name="j"></param>
 /// <param name="k"></param>
 /// <returns></returns>
 public int IndexAt(int i, int j, int k)
 {
     return(GridUtil.FlattenIndices(WrapX(i), WrapY(j), WrapZ(k), _nx, _nxy));
 }
예제 #7
0
 /// <summary>
 /// Applies a wrap function to the given index based on the current wrap mode.
 /// </summary>
 /// <param name="i"></param>
 /// <returns></returns>
 public int WrapX(int i)
 {
     return(GridUtil.Wrap(i, _nx, _wrapModeX));
 }
예제 #8
0
 /// <summary>
 /// Applies a wrap function to the given index based on the current wrap mode.
 /// </summary>
 /// <param name="j"></param>
 /// <returns></returns>
 public int WrapY(int j)
 {
     return(GridUtil.Wrap(j, _ny, _wrapModeY));
 }
예제 #9
0
 /// <summary>
 /// Expands a 1 dimensional index into a 2 dimensional index.
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 public (int i, int j) IndicesAt(int index)
 {
     return(GridUtil.ExpandIndex(index, _nx));
 }
예제 #10
0
 /// <summary>
 /// Returns the index of the nearest point in the grid.
 /// Assumes the point is within the bounds of the grid.
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public int IndexAtUnsafe(Vec2d point)
 {
     (int i, int j) = IndicesAt(point);
     return(GridUtil.FlattenIndices(i, j, _nx));
 }
예제 #11
0
 /// <summary>
 /// Returns the index of the nearest point in the grid.
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public int IndexAt(Vec2d point)
 {
     (int i, int j) = IndicesAt(point);
     return(GridUtil.FlattenIndices(WrapX(i), WrapY(j), _nx));
 }
예제 #12
0
 /// <summary>
 /// Flattens a 2 dimensional index into a 1 dimensional index.
 /// Assumes the given indices are within the valid range.
 /// </summary>
 /// <param name="i"></param>
 /// <param name="j"></param>
 /// <returns></returns>
 public int IndexAtUnsafe(int i, int j)
 {
     return(GridUtil.FlattenIndices(i, j, _nx));
 }
예제 #13
0
 /// <summary>
 /// Flattens a 2 dimensional index into a 1 dimensional index.
 /// Applies the current wrap mode to the given indices.
 /// </summary>
 /// <param name="i"></param>
 /// <param name="j"></param>
 /// <returns></returns>
 public int IndexAt(int i, int j)
 {
     return(GridUtil.FlattenIndices(WrapX(i), WrapY(j), _nx));
 }