Skip to contents

(...)

Usage

fm_fem(mesh, order = 2, ...)

# S3 method for fm_mesh_1d
fm_fem(mesh, order = 2, ...)

# S3 method for fm_mesh_2d
fm_fem(mesh, order = 2, aniso = NULL, ...)

# S3 method for inla.mesh.1d
fm_fem(mesh, order = 2, ...)

# S3 method for inla.mesh
fm_fem(mesh, order = 2, ...)

Arguments

mesh

inla.mesh object

order

integer

...

Currently unused

aniso

If non-NULL, a list(gamma, v). Calculates anisotropic structure matrices (in addition to the regular) for \(\gamma\) and \(v\) for an anisotropic operator \(\nabla\cdot H \nabla\), where \(H=\gamma I + v v^\top\). Currently (2023-08-05) the fields need to be given per vertex.

Value

fm_fem.fm_mesh_1d: A list with elements c0, c1, g1, g2. When mesh$degree == 2, also g01, g02, and g12.

fm_fem.fm_mesh_2d: A list with elements c0, c1, g1, va, ta, and more if order > 1. When aniso is non-NULL, also g1aniso matrices, etc.

Examples

str(fm_fem(fmexample$mesh))
#> List of 9
#>  $ b1:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:147] 0 0 0 0 0 1 1 1 1 2 ...
#>   .. ..@ j       : int [1:147] 0 1 26 244 256 0 1 2 256 1 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:147] 0.3248 0.2506 0.0245 -0.2576 -0.3424 ...
#>   .. ..@ factors : list()
#>  $ c0:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:298] 0 1 2 3 4 5 6 7 8 9 ...
#>   .. ..@ j       : int [1:298] 0 1 2 3 4 5 6 7 8 9 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:298] 0.558 0.397 0.666 0.427 0.564 ...
#>   .. ..@ factors : list()
#>  $ c1:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:2018] 0 0 0 0 0 1 1 1 1 2 ...
#>   .. ..@ j       : int [1:2018] 0 1 26 244 256 0 1 2 256 1 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:2018] 0.2789 0.0502 0.0458 0.0893 0.0937 ...
#>   .. ..@ factors : list()
#>  $ g1:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:2018] 0 0 0 0 0 1 1 1 1 2 ...
#>   .. ..@ j       : int [1:2018] 0 1 26 244 256 0 1 2 256 1 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:2018] 2.193 -0.663 -0.948 -0.376 -0.205 ...
#>   .. ..@ factors : list()
#>  $ g2:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:5548] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. ..@ j       : int [1:5548] 0 1 2 25 26 28 31 244 245 248 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:5548] 10.794 -5.666 1.248 0.291 -5.639 ...
#>   .. ..@ factors : list()
#>  $ k1:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:2018] 0 0 0 0 0 1 1 1 1 2 ...
#>   .. ..@ j       : int [1:2018] 0 1 26 244 256 0 1 2 256 1 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:2018] 1.868 -0.914 -0.973 -0.119 0.137 ...
#>   .. ..@ factors : list()
#>  $ k2:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
#>   .. ..@ i       : int [1:5548] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. ..@ j       : int [1:5548] 0 1 2 25 26 28 31 244 245 248 ...
#>   .. ..@ Dim     : int [1:2] 298 298
#>   .. ..@ Dimnames:List of 2
#>   .. .. ..$ : NULL
#>   .. .. ..$ : NULL
#>   .. ..@ x       : num [1:5548] 9.119 -6.296 1.735 0.784 -5.17 ...
#>   .. ..@ factors : list()
#>  $ ta: num [1:563, 1] 0.0733 0.0499 0.0794 0.0461 0.0274 ...
#>  $ va: num [1:298, 1] 0.558 0.397 0.666 0.427 0.564 ...