View source: R/Calc_Anisotropic_Mesh.R
1 | Calc_Anisotropic_Mesh(loc_x)
|
loc_x |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (loc_x)
{
mesh = inla.mesh.create(loc_x, plot.delay = NULL, refine = FALSE)
spde = inla.spde2.matern(mesh, alpha = 2)
Dset = 1:2
TV = mesh$graph$tv
V0 = mesh$loc[TV[, 1], Dset]
V1 = mesh$loc[TV[, 2], Dset]
V2 = mesh$loc[TV[, 3], Dset]
E0 = V2 - V1
E1 = V0 - V2
E2 = V1 - V0
TmpFn = function(Vec1, Vec2) abs(det(rbind(Vec1, Vec2)))
Tri_Area = rep(NA, nrow(E0))
for (i in 1:length(Tri_Area)) Tri_Area[i] = TmpFn(E0[i, ],
E1[i, ])/2
Return = list(Tri_Area = Tri_Area, TV = TV, E0 = E0, E1 = E1,
E2 = E2, mesh = mesh, spde = spde)
return(Return)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.