Herezh_dev/Resolin/Resolution_Condi/resol.cc

1 line
2.7 KiB
C++
Raw Normal View History

2021-09-28 17:28:23 +02:00
void REDUCT (MatBand & TRAID,int LB,int NDDL,Vecteur& CC) //C ====================================================================== //C reduction de la matrice de raideur avant resolution //c $ //C ====================================================================== // REAL*8 TRAID(LB,*) // DIMENSION CC(NDDL) { int I,NI,JJ,KK; TRAID(LB,1)=1.D0/TRAID(LB,1); for ( NI=2; NI<=NDDL ;NI++) {if (NI <= LB) {CC(1)=TRAID(LB-NI+1,NI); if (NI> 2) { for (JJ=2; JJ<=NI-1; JJ++) { C=TRAID(LB-NI+JJ,NI); for (KK=1; KK<= JJ-1; KK++) C=C-CC(KK)*TRAID(LB-JJ+KK,JJ); CC(JJ)=C; } } I=1; for (JJ=LB-NI+1;JJ<=LB-1; JJ++) { TRAID(JJ,NI)=CC(I)*TRAID(LB,I); I=I+1; } D=TRAID(LB,NI); for(KK=1;KK<=NI-1;KK++) D=D-CC(KK)*TRAID(LB-NI+KK,NI); } else { CC(1)=TRAID(1,NI); for (JJ=2;JJ<=LB-1;JJ++) { C=TRAID(JJ,NI); for (KK=1;KK<=JJ-1;KK++) C=C-CC(KK)*TRAID(KK+LB-JJ,NI-LB+JJ); CC(JJ)=C; } I=1; for (JJ=1;JJ<=LB-1;JJ++) { TRAID(JJ,NI)=CC(I)*TRAID(LB,NI-LB+JJ); I=I+1; } D=TRAID(LB,NI); for (KK=1;KK<=LB-1;KK++) D=D-CC(KK)*TRAID(KK,NI); } TRAID(LB,NI)=1.D0/D; } } // ********************************************************************** void RESOLT(MatBand & TRAID,Vecteur & TSM,int NDDL,int LB) { // DIMENSION TRAID(LB,1),TSM(1) //---------------------------execution --------------------------- int NI,JJ; for (NI=2;NI<=NDDL;NI++) { if (NI<=LB) { R=TSM(NI); for (JJ=LB-NI+1;JJ<=LB-1;JJ++) R=R-TRAID(JJ,NI)*TSM(NI-LB+JJ); TSM(NI)=R; } else { R=TSM(NI); for (JJ=1;JJ<=LB-1;JJ++) R=R-TRAID(JJ,NI)*TSM(NI-LB+JJ); TSM(NI)=R; } } // for( NI=1;NI<=NDDL;NI++) TSM(NI)=TSM(NI)*TRAID(LB,NI); // for (NI=1;NI<=NDDL-1;NI++) { NII=NDDL-NI; if (NI+1<=LB) { R=TSM(NII); for (JJ=1;JJ<=NI;JJ++) R=R-TRAID(LB-JJ,NII+JJ)*TSM(NII+JJ); TSM(NII)=R; } else { R=TSM(NII); for (JJ=1;JJ<=LB-1;JJ++) R=R-TRAID(LB-JJ,NII+JJ)*TSM(NII+JJ); TSM(NII)=R; } } }