function [cindx,direct,multipl] = fourthindicies % address fields for addressing the elements of the Lagrangian elasticity tensor % cindx is a 3x3x3x3 field that contains numbers between 1 and 21 to % to point at the representative element. % direct is a 21x4 array that is used to address a fourth order tensor % with the symmetry conditions of the cindx = zeros(3,3,3,3); multipl = zeros(36,1); direct = zeros(36,4); kk=0; for i=1:3, for j=1:3, for k=1:3, for l=1:3, if (cindx(i,j,k,l)==0), kk=kk+1; multipl(kk)=0; cindx(i,j,k,l)=kk; multipl(kk)=multipl(kk)+1; direct(kk,:) = [i,j,k,l]; if cindx(i,j,l,k) ==0, cindx(i,j,l,k)=kk; multipl(kk)=multipl(kk)+1; end; if cindx(j,i,k,l) ==0, cindx(j,i,k,l)=kk; multipl(kk)=multipl(kk)+1; end; if cindx(j,i,l,k) ==0, cindx(j,i,l,k)=kk; multipl(kk)=multipl(kk)+1; end; % if cindx(k,l,i,j) ==0, cindx(k,l,i,j)=kk; multipl(kk)=multipl(kk)+1; end; % if cindx(k,l,j,i) ==0, cindx(k,l,j,i)=kk; multipl(kk)=multipl(kk)+1; end; % if cindx(l,k,i,j) ==0, cindx(l,k,i,j)=kk; multipl(kk)=multipl(kk)+1; end; % if cindx(l,k,j,i) ==0, cindx(l,k,j,i)=kk; multipl(kk)=multipl(kk)+1; end; end; end; end; end; end;