I am wondering whether the loop over the elements in a finite element assembly can be replace by a flavor of map over the list of elements. I am happy to consider the linear elements on a one-dimensional mesh to start from.
Assume thus having on the interval (or computational domain) 0 <= x <= 1 three elements (or subintervals) 0 <= x <= 1/3, 1/3 <= x <= 2/3 and 2/3 <= x <= 1. We thus have as connectivity matrix
e = [1 2; 2 3; 3 4]
and a list of coordinates p = [0 1/3 2/3 1].
Is there a way to compute the length (area) of each subinterval by a map on the matrix e?