shud.mesh: Generate the mesh data from the triangulation 'shud.mesh'

View source: R/MeshDomain.R

shud.meshR Documentation

Generate the mesh data from the triangulation shud.mesh

Description

Generate the mesh data from the triangulation shud.mesh

Usage

shud.mesh(tri, dem, AqDepth = 10, r.aq = dem * 0 + AqDepth)

Arguments

tri

Triangles defination

dem

Elevation. Projection of the DEM raster must be same as watershed boundary.

AqDepth

Aquifer depth, numeric.

r.aq

Aquifer Thickness. Raster object

Value

Triangle mesh of model domain.

Examples

library(raster)
data(sac)
wbd=sac[['wbd']]
dem=sac[['dem']]
a.max = 1e6 * 1;
q.min = 33;
tol.riv = 200
tol.wb = 200
tol.len = 500
AqDepth = 10

wbbuf = rgeos::gBuffer(wbd, width = 2000)
dem = raster::crop(dem, wbbuf)

wb.dis = rgeos::gUnionCascaded(wbd)
wb.simp = rgeos::gSimplify(wb.dis, tol=tol.wb, topologyPreserve = TRUE)


tri = shud.triangle(wb=wb.simp,q=q.min, a=a.max)
plot(tri, asp=1)

# generate SHUD .mesh
pm=shud.mesh(tri,dem=dem, AqDepth = AqDepth)
sm = sp.mesh2Shape(pm)
raster::plot(sm)

SHUD-System/SHUDtoolbox documentation built on Nov. 27, 2024, 5:54 a.m.