Skip to content

Commit

Permalink
added comment on computing the inverse of an stiffness tensor explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfHielscher committed Jul 22, 2019
1 parent 9f2e272 commit 6ea8302
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion TensorAnalysis/@complianceTensor/inv.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,36 @@
% C - @stiffnessTensor
%

C = stiffnessTensor(inv@tensor(S));
C = stiffnessTensor(inv@tensor(S));

end

% this can be done more explicitely by
function test

M = matrix(S,'voigt');

D = M(1,1,:) .* M(2,2,:) .* M(3,3,:) ...
- M(1,1,:) .* M(2,3,:).^2 ...
- M(2,2,:) .* M(1,3,:) .* M(1,3,:) ...
- M(3,3,:) .* M(1,2,:).^2 ...
+ 2 * M(1,2,:) .* M(2,3,:) .* M(1,3,:);

C11 = (M(2,2,:) .* M(3,3,:)-M(2,3,:) .* M(2,3,:))/D;
C12 = (M(1,3,:) .* M(2,3,:)-M(1,2,:) .* M(3,3,:))/D;
C13 = (M(1,2,:) .* M(2,3,:)-M(1,3,:) .* M(2,2,:))/D;
C22 = (M(1,1,:) .* M(3,3,:)-M(1,3,:) .* M(1,3,:))/D;
C23 = (M(1,2,:) .* M(1,3,:)-M(2,3,:) .* M(1,1,:))/D;
C33 = (M(1,1,:) .* M(2,2,:)-M(1,2,:) .* M(1,2,:))/D;

% Enter tensor as 6 by 6 matrix,M line by line.
M = [[ C11 C12 C13 0 0 0];...
[ C12 C22 C23 0 0 0];...
[ C13 C23 C33 0 0 0];...
[ 0 0 0 1./M(4,4,:) 0 0];...
[ 0 0 0 0 1./M(5,5,:) 0];...
[ 0 0 0 0 0 1./M(6,6,:)]];
%
C = reshape(stiffnessTensor(M,cs_tensor,'density',rho),size(S));

end

0 comments on commit 6ea8302

Please sign in to comment.