Code covered by the BSD License  

Highlights from
3D Crouzeix-Raviart mortar finite element method

image thumbnail

3D Crouzeix-Raviart mortar finite element method

by

 

13 Dec 2008 (Updated )

Implementation of 3D Crouzeix-Raviart mortar finite element

M_CR=stima_massCR_3D(elements3,coordinates,element2faces)
function M_CR=stima_massCR_3D(elements3,coordinates,element2faces)
%Crouzeix-Raviart mass matrix computation
volumes=zeros(size(elements3,1),1);
for j = 1:size(elements3,1)
    I=elements3(j,:); 
    verticesTrans=coordinates(I,:)'; %new definition (transpose operation) for faster performance!!!!
    volume=det([1 1 1 1; verticesTrans])/6; 
    volumes(j)=abs(volume);
end

Xscalar=kron(ones(1,4),element2faces); 
Yscalar=kron(element2faces,ones(1,4)); 
Zscalar=kron(volumes,reshape(eye(4),1,16))/4;
M_CR=sparse(Xscalar,Yscalar,Zscalar); 

Contact us