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.
 
 
 
 

30 lines
992 B

%--------------------------
% @Author: Jingqiao Hu
% @Date: 2021-06-16 14:52:29
% @LastEditTime: 2022-04-25 12:47:51
% compute NH of \Omega_{\alpha}
% input: interpolation matrix R:[ndofs, v], which is ordered as col by col
% output: surface NH on this fine mesh, [nnodes_mi, 2, 2, nnodes_ma]
%--------------------------
function NH = NH_alpha(edofMat, nn_ma, Nh, R, nnodes)
% nn_mi = size(Nh, 1);
NH = zeros(nnodes, 2, 2, nn_ma); % [n,2,2,v]
for ele_mi = 1:size(edofMat, 1)
edof = edofMat(ele_mi, :);
Nhe = Nh(ele_mi, :, :); % [3,3]
Nh2 = kron(permute(Nhe,[2,3,1]), eye(2));% [6,6]
NH1 = Nh2 * R(edof, :); % [2*3,6] * [6, 2v] = [6,2v]
NH2 = reshape(NH1', 2, [], 6); % [2, v, 6]
NH3 = permute(NH2, [3,1,2]); % [6,2,v]
NH4 = reshape(NH3, 2, 3, 2, []);% [2, 3, 2, v]
NH5 = permute(NH4, [2,1,3,4]); % [3, 2, 2, v]
NH(edof(2:2:end)/2, :, :, :) = NH5;
end
end