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
811 B

3 years ago
%--------------------------
% @Author: Jingqiao Hu
% @Date: 2021-01-04 20:49:42
% @LastEditTime: 2021-05-18 22:45:27
%--------------------------
function psi = energy_2scale_nonlinear(F, eleNum_ma, microx, global_u, global_l, dx)
psi = 0;
jac = dx^3/8;
parfor ele_ma = 1:eleNum_ma
u = global_u{ele_ma};
l = global_l{ele_ma};
for gp = 1:8
Fm = F{gp, ele_ma};
for ele_mi = 1:microx^3
Fe = reshape(Fm(:, ele_mi),3,3);
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