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.

29 lines
830 B

3 years ago
%--------------------------
% @Author: Jingqiao Hu
% @Date: 2021-01-25 21:10:08
% @LastEditTime: 2021-02-08 16:37:18
%--------------------------
function F = deform_grad(sort_h, edofMat, dNh, eleNum_mi, U, regulated_matrix)
eleNum_ma = size(edofMat, 1);
initF = repmat([1;0;0;1], 1, eleNum_mi);
F = cell(4, eleNum_ma);
for ele = 1:eleNum_ma
edof = edofMat(ele, :);
ue = U(edof); % including macro U and control pnts
Re = regulated_matrix{ele};
he = Re * ue;
% reorder micro-displacement to [8 * eleNum_mi]
he_reorder = sparse(sort_h(:,1), sort_h(:,2), he(sort_h(:,3)));
%% 2. compute deform grad
for gp = 1:4
Be = dNh{gp};
F{gp, ele} = Be * he_reorder + initF; % 4 * eleNum_mi
end
end
end