[Master Index] [Index for .]

assemble_k

(./assemble_k.m)


Function Synopsis

sys_k = assemble_k (sys_k,members,nodes,active_nodes,dof)

Help text

 function sys_k = assemble_k (sys_k,members,nodes,active_nodes,dof)
 assembles the stiffness truss one element at a time. Given a member,
 [pi,pj,A,E] a list of nodes, a list of the active nodes, and the 
 partially full system stiffness matrix, theis adds the given member
 k to the system matrix.

Cross-Reference Information

This function calls
This function is called by

Listing of function ./assemble_k.m

function sys_k = assemble_k (sys_k,members,nodes,active_nodes,dof)
% function sys_k = assemble_k (sys_k,members,nodes,active_nodes,dof)
% assembles the stiffness truss one element at a time. Given a member,
% [pi,pj,A,E] a list of nodes, a list of the active nodes, and the 
% partially full system stiffness matrix, theis adds the given member
% k to the system matrix.

[numMembers,mc] = size(members);

for index = 1:numMembers

if dof == 1
    member_k = heatk(members(index,:),nodes);
    big_mem_k = [member_k,-member_k;-member_k,member_k];
else if dof <= 3 
    member_k = trussk(members(index,:),nodes)    
    big_mem_k = [member_k,-member_k;-member_k,member_k];
else 
    [kfu,kmu,kmt,kmtp] = beam_k(members(index,:),nodes);
    big_mem_k = [kfu, kmu', -kfu, kmu';
                 kmu,  kmt, -kmu, kmtp;
                -kfu,-kmu',  kfu,-kmu';
                  kmu, kmtp, -kmu, kmt ];
end
end

%local to global/reduced map:



i = find(active_nodes==members(index,1));%essentially the global to reduced map
j = find(active_nodes==members(index,2));%Active_nodes(1) = 2: 1 is the reduced
                                        %node number, 2 is the global node
                                        %number

if max(size(i)) == 0               % the local to global/reduced mapping
   irange = [];                    % If the node we're looking for goes
   local_i = [];                    % away in the reduction, we don't the
else                               % put anything into it for the global K
   irange = i*dof-(dof-1):i*dof;   % and we make sure that the
    local_i = 1:dof;
end                                % corresponding prt lf the local
                                   % doesn't cause an error
if max(size(j)) == 0
   jrange = [];
   local_j = [];
else
   jrange = j*dof-(dof-1):j*dof;
    local_j = dof + (1:dof);
end

global_range = [irange,jrange];

local_range = [local_i,local_j];

sys_k (global_range,global_range) = sys_k (global_range,global_range)+...
                     big_mem_k(local_range,local_range);
                     
end






Produced by mat2html on Wed Jul 10 14:55:44 US/Pacific 1996
Cross-Directory links are: OFF