(Felippa) Solution of Linear Equations With Skyline-Stored Symmetric Matrix
(Felippa) Solution of Linear Equations With Skyline-Stored Symmetric Matrix
Abstract-Fortran IV subroutines for the in-core solution of linear algebraic systems with a sparse,
symmetric, skyline-stored coefficient matrix are presented. Such systems arise in a variety of applications,
notably the numerical discretization of conservative physical systems by finite differences or finite element
techniques. The routines can be used for processing constrained systems without need for prearranging
equations. The application to ‘superelement’ condensation of large-scale systems is discussed.
A=LDU (2) A: aI;, a22, alj, 0, a33, a24, aj4, ati, a55, a16,
0, 0,a46,a56, a%. (7)
where L is a unit lower triangular matrix, D a nonsingular
diagonal matrix and U is the transpose of L, is carried out This array is complemented by a (n + 1)-word array LD
by subroutine SKYFAC by a compact Cholesky-type containing diagonal location pointers:
factorization algorithm similar to that described in[ll,
Contrs. I/l and I/4]. The original matrix A is overwritten LD: 0, 1,2,5,8,9,15. (8)
by elements of D-’ and U in the manner discussed in the
‘Organizational Details’ subsection. No pivoting is used For a genera1 matrix, LD(I + 1) points to aii in array A
in the factorization process. for i=l,... n, whereas LD(l) contains zero.
Once A has been factorized, subroutine SKYSOL can During the factorization process, elements of the strict
be repeatedly invoked to solve equation (1) for any right upper triangle of U replace the corresponding super-
hand side b. The solution vector is obtained by the usual diagonal entries of A, and the reciprocals of the diagonal
three-stage process: elements of D overwrite the diagonal elements of A. Thus
the factorization (2) of the example matrix (6) would be
Lz=b (forward substitution) (3a) arranged as follows:
y = D-‘z (scaling) (3b)
I/d, u13 Ul6
ux=y (backsubstitution). (3c) lldz uz ~24 U26
l/d, ~34 U36
Constrained system l/da (9)
SKYFAC-SKYSOL can also be used to solve the lids :::
more general case of a constrained linear system: l/d61 .
I
Constrained equations are flagged by a negative LD
pointer. For instance, if x3 and x5 are to be prescribed in
the linear system with coefficient matrix (6)
where both b, and x, are prescribed (subscripts f and c
stand for free and constrained, respectively). Equations LD:O,1,2,-5,8,-9,15. (10)
associated with xc are called constraint equations or
simply constraints; they result from the discretization of In this case, the decomposition (2) is performed only on
essential boundary conditi0ns.t A constraint equation the unconstrained equations of (4), i.e. A,, is replaced by
corresponding to a prescribed zero (nonzero) component Dff’ and U,. Constrained rows and columns are not
of x is called homogeneous (nonhomogeneous). If all altered.
constraints are homogeneous, i.e. xc = 0, the system (4) is
said to be homogeneously constrained.
System (4) can be solved for xf upon reduction to the Decomposition failure
form The factorization process (1) may be aborted if one of
Arrx, = bf - Af,xc = b, (5) the following conditions is encountered.
where l;f = b, if the system is homogeneously con- 1. Singularity: matrix A (Aff if constrained) appears
strained. I’he subvector b, may then be obtained from the singular to machine accuracy. The singularity test
second matrix equation in (4), if desired. performed at the j-th elimination stage is[ 11,Contr. I/7]:
It is important tb note that it is not necessary to
physically arrange a constrained system (1) to put it into di < tj = 8 El; (11)
the partitioned form (4). Constrained and unconstrained
equations may be freely intermixed.* where d, is the j-th diagonal entry of D, E the smallest
positive floating-point number for which 1+ l > 1 on
Organizational details computer being and is the Euclidean norm
The storage arrangement of the coefficient matrix A is (length) of the row of excluding constrained
best illustrated by a simple example. Consider the (6 X6) columns.
symmetric matrix: 2. Indefiniteness: A if appears
be and check positive is
011 aI3 aI6 by user. j-th test
aZ20 a24 0
A= a33 a34 0 di - (12)
a4 a46 (6)
symm. as5 as6 The stability the factoriza-
[ ah6I (3) not if is positive
However, many situations, as
tb, is often called the constraint reaction vector. finite analysis a symmetric
SIf the number nc of constrained equations is significant (say tion an matrix guaranteed some
n, B 0.3 n), it may be computationally advantageous to preorder restrictions the of equations
(1)into the form (4) before presenting it to SKYFAC-SKYSOL. observed.
Solution of linear equations with skyline-stored symmetric matrix 15
ri = b-Axi_,
LDUAxi = ri i=l,...k (14)
xi = xi-1 t Ax, 1
I Au’ I l
l
.
THIS IS PRESENTED TO SKYFAC AS H I’+WORD PTRING : .
.
DC,* LT S*EP?MRC.RIJ’ .
l
c* WHERE CBFI fiND IXCI HRE GIVEN AND CXFl RND CBC, RRE TO BE .
C. DETERt‘INED <SUFFICES ‘F’ RND ‘C’ STAND FOR ‘FREE’ AND .
C. ‘CONSTRAINED’, RESPECTIVELY. HOWEVER. IT “L&T BE EMFHHSIZED .
C. THRT IA3 NEED NOT BE PHYSICRLLY RPPRNGED TO CONFOPM TO (7,. .
C. l
,: . .
CON?TRHINED PI,@ tiND COLURNJ HFE IGNORE11 IN THE FHCTOPIZHTION .
;: OF R CONITPAINED MHTPIX HND VHLUEr. THEREIN PETUPN LINHLTEYED. .
1:l FOR INCTRNCE, THE OUTPUT F@OM ?kYFAC FOP THE EXHNPLE NHTPIX .
C. (11 lJITH THE L” HF‘YAY ‘7R, r\tOULD BE : .
c* .
C. .
C. I I ‘DI HI3 HI& I l
0:. I I 112 HZ3 ,_I24 0 I
c* I H3’ ,_,1:4 n I IS> :
c. I 1, DJ H46 I .
i. 1 1,D5 Fl5c; I .
c. I “66 I l
cl .
C. .
c* THhT III OHLY THE ,uNRE~PP~~NGED~ FFEE-FREE POPTION IRFFI IS +
c+ EFFECTIVELY FHCTORIZED INTO CLFF, CDFF, CUFF,. l
l
c”: .
C. HDDITIONHL FEHTlJPEl OF THIS KIITINE INCLUDE: .
c. .
C. 1. THE DETEF”INRNT OF CHJ ,OF IHFF, ,F CONSTRHINED1 “AY .
c+ BE CONPUTED ON FEOUEST. .
0. .
C. 2. FbN ESTINHTE OF THE EUCLIDEHN CONDITION NUMBER OF IHI iOR .
c. CHFFI IF CONSTRAINED, MHY BE OBTHINED. l
C. .
c. 3. HCCUFIIJLHTION OF INNER PRODUCT’ i IN DIFFERENT PRECISION
r:* MOIlE5 IT FHCILITHTED BY INCLUDING THE INNERPRODUCT FUNCTION :
C. IN THE FORNHL RPGUNENT LIST. VHRIOLIS ENTRY POINT NRMES t
C. MHY THUS BE UIED WITHOLIT NEED FOR EDITING4ECOMPILING. l
l
2: 4. R CHPABILITY FOR PF1CTIHL FACTORIZRTION IS INCLUDED. T,,E .
C* FHCTORIZHTION ‘3’ I: HCTUALLY CRPRIED OUT FROM EQURTION .
c* *NBEG+Ia THROUGH rlENDr WHERE NBEG, NEND RRE TWO INPUT .
c* PRRHMETERS. NORIIALLI’ NBEG=O RND NEND=N. INATRIX ORDEk. .
C. HOWEVEF. IN CERTHIN CHZES (E.G.. LOCHL STRBILITY ANRLYSIS, .
$1. LOCHL NONLINEHKITIES;~ I H PRPTIAL FRCTOPIZRTION MRY BE .
c* UCEFUL. .
c* .
C...**..+**...*.**....**.....*.**.***.*..**.......**............*....*..
C. __----_____--_ l
c+ - IJ ; R 15 E - .
c* .
C. .
C.... 1. INFUT HPGCIMENTS - .
c. l
C. NBEG, NEND TWO PRRHMETERS SPECIFYING FRCTORIZRTION RRNGE .
c. HI EXTENDING FRON EQUHTION INBEG+l> THROUGH NEND. .
c. c.CEE DI’CU:‘: ION) . CONPLETE FRCTOPIZRTION OF CA1 .
C. I; qBTRINED WITH NBEG=O RND NEND=N <PIRTRIX ORDER,. .
C. .
c.. N IRDEP OF MeTHI?: CR, .
CO l
C. LD ,N+Is-UURD HPRRY OF DIAGONRL LOCRTION POINTERS .
C. ISEE DICClJ;SION, .
C. .
c. Y H SCRRTCH FLOATING-POINT RPRRY OF LENGTH AT LERST .
C+ N IF ICOND = 0, 4.N IF ICOND IS POSITIVE. l
c* .
CO DOTPRD FUNCTION RETURNING INNER (DOT, SCHLRP) PRODUCT .
C. UF TWO VECTOYS. THIS FUNCTION IS INVOKED BY .
C. DOTPRD(P,Q.N, AND SHOULD EVRLURTE THE INNER .
C+ PRODUCT OF THE TWO N-WORD VECTORS P ,?ND Q. .
CO .
c. SINGRB LOGICRL FLRG CONTROLLING ACTION TO BE TRKEN IF THE .
C. SINGULRRITY TEST (5) IS VERIFIED : l
C. .
C. SINGRB = .TRUE. RBORT SETTING IFAIL = J .
CO SINGHB = .FRLSE. SET D(J) TO Y.EPSNRC.R<A FIND .
c. PROCEED. .
C. .
CO FOR NORMAL USE OF SKYFRC IN EQURTION SOLVING, ONE .
C. SHOULD ALWAYS SET SINGRB = .TRUE.. THE .FRLSE. .
co SETTING IS RECOMMENDED ONLY IF THE DECOMPOSITION .
C* (3) IS TO BE USED IN THE CRLCULATION OF EIGEN- .
C* VECTORS OF [RFFI BY INVEPSE POWER ITERATION. +
C. l
c. PDCHEK LOGICAL FLFlG INDICRTING WHETHER CR1 <OR CRFF, IF .
C* CONSTRAINED) IS TO BE CHECKED FOR POSITIVE .
C. DEFINITENESS, I.E., CONDITION 16) TESTED : l
C* .
C. PDCHEK = .TRUE. ABORT SETTING IFAIL = -J l
C. PDCHEK = FRLSE. DON’T TEST FOR INDEFINITENESS .
C.
C. ICOND IF POSITIVE, A LOWER BOUND ESTXMRTE OF THE EUCLI- :
DEFIN CONDITION NUMBER C(A) OF CR3 <OR CAFF, IF .
CONSTRRINED, WILL BE CALCULATED BY PERFORMING ONE .
ITERATIVE REFINEMENT CYCLE ON ICOND ‘RRNDO,,’ RHS .
VECTORS. THE LRRGER ICOND, THE BETTER THE ESTIIIRTE..
c* HOWEVER, FOR PRRCTICAL R PRIORI RSSESSMENT OF .
C. SOLUTION RCCURRCY. ICOND - 2 IS OFTEN SUFFICIENT. .
.
C. A. FELIPPA
C. .
C.... 11. LIRRHRY :UBPOLITINE; - l
i
c T ir’E HND DI”EN:ION : T H T E ” E N T ‘;
c
REAL fIbI>, V 11
REHL HIJ?, DI DETCF, DOTFPD, EF5MRC
INTEGER LDf.1)
LOGICRL PDCHEK, ZINGRB
EOUIVRLENCE IHIJ~,II,DMAII
c
c NOTE - RPPROPIATE ‘JHLClEl IIF EPPNRC FOR VARIOUS COMPUTERS RRE
c CDC 6000,‘i’“O” SERIES :.llE-15 ‘TINGLE PRECISION)
IB” 36W320 EERIES 9.54E-07 +EAL.4 PRECISION)
c IBN 360,370 SERIES 2.2X-16 cRERL.8 PRECISION,
c UNIYHC 1108~1110, IBFl 7094 ,.49E-08 CIINGLE PRECISIONr
c FHCTOPIZHTIUN SECTION
1:
00 4000 J = NbEGPlrNEND
c
C COMPUTE CU SUPEROIRGONF1L ENTRIES OF J-T,, COLU,,,, OF U,,
c IF UNCON‘:TRRINEO
c
JJ = LDfJ+Ia
IF <JJ) 4000.4000.1200
1200 D = HB’J,,
JMJ = IHB:rLD<J, >
Jli = JJ - JMJ
hU = JK - 1
IF tCU.EQ. 0) GO TO 2200
DO 2000 E = 1,y.u
I = J - JY + K
V ,‘b, > = 0.0
II = LD’I+l)
IF (III 2000~2000.1800
LB00 ,I = “IN0 III-IHBS,LDrI,a,k, - ,
I, = JMJ + c
V’IO = HOI,> - DOTPRD IH~II-M>,V’C-llj,fl)
H<IJ, = V*k.>.RtII>
2000 CONTINUE
c
c COMPUTE OIRGONRL ELEMENT D TJ)
c
0 = D - OOTPPD <AtJMJ+I),“.KU,
c
c SINGULRPITY TEST
c
2200 TOLROW = 8. +EPSMFIC*SQRl r” <J> >
IF CABS (0). GT. TOLROW) GO TO 2500
IF <SINGfiB> GO TO 6000
0 = TOLROW
2500 R<JJ, = 1.0/D
C
c UPDRTE DETERIIINANT IF OETCF IS NONZERO
C
-3000 IF <OETCF.EQ. 0. 0) GO TO 3500
OETCF = DETCF*O
3200 IF <ABS (OETCF) .LT. 1.0) GO TO 3400
DETCF = DETCF*. 0625
IDETEX = IDETEX + 4
GO TO 3200
3400 IF (FIBS (DETCF) . GE. .062?5) GO TO 3500
DETCF = DETCF.16.
IOETEX = IDETEX - 4
GO TO 3400
C
C POSITIVE DEFINITNESS CHECK (IF POCHEK = .TRUE.)
C
3500 IF <Q.GT. 0.0) GO TO 4000
NEGEIG = NEGEIG + 1
IF (POCHEK> GO TO 6500
4000 CONTI~~UE
C
C SRVE FFICTOPIZRTION IF IRFILE NE 0 AND N - NEND
r
IF fIRFILE.EQ. 0) GO TO 5000
IF <NEND.NE.NI GO TO 5000
WRITE <IAFILE> 07 (J, ,J==,,NWR>
IF (ICONO.EQ. 0) GO TO 5000
C
C MATRIX CONDITION ESTIHRTION
C
K=O
nwax = 0.0
DO 4200 I = 1,ICOND
C
C SET UP A RANDOM DHS VECTOR IN V
C
CRLL SKYRD” <VI NWA. 0.0, K)
C
c SOLVE FOR V AND DC, ONE CYCLE OF ITERATIVE REFINEMENT TO
C OBTRIN 2-NOR(1 RELRTIVE SOLUTIOW ERROR IN DELTA
C
CALL SKYSOL (A, Nr LD, DOTPRD, 01 -1, VI V<N+l>r
. 1, IRFILE, V<2*N+l>, DELTA)
DMRX = AMRXl IDELTA,OMRX>
4200 CONTINUE
1: .
C.
1: .
I‘.
I: .
z.
4: l
4: .
C.
c*
C.
C.
c*
c.
,: .
1: . WHERE [BF, RND [BC, RYE PPE:CRIBED FtND THE FREE-FFEE POPTION l
c. b3FFl HH: BEEN PPEFHCTOPED INTO CLFFI [DFFI [IJFFI 81’ ;kYFHC. .
c. IIrKE THE CONiTFHINEI! CH’E ENBOI1IEI THE UNCONSTEHINED ONE. THE t
c. FROZE:: DESCFlPTION BELUbl A:‘,LI,,ED H i,,NiTRHINED ‘IITEN. l
C. l
C. .
1: . l
C. l
C. .
c* IOP = 0 : NOR”RL SOLUTION PROCESS .
C. IOP =-I : EXECUTE STRGES 1-2 RND EXIT (USEFUL l
c* IN CERTRIN SUBSTRUCTURING APPLICATIONS~ l
C. IOP = 1 : EXECUTE STFlGES 3-4 AND EXIT (USEFUL .
C. ON STARTING RN INVERSE ITERATION PROCESS,. .
C. l
c+ IBX FLHG CONTROLLING (IUTPUT CONFIGURRTION OF ARRRY B. L
CO .
C. IBX = 0 : B RND X RRE IDENTIFIED IN THE CALLING .
C. PROGRRN. THE SOLUTION VECTOR X THEN OVERWRITES 8. +
Solution of linear equations with skyline-stored symmetric matrix 21
c+ .
c, LB)! = 1 : B AND X FlPE NOT IDENTIFIED IN TWE l
C. .
C1 NOTE - IF THE INPUT SYSTEM CONTRINS NONHOK16WEOUS .
C. I.ONITPAINTC, IBX NUST RE -1 OR +lr I.E., ARRRYS .
c. Et AND ,< MAY NDT SHFIRE THE SANE STORRSE SPACE. .
c. .
CC IPEF IF GT 0, PERFDR” IREF CYCLES OF ITERATXVE .
CI REFINE”ENT OF THE SOLUTION VECTOR. IN PRRCTICE l
c* !,NE SHOULD NOT REQUEST IREF GT 1 Uht_ESS THE .
c. ENTRCE; OF ‘RI HRPPEN TO BE EXRCT NUNBERS l
c* l
c. l
C. l
C+ DELTFI IF IREF 67 0, RRTIQ OF LRST CURRECTION LENGTH .
0. TO FII,AL XLUTION LENGTH. NOT UiED IF fRfF = 0. l
1%. .
C.... 4. COMFION INPUTS - .
C. NONE. .
1:l .
Ct... 5. COMNON INPUT-OUTPUTS - .
c+ NONE. l
c* .
C...+ 6. CONNON [IUT~UTS - l
C-+ NONE. l
c+ .
C.... 7. INPUT FILE- ., - l
c+ .
c* IHFILE 3EE IUBROUTINE ;Fr’FRC. l
c. .
C.I.. 8. JUTPUT FILES - .
C. NONE. .
z:...?.
C.
SCRATCH FILES -
NOI+E.
.
.
.
C. l
C.1.. 10. PRO&RR” SUBROUTINEi - .
CC DOTPRD, X’YMUL l
C. l
Cr... II. LIBRHR’i’ JUHROUTINE6 - .
c. :DPT, FORTRAN BINHRY I/O .
c+ .
f
c T 7 P E HND D I N E N ? I J N I T H T E M E ‘l T ”
C
INTEGER LD’l)
YEHL RI11 I Bll>r XI, BXFRC, DELTR
DEHL PNOWN, ‘i < 1 > , x*.1,, Xl, XNORM
EQUIVALENCE rBI.:xI,:wORN~
C
C INITIHLI~ATION
C
HS”IGN
a 3100 TO NEXT
hREF = 0
B.eHC = *.*
IF IIBX.EQ. Ot al TO 280
BXFAf = 1.0
DO 150 I = ItN
150 x <I ) = B < 1 )
100 IF iIOP.GT.0, 130 TO 1800
1F <IBX.EQ. 0) 50 TO 1100
C
C RHP N 0 D I F I C H T I 0 N
C
DO 1000 I = 1.N
II = LDfI+l>
IF III> 3*0* 1OOOt 1000
300 BI = BfI,
IF <DI.EQ. 0.03 GO TO 1000
II = -11
K = I - II + IABS<LD<I,> + 1
DO 900 J = KIN
JJ = LD(J+li
IF <JJ> 900.Y0~,400
400 M=J-I
IF tN> 50”,600,d00
500 x1,, = xc.0 - A~II+M>*BI
6D TO 900
6(30 IJ = JJ - N
22 C. A. BLIPPA
IF ‘IJ-IHBSrLD(JI~> 900,900,*00
8UO X<J, = xc,> - ATIJ>.BI
900 CONTINUE
1000 CONTINUE
C
C FORWHRD 5 U E 5 T I T CI T 1 0 N PHI’
C
1100 DO 1500 1 = IrN
II = Lncx+1,
IF III, taoo, 1200.1300
1200 XTI, = 0.0
GO TO 1500
1300 IMI = IRBS(LD<I,,
M = II - IMI - 1
XII> = Xii, - DOTPRD ~RII~I+l,rX,,-~‘,M)
1500 CONTINUE
IF cIOP.NE.0) GO TI1 SOOCl
C
C TCHLING P-SC
C
1800 no 2000 I = IrN
II = IfiBxrLntt+i,,
2000 X<I> = A<II,*YcI.I
c
,; B H 1:’ /, : 1, B Z T I T 1, T I J E, PHZ3
I = PI
DO 3000 i = IrN
II = ia*r+u
1F ,,I,, 22uo.2’BOo.240,:,
220n .A II I =
BXFAC.B I Ii
GO
TD 8:300
2400 M = II - IHBSacI,, - I
IF <“.EO.
0, Gil TO L2800
no 2’500 J = t,n
:(.I-J’ = <*.I-,, - +?,,*-_,,.:?:,I,
2500 CONTINUE
2800 I =I - I
3000 CONTINUE
IF sIB:X*IHFILE.EQ. 0, GO TO 4000
GO TO NEXT, i31OI>. 3500,
c
c I T E P H T I ‘I E P E F I II E M E PI T ; E C T I 0 N
c
3100 E:REF = lPEF + 1
IF I~REF-IR~F, 32,,0,3500.4u0l3
i
c CALCULATE RESIDUAL ‘VECTOR [RI = [Bl - [HI [Xl LI:INl: SKYMUL.
I‘ WJ RETURNS IN .?r HNn OLD [Xl IN V
c
3200 REWIND IHFILE
NW = IFIBS rLn n,N+l> )
REHn <InFILE) ~,H’Jl,J=,rNWHI
CRLL iKY”UL ‘.A, N, Ln, X. ‘<, -I, 8, ‘“‘)
C
c 50LVE FOP CORRECTlO,, CI1:*:, sUHICH FlPPEHRZ IN Y’r CORRECT
C OLD :,,LUTION RNn EVHLIJHTE 2-NDR” RELHTIVE ERROF UELTA
,.
RERn I
IHFILE) *‘HIJ~,J=~,NWH)
B%FAC = 0.0
HSEI‘N 3500 TO NEXT
GO TO 1100
3500 XNORN = 0.0
PNORN = 0.0
no 3800 I = 1,N
PrlOPM
= RNORM + i~.Il.XcI,
lirl> = V,‘I) + .<<I>
XNOP” = SNOP” + .S<I,.X~ll
3300 CONTINUE
DELTA = 0.0
IF <XMORM.NE. 0.0) DELTA = CORT <RNORM, XNORPI)
IF <KREF-41 3100r3100~4000
C
C CaN;TPHINEn PH3 R E C 0 V E R Y
,-
-4000 IF <IBY.LE.O~ GO TLI 5000
no 4800 I = 1.N
II = LncI+i>
IF ~11) 4200.4200r4S00
4200 IMI = IRBs~Ln~I)~
M = -II - 1111 - 1
B<I, = DCITPRD ,HllMI+,brX,r-n,,n,
DO 4600 J = IIN
I, = IRBS’LD~J+~;~ + I - J
IF IIJ-IRB~TLD~JI,, 4600.460074400
4400 B<,> = BrIl + H<IJl.ll(J>
4600 CONTINUE
4soo CONTINUE
5000 RETURN
END
DO ~000 x =
1-N
II = IHB’ILD‘I+lI,
i
HXtI> = DBLEcH~II,,*DRLEiXrI,I
tl = II - IABScLDrI>> - 1
IF (ll.EU. 0) GO TO 2000
no is00 K = lrrl
J=I-k
AIJ = R\IX-K.I
,%<*.I, = AX(I) + RIJ*DBLE0ZIJ>)
R%<J, = RXrJ, + HIJ*DBLEiX*I>,
1500 CONTINUE
~000 CONTINUE
r
TF **[lp> 2500.5000.3500
ZOO DO 2800 1 = 1rN
Wl = iixtr,
!?-‘I, = %<I,
XCI, = m_E<B<l~~ - HXI
IF ,LDII+l) .LE. 0) x,1> = 0.
300 CONTINUE
GO TO 5000
3500 DC) 3300 I = f,N
P%Il = *BLE<Brl>, - Fixc1>
IF ~LDII+I>.‘E.O~ R<I> = a.
3300 CCINTINUE
5000 KETUFN
END
C...*.**.*.*.....*r,+rr+r,r**....*.******..**~...***...*..*..***.***.****..*
c+ SKYTEST - TEST PRDGRR” FEiP SIYFRC HND SKYSOL *
Cr+*.*.+*.**.**rr..*..****.**..*.***.**~*...*.*~*********.*.*..***..***.
C* c
C. A TEST CRSE CR3 [Xl = tB1 15 DEFINED BY SIX INTEGER PRRRflETEPS: *
C* .
C. ISKY [AI-SKYLINE TYPE INDEX : I = ‘RHNDOfl’ SKYLINE, *
Ci ? = FIXED-BRND, 3 FULL TRIANGLE .
C. l
c* N 3YSTEN ORDER : 2 THPU NflH:< (SEE DHTR STHTEnENTSl *
CO .
C. LEVC RPPROXIMATE NUMBER OF CONSTRRINED EQURTIONS IN .
c. INTEGER PERCENT <NO CUNSTRRXNTS IF LEVC = 0, .
c. *
C* ICOND A POSITIVE ICOND REQUESTS COMPUTHTION OF RN ESTIHATE *
CO OF THE SPECTRAL CLlNDITION NUMBER OF CR> USING ItDND l
C+ ‘RRNDDM’ VECTZIRS <SEE SUBRnUTINE SKYFAC> t
C‘ l
CO IPEF R POSITIVE IREF PEQUESTS IREF CYCLES OF ITERRTIVE *
c. REFINEMENT WHEN SOLVING FOR [Xl (SEE SUBROUTINE :CYSO,.I *
c. .
C. IDU IF NUNZERO, THE EXRCT RND COMPLITEB FACTOPtZRTION OF l
C. CA1 WILL BE PRINTED. *
CI *
C* IHE SIX PARRtlETERS IISKY,N,LEVC.iCOND,IREFIIIiUi ARE RERD FPllM l
C* CARD INPUT FILE 5 IN <6X4> FOR,,RT. ONE CRPD PER TEST. THE TEST .
c. DATR DECK SHOULD BE TERMINATED BY R BLRNK CARD. t
C. *
c. SKYTEST CRLLS FOUR RUXILIRRY ROUTINES: ;KYLDU, SKYMWP. SkYOPC *
C. RND SKYPRT, WHICH RRE LISTED AFTER SKYTEST. SAWPLE INNEIPRDDUCT +
c. ILlUTINES WHDSE ENTRY POINT NAHES <VIP%. VIP%,> RPE FRSSED IN *
C. ARGUMENT LISTS, RRE FiLSD LISTED. l
C* .
C, SKYTEST ALSO INVOKES THE TIMING FUNCTION CPTIME.. X = CPTIMEiO2 .
c. INITIRLIZES THE CPU CLOCK. X = CPTINE<I) RETURNS CPU TI”E IN l
c. FLORTlNG:POINT SECONDS ELAPSED SINCE THE LF,ST CPTIME<O) CHLL. *
CO THE USER SHOULD INSERT APPRUPIRTE REFERENCES TO NIS SYPTEN *
C. CLOCK RWTINES IF HE DESIRES TO TIllE SKYFRC. l
C* *
C BUILD TEST S Y S T E M
C
C CONSTRUCT DIAGONHL LOCATION POINTER RRRRY IN LD
c
LD(,> = 0
,F (ISKY-2) . 600,500.400
C ISKY= : FULL SYMMETRIC MATRIX
400 DO 450 I = LIN
450 LD<I+l> = LD<I) + I
GO TO 1000
C ISKY= : FIXED-BRND NATRIX (HALFWIDTH M = MAXO<BI O.J*N))
500 M = MAX0<3,2.N15)
DO 550 I = 1111
550 LD<I+,, = LD<I, + NINO<I,M)
50 TO 1000
C ISKY = 1 : ‘Rf,NDOM’ SKYLINE
600 CALL SKYRDM <VI N, 0.5, IRDM>
C = O.G*FLORT(N)
DO 650 1 = 1,N
K = RNRXI (C.VII>, 1.000*>
650 LD<I+l> = LD<Ij + NINO<I,KI
1000 NW,? = IRBSrLD<N+l))
IF <NWA.GT.NWAMRX) GO TO 5400
C
C MHRK HPPROXIMATELY LEVC.NllOO CONSTRAINTS
C ‘RANDOIILY’ ON LD IF LEVC IS NONZERO
C
IF <LEVC.EQ. 0) GO TO 1500
CRLL SKYRDM (VI Nr 0.5-O. Ol*FLORT(LEVC) I IRDFO
DO 1200 I = 1rN
IF <V(I).LT.O.O> LD<I+,) = -LD(I+l>
1200 CONTINUE
C
C SENEPRTE TEZT CD1 HND [ill IN RRRRY DU
C
1500 CRLL ‘ShYHDM <DC,, NUH, 0.0, IRUM,
DO 1600 I = l,N
II = IRBS<LDcI+l)r
1600 DLlrIIl = ,C..DU<II,
IF <IDU.EQ. 0) GO TO 2000
WRITE (6725,
CALL SYYPRT !DU, N, LDr IJPLOW, CHF12.6,, IPPT)
C
RSSEMBLE MHTRlX CR, = CL1 CD1 GUI
r
2000 CRLL SKYLDU rDU, R, N, LD, Vr ‘VIPSD)
WRITE (6.30)
CRLL SKYPRT <A. N. LD, IUPLOW, 6HF12.6.r IPRT)
WRITE c6,32.,
CRLL SKYMRP tR, Np LD, IUPLOW, IPRT,
CRLL SKYOPC (0, NI LD, KOUNT,
c
c GENERATE RRNDOM LHS VECTOR IN XEX HND RSSOCIHTE RHS VECTOR
C [BEX, = IF!, [XEX, IN DOUBLE PRECISION
C
CRLL PKYRDN <XEX, Nt 0.0, IRDM)
CRLL SKYNUL <RI N, LD, XEX, DBEX, 0, DUNMY, DUMMY)
C
C S V ‘i F H C TElT
r
DETCF = 1.0
DUNNY = CPTI”EtOl
CALL SYlFAC CR, 0, N, N, LD, V, VIPSS, SINGRB, PDCHEK,
. ICOND. IHFILE, RCOND, DETCF, IDETEX, NEGEIG. IFRIL,
TOP = 1. E6rCPTIME 111 /FLORT <KOUNT)
WRITE q6.50, SINSRB, PDCHEK, IFRIL. DETCF. IDETEX, NEGEIG
IF <IFHIL.NE. 01 GO TO 100
WRITE r6,54, KOUNT, TOP
IF <ICOND.NE. 0) WRITE ~6.56) HCOND
IF <IDU.EQ. 0) 50 TO 2200
lWPITE (6,60>
CRLL ‘KYPRT (H. N, LDI IUPLOW. 6HFl2.69, IPRTl
c
c SKY:OL TEST
C
C 3ET UP SINGLE PRECISION RHS VECTOR I:
C
2200 DO 2500 I = 1,N
BEXrI, = DBEX(I>
B<I, = BEX(I>
IF rLD<I+l>.LE.O) B(I) = XEX<I>
2500 CONTINUE
C
Solution of linear equations with skyline-stored symmetric matrix 25
REAL ht1,
INTEGER RLhNb 7 CFLHG, C”AEk, DEVICE, NEGRT, POSIT, ZERO
INTEGER La’l!, PlJU160~
DHTA BLHNk,CmARC,POSIT,tiEGRTI:EPO /lH , I!,.. lH+r I,+r IHO,
c
KCMHX = MRX0~30,‘3OrDEVICE>
1000
JREF - 0
1100
JBEG = JPEF + 1
JENR - HINO <JPEF+YC,,AX,N>
kC = JEMD - JREF
JREFPS = JREF + 5
WRITE <6.30, (J. J=JREFPSr ,END,S>
30 FQRRRT 1,7X12,10)
DO 1300 J = JBEG.JEriD
I = J - JREF
ROW\Il = BLRNC
IF (LD(J+l).LE.O, ROWrl) = CMARK
1300 COPlTINUE
WRITE (6,401 tROW<J,rJ=,.bC,
40 FORMHT <8X 60R2,
IBEG = 1
IEND = JEND
IF <IUPLOW.EQ. 1) GO TO ,500
IBEG = JBEG
IEND = N
1500 DO 4000 I = IBEG.IEND
DO 1600 J = lrKC
1600 ROW tJ> = BLHNC
CFLRG = BLhNh
II = LDiI+l>
IF (II.LE.0) CFLHG = CMHYI
J1 = I
J2 = JENIl
IF <IUPLOW.EQ. 11 GO TO ,800
II = IhBS\II>
J1 = I + IhBS(LD(I>’ - I, + 1
Jl = MAX0 rJl.JBEG>
J2 = MIPlO <l,JEMD)
IF lJ.?-J,, 4000, *Boo, lSO0
1800 DO 3000 J = JlrJ2
k = J - JREF
M=J-I
I, = II + II
IF <IUPLOW.NE. 1) GO TO 2000
IJ = IRBS<LD(J+l)a - M
IF !IJ.LE.IABSrLD~J>>> GO TO 3000
2000 IF (h<lJ,> 2200.2400,&00
2200 ROW<K, = NEGRT
GO TO 3000
2400 ROW ib.) = ZERO
GO TO 3000
YOWtkl = POSIT
3000 CUNT 1 NLIE
WRITE t6.60) I, CFLHG, <ROW (h> I K=, I KC>
4000 CONTINUE
60 FORMRT <lX14.‘,3.60R.?>
JREF = JEND
IF (JREF-II) 1100.5000,5000
5000 RETURN
5 1 I> 15 ‘0
. * l .
1 +
2 +-
3 +-+
4 +-+-
5 +
6 +--__+
3 -+++-+-
3 -++---++
9. -+--+++
10. +--++----+-
11 -------+-+++
12 __+____++
13 +
14 +_+__-_-+
15 +-++--+-
16. +-+---+++-+-
17 +---++++---+-+-+
18 -+--+
19, +--_-++--+--+-
20 __+_+-
;;;;tC=EXECUTED WITH CIN‘AB = T, PDCHEK = F
01 DETERMINHNT = -.1393258 . 2.. -24
NEGATIVE EIGENVALUES = 5
OPERATION UNITS = 226
AVG TIME.jOP UNIT = 34.50 MICRDSEC
and should be removed, unless extended double precision case, the routines presented here can be made use of as
arithmetic (e.g. REAL*16 on IBM 370 computers) is follows:
available for the residual calculation in subroutine
1. Use SKYFAC to factor Ag upon marking the tat
SKYMUL.
equations associated with the external freedoms x, as
A slightly more efficient implementation of these
constrained.
procedures is possible if array LD is used to pack the
2. Solve the homogen~usly constrained block system
following information:
(a) diagonal location pointer
(b) local skyline width excluding diagonal
(20)
(c) constraint flag
by submitting to SKYSOL (with argument IBX = 1) nc
into 3 bit fields. Such a version is not presented here since
right hand sides consisting of the n, columns of A&
partial word manipulation with Fortran statements is
completed with zeros on the constraint equation posi-
highly machine dependent.
tions.
APPLICATIONS 3. The condensed matrix A* is
General
A”=A,,-A;X=A,,-3 (21)
The equation solving procedures presented here may be
useful in the following application areas:
so that one should simply substract each column of B (as
1. As fast linear equation solvers for small-scale they are being put out by SKYSOL) from the approp~ate
systems (normally not exceeding 1000equations). This is column of A,, to produce A* in situ (overwriting A,,).
typical of most finite element codes written in universities Note that X is not used.
and research institutions, as well as pilot pro~ms
The reader may verify that the entire process can be
developed in industry for special applications or feasibil-
carried out without prearranging A, and that only two
ity studies of nonlinear or time-dependent problems.
auxiliary moating-lint vectors of length n itre required in
2. As freedom “condensation” processors for iirst-
addition to the A-definition arrays A and LD. The
level superelement analysis. This application is elaborated
reduction (19) of the load vector can be executed in a
in the following subsection.
3. As a conceptual aid in the design and coding stages similar manner.
of the development of large-scale equation solvers based
REFERENCES
on the skyline storage approach.
1. C. A. Felippa, Finite element and finite difference energy
techniaues for the numerical solution of martial differential
Superelement condensation equatidns, Proc. 1973 Summer Comp~fer-S~m~~~~onCffnf.,
Superelement te~hniques[I4] (also called ~subst~ctur- Montreal, Canada, 1-14 (July 1973).
ing’ or ‘tearing’ by structural engineers and ‘dissection’ 2. R. A. Willouahbv, A survev of snarse matrix technoloev. in
or ‘blocking’ by numerical analysts[9]) are model- Tech. Report A&DL-TR-jl-79, ‘Air Force Flight Dyn&&s
pa~itioning procedures intended for a multistage analysis Lab., W~ght-Pa~te~on AFB, Ohio, 65-171 (June 1971).
of complex finite element idealizations. A block of finite 3. .I. K. Reid (ed.), Large Sparse Sets of Linear Equations. pp.
elements modeling a simply connected portion of a 17-24, 41-56, 97-104, 255-277, Academic Press, London,
complex system is called a level one superelement. A (1971).
4. A. George, A survey of sparse matrix methods in the direct
connected set of level one superelements makes a level two
solution of linear equations, Proc. 1973 Summer Computer
superelement and so forth until the complete model is Sjmu~uf~o~Co& Montreal, Canada, U-20 (July 1973).
realized. The fundamental characteristic of the associated 5. A. Jennings, A compact storage scheme for the solution of
matrix assembly process is that ‘internal’ degrees of symmetric simultaneous equations, Comput. J. 9, 281-285
freedom of all superelements of given level (those (Sept. 1969).
freedoms not shared by two or more superelements) are 6. R. J. Melosh and R. M. Bamford, Efficient solution of
reduced out or ‘condensed’ before proceeding to the next load-deflection equations, J. Struct. Div. ASCE, Proc. Paper
level. I\io. 6510, 661-676 (April 1969).
The governing lineart equations for a particular 7. B. M. Irons, A frontal solution program for finite element
analysis, Int. J. Num. Math. Engrg. 2, 5-30 (January 1970).
superelement may be represented by equation (4), in
8. R. P. Tewarson, Sparse ~airjces. Academic Press, New York
which subvector xf collects all internal freedoms whereas (1973).
xc includes external or connected freedoms. Elimination 9. 0. Birkhoff and A. George, Elimination by nested
of x, yields: dissection, in Complexity of Sequential and Parallel Nume~-
A*x, = b” (17) caf Algotithms. J. F. Traub (Ed.), pp. 221-270, Academic
Press, New York, (1973).
where the (symmetric) condensed superelement matrix 10. J. 0. Owens, The influence of machine organization on
A* and right hand side vector b* are given by algorithms, in vol. quoted in[9], 11l-130 (1973).
11. J. H. Wilkinson and C. Reinsch (eds.), Handbook for
Automatic Computatjoa Voi. IX-Linear Algebra Springer,
A* = A, - A$A;’ A, (18) Berlin (1971).
b* = b, - Af:Ai’bf (19) 12. C. Johnson, On the convergence of a mixed finite element for
analysis of plate bending, Num. bats. 21, 43-42 (1973).
13. 5. H. Wilkinson, Rounding Errors in Algebraic Processes.
provided Aff is nonsingular. The matrix condensation
Prentice-Hall, London, 1973.
process (18) can usually be carried out in core for level 14. P. 0. Araldsen, the application of the superelement method in
one (and sometimes level two) su~reiements. If such is the analysis and design of ship structures and machinery
components, presented at the National Symposium on
Computerized Anaiysis and Design, George Washington
~Superelementtechniquesare mosteffectivein linearproblems. University, Washington, D.C. (May 1972).
id.. Vol. 5;No. I-C