// SPDSOLVE ---> SOLVE SYMMETRIC POSSITIVE DEFINITE SYSTEM FROM CEMEF-UTN // // SYNTAX: // [u0,u,P0]=SPDsolve(K0,K,P,cDOF,cDOFasc,nn) // - Type: Function // // INPUT ARGUMENTS: // - K0: Complete stiffness matrix of the structure [DOFn*nn x DOFn*nn] // - K: Complete stiffness matrix of the structure // [DOFn*nn-cDOF x DOFn*nn-cDOF] // - P: Nodal external loads vector REDUCED [DOFn*nn-cDOF x 1] // - cDOF: Constrained degrees of freedom vector [cDOF x 1] // - cDOFasc: Constrained degrees of freedom vector (descending order) // [cDOFasc x 1] // - nn: Number of nodes [1 x 1] // // OUTPUT ARGUMENTS: // - u0: Nodal displacements vector [DOFn*nn x 1] // - u: Nodal displacements vector REDUCED [DOFn*nn-cDOF x 1] // - P0: Nodal external loads vector [DOFn*nn x 1] // // CEMEF-UTN v1.1-3 // Grupo de Simulacion y Mecanica Computacional // Universidad Tecnologica Nacional // Facultad Regional Haedo // // Copyright 2010 UTN FRH GSMC // $Revision: //REV 1.1.3 2010/10/15 by LBD/MCR function [u0,u,P0]=SPDsolve(K0,K,P,cDOF,cDOFasc,nn) SPDverif(K0,cDOFasc,K)//REV 1.6 2010/06/31 ---START SPD MATRIX VERIFICATION- // DISPLACEMENTS COMPUTATION // Nodal active displacements vector (reduced to active dofs) u=K\P; //REV 1.6 2010/06/31 Changed internal solver technique // ========================================================================= // Nodal displacements vector (expansion to all dofs) // ========================================================================= u0=zeros(3*nn,1); contz=0; for DOF=1:3*nn for j=1:length(cDOF) b=0; if DOF~=cDOF(j) continue else b=1;break end end if b==0 u0(DOF)=u(DOF-contz); else u0(DOF)=0; contz=contz+1; end end // ========================================================================= // Nodal loads vector (external forces and reactions) // ========================================================================= P0=K0*u0; ////// Precission of the loads vector up to 3 significative digits //////for i=1:3*nn ////// if abs(P0(i))<0.001 ////// P0(i)=0; ////// end //////end endfunction //Translated by LBD 2010/11/09