bdry2Dgmsh: Export polygon points (vertices) to a gmsh .geo file

Description Usage Arguments Details Value Examples

View source: R/bdry2Dgmsh.R

Description

Export polygon points (vertices) to a gmsh .geo file

Usage

1
bdry2Dgmsh(x, cl = 0.1, file = "dfnBdry.geo", idStart = 1, add = FALSE)

Arguments

x

2-columns table (data.frame, matrix, array). The first column are the x coordinates and the 2nd column the y coordinates of the open polygon.

cl

Numeric scalar. Characteristic length of gmsh. It tunes up the meshing.

file

The name of the exported .geo file.

idStart

Non-negative integer scalar. This value is the first identification number (ID) for the geometric elements to be written to file.

add

This helps to save the DFN.geo to a file

Details

The polygonal boundary does not need to enclose all the gmsh elements; but the meshing will only be made inside the polygon. See examples.

Value

If add, a file named <file>.

Examples

1
2
3
4
5
6
7
8
9
x <- cbind(x = c(0,6,6,0), y = c(0,0,3, 3))
plot(x, type='l', col = 'blue')
# write boundary to file in the current working directory
bdry2Dgmsh(x)

# Another saving-to-file example
bdry2Dgmsh(x, idStart = 10001)
write('// This is another file', file = "newBdry.geo")
bdry2Dgmsh(x, file = 'newBdry.geo', add = TRUE)

mathphysmx/gmshR documentation built on May 7, 2019, 1:25 p.m.