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.
23 lines
629 B
23 lines
629 B
% NOTE: edofMat is for micro eles in this macro ele
|
|
function mu = adjoint_mu(subx, suby, den2, k0, iK, jK, rightF, freedofs)
|
|
|
|
mu = zeros(size(rightF)); % for one micro-ele 8*9
|
|
|
|
K = assembleK(k0, den2, iK, jK, subx, suby);
|
|
mu(freedofs,:) = K(freedofs,freedofs)\rightF(freedofs,:);
|
|
end
|
|
|
|
function K = assembleK(k0, den2, iK, jK, subx, suby)
|
|
|
|
globalK = zeros(64, suby, subx);
|
|
|
|
% which coarse ele in this sub
|
|
for i = 1:subx
|
|
for j = 1:suby
|
|
globalK(:,j,i) = k0(:) * den2(j,i);
|
|
end
|
|
end
|
|
sK = globalK(:);
|
|
K = sparse(iK, jK, sK);
|
|
K = (K + K') / 2;
|
|
end
|