brick_stress_main.m

来自「结构力学中的有限元例子,包含了7个分类文件夹」· M 代码 · 共 28 行

M
28
字号
function [SIG_main] = BRICK_stress_main (in_data, SIGsys) 

% principal stresses field for 'brick' 3D FEM model
% ---------------------------------------------------------------------------
% INPUT:
%        ND  -  nodes matrix
%        D   -  computed nodal displacements vector
%        EL  -  elements matrix
% ---------------------------------------------------------------------------
fj = size(in_data.EL);
SIGlocal_main = zeros(fj(1)*3,1);

for i=1:fj(1) 
   
   if in_data.EL(i,2)==6  % "6" - BRICK element (8-nodes) 
      
      SIGlocal = SIGsys((i*6-5):(i*6));
      SIG = [ SIGlocal(1) SIGlocal(4) SIGlocal(6);
              SIGlocal(4) SIGlocal(2) SIGlocal(5);
              SIGlocal(6) SIGlocal(5) SIGlocal(3)];
      [V,D] = eig(SIG); % D - principal values 
      D = diag(D);
      SIG_main((i*3-2):(i*3)) = D;
           
   end;
   
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?