find-dofs.b

来自「C 开发的有限元软件」· B 代码 · 共 29 行

B
29
字号
function find_dofs (shared num_dofs)    global elements, write, zeros    dofs = zeros (1, 6)    flag = zeros (1, 6)    last_type = null    for e in elements do	if last_type != e.definition then	    last_type = e.definition	    for i in e.definition.dofs do		if i then		    flag (i) = 1		end	    end	end    end    num_dofs = 0    for i in 1 : 6 do	if flag (i) then	    num_dofs = num_dofs + 1	    dofs (i) = num_dofs	end    end    return dofsend

⌨️ 快捷键说明

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