forked from jaolive/SiStER
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSiStER_get_friction.m
More file actions
44 lines (35 loc) · 828 Bytes
/
SiStER_get_friction.m
File metadata and controls
44 lines (35 loc) · 828 Bytes
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
function [fric]=SiStER_get_friction(im,ep,MAT)
% [fric]=SiStER_get_friction(im,ep,MAT)
% compute friction on markers based on plastic strain, like cohesion
% J.-A. Olive 4/2017
fric = zeros(size(im));
types = unique(im);
for i = 1:length(types)
imInd = im == types(i);
mumax=MAT(types(i)).mu;
if isfield(MAT,'mumin')==1
mumin=MAT(types(i)).mumin;
else
mumin=MAT(types(i)).mu;
end
epscrit=MAT(types(i)).ecrit;
% get cohesion
fric(imInd)=max(mumax+(mumin-mumax).*ep(imInd)./epscrit,mumin);
end
return
%% OLD (slow due to brackets)
% mumax=[MAT(im).mu];
%
%
% if isfield(MAT,'mumin')==1
% mumin=[MAT(im).mumin];
% else
% mumin=[MAT(im).mu];
% end
%
% epscrit=[MAT(im).ecrit];
%
% % get cohesion
% fric=max(mumax+(mumin-mumax).*ep./epscrit,mumin);
%
% return