index_vector2grid: Convert node position to grid x-y position

View source: R/flownet_finitedifferences.R

index_vector2gridR Documentation

Convert node position to grid x-y position

Description

Function takes a vector of node indices (numbered row-wise) and returns a list of their x and y indices.

Usage

index_vector2grid(i, nx, ny, i0 = 0, real_only = FALSE, ...)

Arguments

i

array with node indices

nx, ny

number of real nodes 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 with two fields: 'ix' and 'iy' with indices in x and y directions

Examples

#convert to grid positions
nx <- 4
ny <- 3
i <- seq(1, (nx + 2)*(ny + 2) - 4)
index_vector2grid(i, nx, ny)

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