is_grid_rectangular: Check if series of gridded domains is rectangular

View source: R/flownet_plotting.R

is_grid_rectangularR Documentation

Check if series of gridded domains is rectangular

Description

Check if a flownet solution is given on a rectangular grid, i.e. nodes are organised in horizontal rows and vertical columns. The distances between rows and columns may vary.

For each domain in the grid, the function checks if the number of nodes is equal to the product of unique x and y-positions. If this is true for all domains, the grid is regular and the function returns 'TRUE'.

Usage

is_grid_rectangular(dp)

Arguments

dp

tibble with flow net solution. Should contain fields 'x' and 'y' for positions of the nodes

Value

'TRUE' is the grid is rectangular, 'FALSE' is not

Examples

#rectangular grid
df <- flownet_geometry_rectangular()
dp <- flownet_solve_rectangular(df)
is_grid_rectangular(dp)

#quadrilateral grid
df <- flownet_geometry_quadrilateral()
dp <- flownet_solve_quadrilateral(df)
is_grid_rectangular(dp)

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