FEM: Define a surface or spatial field by a Finite Element basis...

Description Usage Arguments Value Examples

View source: R/FEMobjects.R

Description

This function defines a FEM object.

Usage

1
FEM(coeff,FEMbasis)

Arguments

coeff

A vector or a matrix containing the coefficients for the Finite Element basis expansion. The number of rows (or the vector's length) corresponds to the number of basis in FEMbasis. The number of columns corresponds to the number of functions.

FEMbasis

A FEMbasis object defining the Finite Element basis, created by create.FEM.basis.

Value

An FEM object. This contains a list with components coeff and FEMbasis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(fdaPDE)
## Upload the horseshoe2D data
data(horseshoe2D)
boundary_nodes = horseshoe2D$boundary_nodes
boundary_segments = horseshoe2D$boundary_segments
locations = horseshoe2D$locations

## Create the 2D mesh
mesh = create.mesh.2D(nodes = rbind(boundary_nodes, locations), segments = boundary_segments)
## Create the FEM basis
FEMbasis = create.FEM.basis(mesh)
## Compute the coeff vector evaluating the desired function at the mesh nodes
## In this case we consider the fs.test() function introduced by Wood et al. 2008
coeff = fs.test(mesh$nodes[,1], mesh$nodes[,2])
## Create the FEM object
FEMfunction = FEM(coeff, FEMbasis)
## Plot it
plot(FEMfunction)

Example output

Loading required package: geometry
Loading required package: rgl
Loading required package: Matrix
Loading required package: plot3D
Loading required package: plot3Drgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
3: no DISPLAY variable so Tk is not available 

fdaPDE documentation built on July 2, 2020, 2:22 a.m.