pihmMesh: Generate the PIHM mesh data from the triangulation 'pihmMesh'

Description Usage Arguments Value Examples

View source: R/MeshDomain.R

Description

Generate the PIHM mesh data from the triangulation pihmMesh

Usage

1
pihmMesh(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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 = m.DomainDecomposition(wb=wb.simp,q=q.min, a=a.max)
plot(tri, asp=1)

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

happynotes/PIHMgisR documentation built on Jan. 25, 2020, 9:51 p.m.