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.
21 lines
597 B
21 lines
597 B
%--------------------------
|
|
% @Author: Jingqiao Hu
|
|
% @Date: 2021-03-13 16:46:15
|
|
% @LastEditTime: 2021-03-13 17:06:48
|
|
%--------------------------
|
|
function psi = energy_1scale(F, eleNum, global_u, global_l, dx)
|
|
psi = 0;
|
|
jac = dx^2/4;
|
|
for gp = 1:4
|
|
Fg = F{gp};
|
|
for ele = 1:eleNum
|
|
Fe = reshape(Fg(:, ele), 2, 2);
|
|
psi = psi + energy_local(Fe, global_u(ele), global_l(ele))*jac;
|
|
end
|
|
end
|
|
end
|
|
|
|
function psi = energy_local(F, u, l)
|
|
epsilon = (F + F')/2 - eye(2);
|
|
psi = u * sum(sum(epsilon.^2)) + l/2 * trace(epsilon)^2;
|
|
end
|