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.

28 lines
669 B

3 years ago
%--------------------------
% @Author: Jingqiao Hu
% @Date: 2022-01-26 15:31:27
% @LastEditTime: 2022-01-26 16:39:03
%--------------------------
function [c_sK, c_vol, vol0] = prepare_sK(c_node, c_tet, e1, nu)
ncvt = size(c_node, 1);
c_sK = cell(ncvt, 1);
c_vol = cell(ncvt, 1);
vol0 = 0; % the vol of all domain
localVol = zeros(ncvt, 1);
parfor ele = 1 : ncvt
nodes = c_node{ele};
tet = c_tet{ele};
[sK, vol] = intKE_tet(nodes, tet, e1, nu);
c_sK{ele} = sK;
c_vol{ele} = vol;
vol0 = vol0 + sum(vol);
localVol(ele) = sum(vol);
end
localVol = localVol / max(localVol);
end