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.
24 lines
712 B
24 lines
712 B
3 years ago
|
%--------------------------
|
||
|
% @Author: Jingqiao Hu
|
||
|
% @Date: 2021-03-01 19:47:02
|
||
|
% @LastEditTime: 2021-03-01 19:47:02
|
||
|
%--------------------------
|
||
|
% given micro-u with micro-dofs * 1 -> 8 * eleNum_mi
|
||
|
% this func generate the index of output-matrix: iu, ju
|
||
|
function [sort_u] = prepare_index_micro_u(microx, edofMat, dofid)
|
||
|
|
||
|
iu = repmat(1:microx^3, 3*8, 1);
|
||
|
ju = repmat((1:24)', 1, microx^3);
|
||
|
vu = zeros(24, microx^3);
|
||
|
|
||
|
for ele = 1:microx^3
|
||
|
edof = edofMat(ele, :);
|
||
|
new_edof = dofid(edof); % change order of [u, h']
|
||
|
vu(:, ele) = new_edof;
|
||
|
end
|
||
|
|
||
|
sort_u = zeros(24*microx^3, 3);
|
||
|
sort_u(:,1) = ju(:);
|
||
|
sort_u(:,2) = iu(:);
|
||
|
sort_u(:,3) = vu(:);
|
||
|
end
|