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.
19 lines
535 B
19 lines
535 B
%--------------------------
|
|
% @Author: Jingqiao Hu
|
|
% @Date: 2021-11-26 09:23:33
|
|
% @LastEditTime: 2021-11-28 11:35:00
|
|
|
|
% dK is dK_dx_micro
|
|
% dofs is 64 for quad-element, 36 for tr-element
|
|
%--------------------------
|
|
function [K] = assemble_micro_k(dofid, rho_e, e0, e1, penal, ke, iK, jK, dofs)
|
|
|
|
new_iK = dofid(iK);
|
|
new_jK = dofid(jK);
|
|
|
|
nele = size(material(:), 1);
|
|
sK = reshape(ke(:) * (e0 + rho_e(:)'.^penal * (e1 - e0)), dofs * nele, 1);
|
|
|
|
K = sparse(new_iK, new_jK, sK(:));
|
|
K = (K + K') / 2;
|
|
end
|