index_edge: Get indices of nodes near edge of grid

View source: R/flownet_finitedifferences.R

index_edgeR Documentation

Get indices of nodes near edge of grid

Description

Get an array of the indices of nodes near an edge of a rectangular grid. For node numbering, see function 'findiff_sparse_elements()'.

Usage

index_edge(nx, ny, edge, real_only = FALSE, i0 = 0, offset = 0, ...)

Arguments

nx, ny

number of real nodes in x and y-direction

edge

edge number, numbered clockwise. '1' for left (negative x-face), '2' for top (positive y-face), '3' for right (positive x-face) and '4' for bottom (negative y-face)

real_only

if 'TRUE', only real nodes are numbered. if 'FALSE', all ghost nodes are included in the numbering as well

i0

node starting number (index of first node minus 1)

offset

row (in case 'edge = 2' or 'edge = 4', or column (in case 'edge = 1' or 'edge = 3') offset from edge

...

additional optional arguments

Value

array of indices of ghost nodes on selected edge

Examples

#real nodes + ghost nodes
index_edge(4, 3, 1)
index_edge(4, 3, 2, offset = 1)

#real nodes only
index_edge(4, 3, 1, real_only = TRUE)
index_edge(4, 3, 2, offset = 1, real_only = TRUE)

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