dfn2geo: Line Segments to gmsh .geo format export

Description Usage Arguments Details Value Examples

View source: R/dfn2geo.R

Description

Line Segments to gmsh .geo format export

Usage

1
dfn2geo(x, cl = 0.1, file = "dfn.geo", idStart = 1, add = FALSE)

Arguments

x

data frame of line segments ends coordinates.

cl

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

file

The name of the (possibly 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

To mesh the .geo files in the examples, see exportDfn2geo. To view this .geo <file> in gmsh software, go to the directory, then run in the terminal gmsh <fileWithExtension>.

Value

If add, a file named <file>.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(dfn)
plot(x = NA, xlim= c(0,5), ylim = c(0,3))
segments(dfn$x0, dfn$y0, dfn$x1, dfn$y1, col = 'blue')
# write to file in the current working directory
dfn2geo(x = dfn)

# Another saving-to-file example
dfn2geo(x = dfn, idStart = 3)
write('// This is another file', file = "new.geo")
dfn2geo(x = dfn, file = 'new.geo', add = TRUE)

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