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.

27 lines
780 B

3 years ago
%--------------------------
% @Author: Jingqiao Hu
% @Date: 2021-01-04 20:49:42
% @LastEditTime: 2021-03-04 20:12:20
%--------------------------
function psi = energy_2scale_linear(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)
epsilon = (F + F')/2 - eye(3);
psi = u * sum(sum(epsilon.^2)) + l/2 * trace(epsilon)^2;
end