powered by
This function computes mass and stiffness matrices for a mesh in 2D, assuming Neumann boundary conditions.
rSPDE.fem2d(FV, P)
The function returns a list with the following elements
The stiffness matrix with elements \((\nabla \phi_i, \nabla \phi_j)\).
The mass matrix with elements \((\phi_i, \phi_j)\).
The mass lumped matrix with diagonal elements \((\phi_i, 1)\).
Matrix with elements \((\partial_x \phi_i, \partial_x \phi_j)\).
Matrix with elements \((\partial_y \phi_i, \partial_y \phi_j)\).
Matrix with elements \((\partial_x \phi_i, \partial_y \phi_j)\).
Matrix with elements \((\partial_y \phi_i, \partial_x \phi_j)\).
Matrix with elements \((\partial_x \phi_i, \phi_j)\).
Matrix with elements \((\partial_y \phi_i, \phi_j)\).
Matrix where each row defines a triangle
Locations of the nodes in the mesh.
David Bolin davidbolin@gmail.com
rSPDE.fem1d()
P <- rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1)) FV <- rbind(c(1, 2, 3), c(2, 3, 4)) fem <- rSPDE.fem2d(FV, P)
Run the code above in your browser using DataLab