You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
812 B
31 lines
812 B
%--------------------------
|
|
% @Author: Jingqiao Hu
|
|
% @Date: 2021-01-04 20:49:42
|
|
% @LastEditTime: 2021-01-04 20:55:50
|
|
%--------------------------
|
|
function psi = energy_2scale_nonlinear(F, eleNum_ma, microx, global_u, global_l, dx)
|
|
psi = 0;
|
|
jac = dx^2/4;
|
|
parfor ele_ma = 1:eleNum_ma
|
|
u = global_u{ele_ma};
|
|
l = global_l{ele_ma};
|
|
|
|
for gp = 1:4
|
|
Fm = F{gp, ele_ma};
|
|
|
|
for ele_mi = 1:microx^2
|
|
Fe = reshape(Fm(:, ele_mi),2,2);
|
|
psi = psi + energy_local(Fe, u(ele_mi), l(ele_mi)) * jac;
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
function psi = energy_local(F, u, l)
|
|
FF = F'*F;
|
|
I1 = trace(FF);
|
|
% I2 = trace(FF*FF);
|
|
I3 = det(FF);
|
|
|
|
psi = u/2*(I1- log(I3) - 3) + l/8*log(I3)^2;
|
|
end
|