index_offset: Find indices of neighbouring nodes

View source: R/flownet_finitedifferences.R

index_offsetR Documentation

Find indices of neighbouring nodes

Description

Find indices of neighbouring nodes in a rectangular grid with or without ghost nodes. Nodes are numbered row-wise. Function assumes that these nodes exist, e.g. no check is conducted to see if this is so...

Usage

index_offset(i, nx, ny, dix = 0, diy = 0, i0 = 0, real_only = FALSE, ...)

Arguments

i

array with node indices

nx

number of real nodes in x and y directions

ny

number of real nodes in x and y directions

dix, diy

index offsets in x and y-directions

i0

node index offset

real_only

if 'TRUE', only real nodes are numbered and ghost nodes are ignored in numbering

...

additional arguments to pass

Value

a list of indices of neightbouring nodes

Examples

nx <- 4
ny <- 3
i <- c(1, 11, 20)
index_offset(i, nx, ny, dix = 1)
index_offset(i, nx, ny, diy = 1)

GJMeijer/soilmech documentation built on May 22, 2022, 10:39 a.m.