a 2D version
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.
 
 

11 lines
284 B

% The whole K is participated in caculation.
% So K(fixeddofs) should be 1 in diag and 0 otherwise
function K = boundaryK(K, fixeddofs)
K(fixeddofs, :) = 0;
K(:, fixeddofs) = 0;
for i = 1:size(fixeddofs, 2)
dof = fixeddofs(i);
K(dof, dof) = 1;
end
end