function S=stress_tensor(E,V,volume) %E - list of edges in entire cellular structure %V - x-y coordinates of vertices in entire cellular structure % %For bugs, comments, clarifications or modifications, please contact Kapil Krishan : %kkrishan@uci.edu %www.physics.uci.edu/~foams %version: I l_vec=V(E(:,1),:)-V(E(:,2),:); S=(l_vec'*(l_vec./(sqrt(sum(l_vec.^2,2))*[1 1])))/volume;