generate.1d.mesh: Create 1d mesh from observation locations.

View source: R/mesh.generation.R

generate.1d.meshR Documentation

Create 1d mesh from observation locations.

Description

A function to create mesh for 1d FEM discretization.

Usage

generate.1d.mesh(
  x,
  max.dist,
  cutoff = 1e-10,
  extend = NULL,
  Y = NULL,
  loc.Y = NULL,
  max.dY = -1,
  nJump = 3,
  fix.differences = TRUE
)

Arguments

x

A list of measurement locations.

max.dist

The largest distance between nodes in the mesh

cutoff

Merge nodes in x that are closer than cutoff

Details

This is a supplementary function to be used internally by other functions.

Value

Returns a list with mesh nodes, distances, and number of nodes.

See Also

create_matrices_Matern, create_matrices_FD2

Examples

  ## Not run: 
  x = c(0,0.05,0.2,0.25,0.5,0.7,0.8,0.95,0.99,1)
  x <- 2*sort(runif(n))
  m <- generate.1d.mesh(x,max.dist = 0.2,cutoff = 0.1)
 plot(x,0*x)
 points(m$s,0*m$s,pch=4,col=2)
  
## End(Not run)


davidbolin/ngme documentation built on Dec. 5, 2023, 11:48 p.m.