[Master Index] [Index for .]

assemble_truss_k

(./assemble_truss_k.m)


Function Synopsis

sys_k = assemble_truss_k (sys_k,member,nodes,active_nodes,dof)

Help text

 function sys_k = assemble_truss_k (sys_k,member,nodes,active_nodes)
 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

Listing of function ./assemble_truss_k.m

function sys_k = assemble_truss_k (sys_k,member,nodes,active_nodes,dof)
% function sys_k = assemble_truss_k (sys_k,member,nodes,active_nodes)
% 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.
 
member_k_n = trussk(member,nodes);
big_mem_k_n = [member_k_n,-member_k_n;-member_k_n,member_k_n];

%local to global/reduced map:

active_ends = 2;

i = find(active_nodes==member(1));      %essentially the global to reduced map
j = find(active_nodes==member(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
   active_ends = active_ends-1;    % 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
end                                % corresponding prt lf the local
                                   % doesn't cause an error
if max(size(j)) == 0
   jrange = [];
   active_ends = active_ends-1;
else
   jrange = j*dof-(dof-1):j*dof;
end

global_range = [irange,jrange];
local_range = [1:active_ends*dof];
sys_k (global_range,global_range) = sys_k (global_range,global_range)+...
                     big_mem_k_n(local_range,local_range);
                     

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