t2d: Initialise a TELEMAC-2D project

Description Usage Arguments Details Value Examples

View source: R/t2d.R

Description

Initialises a project for 2-dimensional hydrodynamic modelling with TELEMAC-2D.

Usage

1
2
3
4
t2d(title = "", wdir = ".", cas, geo, cli, res = NULL, opt = NULL, exec = NULL)

## S3 method for class 't2d'
print(x, ...)

Arguments

title

character string giving the title of the project (argument TITLE in the steering file).

wdir

character string, the project directory were inputs and outputs will be written to. TELEMAC-2D's input filenames must be relative to this directory! Default: current working directory.

cas

Passed to cas (preferably a t2d_cas) object).

geo

Passed to geo (preferably a t2d_geo) object).

cli

Passed to cli (preferably a t2d_cli) object).

res

Passed to results. Can be the name of an existing results file or left empty at the beginning in which case an empty template object will be generated.

opt

Object of class t2d_opt (if any; default: NULL).

exec

character string specifying the TELEMAC-2D executable (system command). Default: NULL. Only required for simulate_t2d to work.

x

An object of class t2d.

...

Optional arguments passed to print methods.

Details

First, make sure TELEMAC-2D is installed and works!

Value

An object of class t2d, that is a list with elements title, wdir, exec, cas, geo, cli, res, and opt. The latter five are objects of type t2d_*.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(sf)
library(raster)

# template setup with example data
bnd <- st_read(system.file("dem/boundary_lagos.gpkg", package = "telemac"))
dem_rast <- raster(system.file("dem/dem_merit_lagos.tif", package = "telemac"))
tin_obj <- tin(list(boundary = bnd), s = 90, a = 100^2, q = 30)
geo_obj <- geo(tin_obj, dem = dem_rast)
cli_obj <- cli(geo_obj)
cas_obj <- cas()

# TELEMAC-2D setup
t2d_obj <- t2d("Test setup", "path/to/wdir",
               cas = cas_obj, geo = geo_obj, cli = cli_obj)
t2d_obj

telemac documentation built on Feb. 19, 2021, 5:08 p.m.