generated from usnistgov/opensource-repo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcalculateEij_2d.m
69 lines (53 loc) · 1.81 KB
/
calculateEij_2d.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
% Computes the lagrangian and infinitesimal strain tensors from the deformation
% gradient tensor.
%
% INPUTS :
% -------------------------------------------------------------------------
% Fij = deformation gradient tensor calculated on the mesh grid
% with spacing dm.
% Format: Fij{time}{2x2 deformation gradient tensor matrix}
%
%
% OUTPUTS
% -------------------------------------------------------------------------
% Eij = Lagrangian strain tensor calculated on the mesh grid with
% spacing dm.
% Format: Eij{time}{2x2 Lagrangian strain tensor
% matrix}
% eij = Infinitesimal strain tensor calculated on the mesh grid with
% spacing dm.
% Format: eij{time}{2x2 infinitesimal strain tensor
% matrix}
%
%
% NOTES
% -------------------------------------------------------------------------
% none
%%
function [Eij, eij] = calculateEij_2d(Fij)
%Set up variables
maxTime = length(Fij);
Eij = cell(maxTime,1);
eij = cell(maxTime,1);
for i = 1:maxTime
Eij{i} = funCalculateLagrangianEij(Fij{i});
eij{i} = funCalculateEij(Fij{i});
end
end
function eij = funCalculateEij(Fij)
%Calculate Infinitesimal strain
% A Bower, "solid mechanics", pg 22
eij = cell(2,2);
eij{1,1} = Fij{1,1} - 1;
eij{2,2} = Fij{2,2} - 1;
eij{1,2} = 0.5*(Fij{1,2} + Fij{2,1});
eij{2,1} = eij{1,2};
end
function Eij = funCalculateLagrangianEij(Fij)
%Calcualte Lagrangian Strain
% A. Bower,"Solid mechanics", pg 20
Eij{1,1} = 0.5*(Fij{1,1}.*Fij{1,1} + Fij{2,1}.*Fij{2,1} - 1);
Eij{2,2} = 0.5*(Fij{1,2}.*Fij{1,2} + Fij{2,2}.*Fij{2,2} - 1);
Eij{1,2} = 0.5*(Fij{1,1}.*Fij{1,2} + Fij{2,1}.*Fij{2,2} - 1);
Eij{2,1} = Eij{1,2};
end