Sie sind auf Seite 1von 10

<t>mxmmnm+=.

m%-m ( s i t + A ^ ) 155
Journal of the Chinese Institute of Engineers. Vol. 12, No. 2, pp. 155-164 (1989)

MULTIPLE ROOTS REVERSE CUTHILL-McKEE METHOD FOR


REDUCING THE BANDWIDTH AND PROFILE OF
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

FINITE ELEMENT SYSTEMS

Tsung-Wu Lin
Department of Civil Engineering
National Taiwan University
Taipei, Taiwan 10764, R.O.C.

Key Words: banded matrix, sparse matrix, bandwidth, graph theory,


finite element system.

ABSTRACT
We present an algorithm which uses a new relation vector
called the "adjacent elements of each node" and "multiple roots" to
replace the "adjacent nodes of each node" and "single root", which
are used in the reverse Cuthill-McKee (RCM) method. The "adjacent
elements of each node" can be formed easily from the "adjacent
nodes of each element" which is a basic given array in a finite
element system. The required computer storage is significantly less
than the other methods using "adjacent nodes of each node". The
listing of FORTRAN subroutines for the proposed algorithm is given.
These subroutines can be used directly in the existing finite element
system. Since the required storage is small, these subroutines are
extremely effective for microcomputers.

fc&^m7t$£%ffl®%2.£U%Lfo Cuthill-McKee &

# m m

Wtt-ffiflm&fSj Cuthill-McKee & £ W » rt515£»gSrJ3SJ ^tt&

mntwpmm rt&steasgisisj ±#®jj& ° mmm^mmmmtj

INTRODUCTION bandwidth or profile are required for a large


To analyze a large finite element system, finite element system. The first very successful
storage and solution time are linearly and method is the Cuthill-McKee algorithm (CM) [2].
quadratically proportional to the bandwidth or Once the adjacency array and a starting node
profile of the resulting system matrix, respectively. have been found, it proceeds as follows:
Therefore, efficient algorithms to reduce the (1) Number the starting node #1.
156 Journal of the Chinese Institute of Engineers. Vol. 12, No. 2, (1989)

(2) For i = l , —, N, find all the unnumbered (5) If £(x)>£(r) then set r=x and go to step 3.
neighbors of the node xt and number them Else the node x is a pseudo-peripheral node.
in increasing order of degree. The major problem is once again storage, since
As storage schemes change from banded to it uses the adjacency array also.
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

profile, the emphasis changes to profile minimiza- In summary, all the improved modifications of
tion. It is found that a simple change in the CM the widely used reverse Cuthill-McKee method
algorithm improves its profile without hurting its (RCM method) are based on graph theory and
bandwidth properties [3, 7]. This modification require the storage of an "adjacent array" (we
merely reverses the numbering that results from have renamed it as "adjacent nodes of each node")
the original algorithm. That is to add the step: which gives a list of the nodal connectivity, and
(3) The reverse Cuthill-McKee ordering is a few other arrays with the length of the number
given by yu y2, —, yN where y,=xN-i+\ of equations. The length of the "adjacent nodes
for i = l , - , N. of each node" is exceedingly large for a large
This variation was given the name of the finite element system. A method which does not
reverse Cuthill-McKee (RCM) algorithm. The use the adjacency array had been introduced
problems with this method are, first, finding a recently [6]. The algorithm is named the "profile-
starting node, and second, the storage and work front minimization" (PFM) and is specially imple-
involved in setting up the adjacency array can mented for the well-known "frontal method". The
be extremely large. The storage for higher order algorithm follows the style of "frontal method",
elements can well exceed the size of the stiffness using element-node data and renumbering the
matrix. order of the elements.
For the starting node, a very effective method In this paper, we propose a new relation vector
was introduced [4, 5]. The algorithm tries to find to replace the "adjacent nodes of each node".
a pair of nodes which are at maximum or near This is called the "adjacent elements of each
maximum distance apart. The nodes produced by node". The "adjacent elements of each node"
this algorithm are called "pseudo-peripheral nodes". can form easily from the "adjacent nodes of each
A key construct in the algorithm is the rooted element", which are in a basic given array in
level structure [1]. Given a node ^ in a set {X}, a finite element system. The length of the
the level structure rooted at x is the partitioning "adjacent elements of each node" is very short
L(x) of {X} satisfying and equal to the length of the "adjacent nodes
of each element". For example, in a finite element
L(x)={L0(x), U{x), •••, LtM(x)} system with 1,000 9-node quadrilateral elements,
the length of the "adjacent array" is about 60,000,
where
but the length of the "adjacent elements of each
L0(x)={x} node" is only 9,000.
In order to use the "adjacent elements of
L1(x)=AdjlLo(x)l each node" efficiently, the degree of the node is
redefined as the number of connected elements of
Li(x)=Adj[Li^(x)l-Li.2(x), i=2, 3, - , £(x) the node instead of the number of adjacency nodes
AdjlL^x)^ the adjacency nodes of the level L,{x) of the node used in the RCM method. With this
and £(x) is called the length of L{x). change, the nodes with fewer numbers of connected
The bandwidth of the matrix resulting from elements are leveled earlier.
the level structure is proportional to the width of Beside changing the basic array from the
L(x) which is defined by "adjacent nodes of each node" to the "adjacent
elements of each node", we have also modified the
w{x)=max[_\Ux)\,O<Li<,t(x)-\ rooted level structure rooted on multiple nodes,
which can reduce bandwidth for most cases. By
where | £,,(*)I = the number of nodes in the level
computing the profile during the levelling and
Ux). ordering, we can compare the profile of each level
Based on the rooted level structure, the pseudo-
structure and select the level structure with the
peripheral nodes finding algorithm is as follows:
smaller profile.
(1) Choose an arbitrary node r.
(2) Construct the level structure rooted at r:
IMPLEMENTATION
L(r)={L0(r), Lfc), - , L«,,(r)}.
(3) Choose a node x in LiM(r) of minimum The storage for the multiple roots reverse
degree (of connected nodes). Cuthill-McKee method (MRRCM method) consists
(4) Construct the level structure rooted at x: of two pairs of connectivity array, (JOEP, JOES)
and (EOJP, EOJS), and a vector, LVSN, containing
L(x)={L(x), L(x), -., L(x)}. the final nodal numbering.
T. W. Lin: Multiple Roots RCM Method for Reducing the Bandwidth and Profile of Finite Element Systems 157

JOEP(NELM+\), JOES\_JOEP{NELM+\)-\] Else if LENGTH(x)= LENGTH(r) and


is the element connectivity array pair, where BANDWIDTH(x)=BANDWIDTH(r) and
NELM is the number of elements in the finite PROFILE(x)<PROFILE(r) then set r=x
element system. The array JOES contains the list and go to step 3.
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

of the nodes contained in each element, named Else the node x is a pseudo-peripheral
"adjacent nodes of each element". The array node.
JOEP contains the pointers for the the JOES (6) Let all the nodes in the last k (k>0) level
array such that the nodes contained in the /th act as multiple roots, and the order of
element are JOES[JOEP(I)l JOES[JOEP(I)+ll these roots is the reverse order from step
-, JOES[JOEP(I+l)-1]. 4. Construct the level structure and
EOJP(NODE+l), EOJS[EOJP(NODE+l)-1] compute the correspondent PROFILE(x's).
is the node connectivity array pair, where NODE (7) If PROFILE(x's)<PROFILE(x) then use
is the number of nodes in the finite element the level structure with multiple roots.
system. The array EOJS contains the list of Else use the level structure with single
elements connected to each node and is named root x.
"adjacent elements of each node". The array In the modified multiple roots level structure
EOJP contains the pointers for the EOJS array (step 6), the root level Lo( ) includes more than
such that the elements connected to the Jth one node instead of only one node. The leveling
node are EOJSlEOJP(J)l EOJS[EOJP(J)+1], - , procedure for partitioning {X} is the same as that
EOJS[EOJP(J+1)-1]. for the single rooted level structure.
LVSN(NODE) is a vector containing the final The reason to make this modification is
ordering such that the /th new node is the because of the observation that the bandwidth of
LVSN(I)th old node. the beginning portion of the ordering is larger
The element connectivity array pair JOEP and than the others. Putting the nodes in the last k
JOES, the number of elements NELM, and the levels in the root level LQ{ ) just keeps the
number of nodes NODE are the total required ordering of the last k levels of the previous level
input for the MRRCM method. structure. We use this multiple roots level
The node connectivity array pair is setup by structure only if its width is smaller than the
the subroutine FEMRCM from the element connec- previous single root level structure.
tivity array pair by the following steps: The multiple roots method can also be used in
(1) For each element, add 1 to the number of a general RCM method using the "adjacent nodes
connected elements of its connected nodes. of each node", though it is not suggested by
(2) Setup pointer array EOJP. having the more effective method use "adjacent
(3) For each element, put the element number elements of each node". The original RCM
into the list of its connected nodes. method can still be used in low order finite
After completing the connectivity array pair elements or beam elements in most structural
with "adjacent elements of each node", the nodes analysis. Therefore, we also provide an efficient
can be leveled to the general RCM method with procedure to setup the "adjacent nodes of each
the following steps (subroutine EMRRCM): node" from the "adjacent nodes of each element".
(1) Choose an arbitrary node r. In the general RCM method, the "adjacent
(2) Construct the level structure rooted at r\ nodes of each node" is represented by the array
pair, JAJP(NODE+\), JAJS[JAJP(NODE+l)-\l
W)={Ukr), Ur), -.., L«,,(r)}. The array JAJS contains the list of the nodes
connecting to each node. The array JAJP contains
Compute BANDWIDTH(r) & PROFILER) the pointers for the JAJS array such that the nodes
in addition to LENGTH(r)=£(r). connecting to the Jth node are JAJSIJAJP(J)].
(3) Choose a node x in L/M(r) of minimum JAJS[JAJP(J)+1], •», JAJS[JAJP(J+1)-11 The
degree (of connected elements). length of JAJS is equal to 2- EDGE, where EDGE
(4) Construct the level structure rooted at x\ is the number of the edges in the graph.
Before we can construct the array pair,
L(x)={L0(x), U{x\ »., LtM(x)}. (JAJP, JAJS), we must know the degrees of each
node deductively. It is difficult to count the
Compute BANDWIDTH(x) & PROFILE(x) degrees of each node directly from the "adjacent
in addition to LENGTH(x)=£(x). nodes of each element", because the same node
(5) If LENGTH(x)>LENGTH(r) then set r=x will belong to more than one element, and in order
and go to step 3. to ignore the node repeated in the other elements
Else if LENGTH(x)=LENGTH(r) and the adjacent nodes of each node should be stored
BANDWIDTH(x)<BANDWIDTH(r) then during the counting process.
set r—x and eo to step 3. To overcome this difficulty, we use a so-called
158 Journal of the Chinese Institute of Engineers. Vol. 12, No. 2. (1989)

Table 1. Comparison of results

Element Mesh Number Number Bandwidth Profile Storage


type* of of
type nodes elements PFM RCM MRRCM PFM RCM MRRCM RCM MRRCM
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

4-node 53x3 16 9 S 8 8 75 75 75 84 36
9-node S3x3 49 9 25 25 25 457 457 457 576 81
4-node £3x4 20 12 9 8 8 98 98 98 110 48
9-node /?3x4 63 12 25 25 25 612 612 612 762 108
4-node R5X15 96 75 10 14 8 704 716 716 640 300
9-node K5xl5 341 75 41 41 27 4,907 5,067 5,299 4,620 675
4-node W3x40 160 120 — 16 10 — 1,490 1,473 1,040 480

5=square, /J=rectangular, A/=ring.

"adjacent linked lists" array pair, HEAD(NODE), bandwidth and profile are the same for the three
LINK(2,2-EDGE). HEAD(J) contains the pointer algorithms PFM, RCM and MRRCM. In the other
LOC to the location of the first adjacent node of cases, MRRCM method has much smaller band-
node J. LINK(\, LOC) is the adjacent node of width than the other methods, but the profile is a
node J. LINK(2, LOC) contains the pointer to the little larger.
next adjacent node of node J. If LINK(2, LOC)<Q Finally, we note that the storage required by
then LINK(\, LOC) is the last adjacent node of the MRRCM method is only a small fraction of
node J. that required by the RCM method. The required
The length of the array LINK is twice the storage ratio is 1:7 for 9-node elements and 1:2.5
length of the array JAJS, and the array pair for 4-node elements. For a higher order of
(JAJP, JAJS) is more efficient than the array pair elements, the ratio must be much smaller than the
(HEAD, LINK) in the RCM method. The length lower order of elements as shown in these
of the array LINK can be reduced to half by examples.
linking the adjacent nodes whose node number
is larger than the node number J. This is called
the "lower adjacent linked lists". It is enough CONLUSIONS
for obtaining the degrees of the nodes but not
efficient enough for using it in an RCM algorithm. The presented algorithm uses only a small
During the construction of the "lower adjacent fraction of the computer storage required by the
linked lists", we can count the connected degrees RCM algorithm, and therefore can be easily used
of each node. After that, we get the degrees of in a microcomputer. With the multiple roots
each node, and then we restart to construct the feature, we can get a smaller bandwidth than the
array pair (JAJP, JAJS). Note that the lengths RCM and PFM algorithms.
of the array JAJP and LINK are equal and they The provided subroutines can be implemented
can share the same memory space. It is also into any existing finite element analysis program
interesting to note that the purpose of constructing without any further modification as the finite
the "lower adjacent linked lists" is merely to get element program provides the required array pair
the degrees of each node, and it is worthwhile to (JOEP, JOES) to represent the "adjacent nodes
do so because it saves a lot of memory space. of each element".
The subroutine GRAPHS is used to setup the
array pair (JAJP, JAJS) by the presented
algorithm. Then the subroutine GENRCM is REFERENCES
called up to get the new ordering LVSN by the
multiple roots RCM method. 1. Arany, I., W.F. Smyth, and L. Szoda, "An
Improved Method for Reducing the Bandwidth
of Sparse Symmetric Matrices," Inf. Process.
RESULTS AND COMPARISON 71: Proc. IFIP Congress, Amsterdam, North-
Holland, pp. 1246-1250 (1972).
In order to test the presented algorithm, the 2. Cuthill, E. and J. McKee, "Reducing the
algorithm was applied to several rectangular and Bandwidth of Sparse Symmetric Matrices,"
ring type meshes. Rectangular and ring type Proc. ACM Natl. Conf., New York, pp. 157-172
meshes were chosen since the minimum bandwidth (1969).
numbering was already known. 3. George, A., "Computer Implementation of the
In the first 4 cases of Table 1, the resulting Finite Element Method," Tech. Rept. STAN-
T. W- Lin: Multiple Roots RCM Method for Reducing the Bandwidth and Profile of Finite Element Systems 159

CS-71-208, Computer Science Department, C** Setup a list of the element connected to
Stanford University, Stanford, CA (1971). each node
4. Gibbs, N., W. Poole, and P. Stockmeyer, "An C** Given LVSN(J) as the degree of node J
Algorithm for Reducing the Bandwidth and C**
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

Profile of a Sparse matrix," SIAM J. Numer. EOJP{\)=\


Anal., Vol. 13, No. 2, pp. 235-251 (1976). Do 200 NOD=1, NODE
5. Gibbs, N., W. Poole, and P. Stockmeyer, "A EOJP(NOD+l)=EOJP(NOD)+LVSN(NOD)
Comparison of Several Bandwidth and Profile 200 LVSN(NOD)=EOJP(NOD)
Reduction Algorithm," ACM Trans. Math. Do 280 MEM=\, NELM
Software, Vol. 2, No. 4, pp. 322-330 (1976). JSTRT=JOEP(MEM)
JSTOP=JOEP(MEM+1)-1
6. Hoit, M. and E. L. Willson, "Anequation If (JSTRT. GT. JSTOP) go to 280
Numbering Algorithm Based on a Minimum Do 270 J=JSTRT, JSTOP
Front Criteria," Comput. Struct., Vol. 16, No. NOD=JOES(J)
1-4, pp. 225-239 (1983). K=LVSN(NOD)
7. Liu, W. and A. Sherman, "Comparative LVSN(NOD)=K+1
Analysis of the Cuthill-McKee and the Reverse 270 E0JS(K)=MEM
Cuthill-McKee Ordering Algorithms for Sparse 280 Continue
Matrices," SIAM J. Numer. Anal., Vol. 13, C**
No. 2, pp. 197-213 (1977). Do 500 N0D=\, NODE
500 EOJP(NOD)=-EOJP(NOD)
APPENDIX NBGN=\
Do 600 MID 111, NODE
If (EOJP(NOD). GT. O) go to 600
Subroutine FEMRCM {JOEP, JOES, LVSN, Call EMRRCM [NOD, JOEP, JOES, EOJP,
EOJP, EOJS, NELM, NODE) EOJS, LVSN(NBGN), NELM, NSIZ]
Integer JOEP{\), JOES{\), LVSN(l), EOJP(l) NBGN= NBGN+ NSIZ
EOJS(l) If (NBGN. GT. NODE) return
C** 600 Continue
C** Input: JOEP, JOES, NELM, NODE Return
C** Output: EOJP, EOJS, LVSN End
C**
C** JOEP(NELM+l), JOESUOEP(NELM+1)-U Subroutine EMRRCM (IROOT, JOEP, JOES,
C** Nodes of element / are EOJP, EOJS, LVSN, NELM, NSIZ)
JOES[JOEP(I)l -, JOESlJOEP(I+l)-n Integer JOEP{\), JOES(l), EOJP(l), EOJS(l),
C** LVSN(l), LVBGiX), ROOT data KLVL/2/,
C** EOJP(NODE+1), EOJS[EOJP(NODE+1)-W MAXINT/32161/
C** Elements of node J are C**
EOJS\_EOJP(J)\ -, EOJSlEOJP(J+\)-\~] Root=IROOT
C** IROO=0
C** LVSN(NODE): vector contains the RCM NLVL=0
ordering NBND=MAXINT
C** LVSN(\), LVSN(NODE)=o\d node numbers NPRF=MAXINT
of the first and the last new nodes 100 NSIZ=l
C** LVSN(NSIZ)=ROOT
C** Set LVSN(J) temporarily as the degree of EOJP(ROOT)=-EOJP(ROOT)
node J 110 NLVO=NLVL
C** NBN0=NBND
Do 100 N0D=\, node NPRO=NPRF
100 LVSN(NOD)=0 NLVL=0
Do 180 MEM=\, NELM NBND=0
JSTRT=JOEP(MEM) NPRF=0
JSTOP=JOEP(MEM+\)-1 LVEND=0
If (JSTRT. GT. JSTOP) go to 180 Do 120 K=l, KLVL
Do 170 J= JSTRT, JSTOP 120 LVBG{K)=\
NOD=JOES(J) C**
170 LVSN(NOD)=LVSN(NOD)+1 C** LVBGN and LVEND are pointers to the
180 Continue beginning and the end of this level
C** C**
160 Journal of the Chinese Institute of Engineers. Vol. 12. No. 2. (1989)

200 NLVL=NLVL+l 270 LVSN(JXP+1)=JY


LVBGN=LVEND+\ If (JYP. LT. NJY) go to 250
LVEND=NSIZ Go to 380
Do 210 K=2, KLVL C**
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

210 LVBG(K-\)=LVBG(K) C** Compute the exact profile of RCM ordering


LVBG(KLVL)=LVBGN C** By reducing the profile of CM ordering
C** C**
C** Generate the new level by finding all the 320 If (NSAV. LE. I) go to 360
masked unleveled neighbors of nodes in NOD=LVSN(NSAV)
this level Do 340 K=KSTRT, KSTOP
C** MEM=E0JS(K)
Do 400 I=LVBGN, LVEND JSTRT=IABSIJOEP(MEM)-]
NOD=LVSN(I) JSTOP=IABS[JOEP(MEM+1)1-1
KSTRT= IABS\_EOJP(NOD)] Do 340 J=JSTRT, JSTOP
KSTOP= IABSIEOJP(NOD+1)]-1 If IJOES(J). EQ. NOD)'] go to 360
If (KSTRT. GT. KSTOP) go to 400 340 Continue
C** NSAV=NSAV-l
NSAV=NSIZ Go to 320
Do 240 K=KSTRT, KSTOP 360 NDIF=NSAV-I
MEM=E0IS(K) C**
If UOEP(MEM). LT. O] go to 240 380 NBND=MAXO(NBND, NDIF)
JOEP(MEM)=-JOEP(MEM) NPRF= NPRF+ NDIF
JSTRT=IABSUOEP(MEM)] 400 Continue
JSTOP=IABS[JCEP(MEM+\)]-1 If (NSIZ. GT. LVEND) go to 200
C** If (JSTRT. GT. JSTOP) go to 240
C** C**
Do 230 J=JSTRT, JSTOP C** No more node in the new level
NOD=JOES(J) C** Compare the length (width, profile) of two
If [EOJP(NOD). GT. O] go to 230 level structures
EOJP(NOD)=- EOJP(NOD) C**
NSIZ-NSIZ+l 405 Format ['0** ROOT, NLVL, NBND, NPRF/
LVSN{NSIZ)=NOD LVSN(*)=', 4/8/(10/8)]
230 Continue Write (6, 405) ROOT, NLVL, NBND, NPRF,
240 Continue ILVSN(I), 1=1, NSIZ]
C** If {ROOT. EQ. IABS(IROO). or. NLVL. EQ.
If (NSAV. GE. NSIZ) go to 320 NSIZ] go to 800
NDIF=NSIZ-I C**
NJX=NSAV+\ If (NLVL-NLVO) 700, 420, 450 ,
NJY=NSIZ 420 If (NBND-NBNO) 450, 430, 700 .
If (NJX. GE. NJY) go to 380 430 If (NPRF-NPRO) 450, 800, 700
C** C**
C** Shaker sorting LVSN(NJX) - LVSN(NJY) C** Find new root from the last level with
in increasing order of degree • minimum degree
C** C **
JYP=NJX 450 IROO=ROOT
250 JXP=JYP . MINDEG=NSIZ
JYP=JYP+1 Do 500 I=LVBGN, LVEND
JY=LVSN(JYP) NOD=LVSN(I)
JYT=IABSZEOJP(JY+1)] NDEG=IABS\_EOJP(NOD+l)-]
-IABS[.EOJP(JY)] -IABSIEOJP(NOD)]
C** If (NDEG. GE. MINDEG) go to 500
260 JX=LVSN(JXP) MINDEG=NDEG
JXT=1ABSLEOJP(JX+1)] R00T=N0D
-IABS[EOJP(JX)] 500 Continue
If (JXT. LE. JYT) go to 270 C**
LVSN(JXP+\)=JX 550 Do 600 7=1, NSIZ
JXP=JXP-\ NOD=LVSN(I)
If {JXP. GE.NJX) go to 260 600 EOJP(NOD)=-EOJP(NOD)
C** Do 620 MEM=\, NELM
T. W- Lin: Multiple Roots RCM Method for Reducing the Bandwidth and Profile of Finite Element Systems 161

620 JOEP(MEM)=IABSUOEP(MEM)-] 100 JAJT(J)=0


Go to 100 C**
C** Do 180 IE=1, NELM
C** Reconstruct previous level structure NJA=JOEP(IE)
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

C** NJB=JOEP(IE+1)-1
700 ROOT=IROO If (NJA. GT. NJB) go to 180
Go to 550 Do 170 KX=NJA, NJB
C** JX=JOES(KX)
C** Reverse the Cuthill McKee ordering Do 160 KY=NJA, NJB
C** JY=JOES(KY)
800 NS=NSIZ/2 If {JX. GE. JY) go to 160
L=NSIZ JXP=JAJP(JX)
Do 900 1=1, NS If (JXP. LE. O) go to 130
NOD=LVSN(I) C*# Test if node JY is already in adjacency lists
LVSN(I)=LVSN(L) of node JX
LVSN(L)=NOD 120 If UAJS(JXP). EQ. JY] go to 160
900 L=L~\ JXN=JAJS(JXP+1)
Do 920 MEM=\, NELM If (JXN. LE. O) go to 140
920 JOEP(MEM)=IABS[J0EP(MEM)] JXP=JXN
If {NPRF. GT. NPRO) go to 550 Go to 120
If (IROO. LT. O) return C**
IROO=-ROOT C** Pointer to the first adjacency node
c** 130 JAJP(JX)=NEXT
C** Use all nodes in the last KLVL levels as Go to 150
c** multiple roots C** Pointer to the next adjacency node
c**
C** 140 JAJS(JXP+1)=NEXT
I\=LVEND-LVBG{\)+2 C** Put adjacency node at the end of list
• Do 960 1=11, NSIZ 150 JAJS(NEXT)=JY
NOD=LVSN(I) JAJS{NEXT+1)=-JX
960 EOJP(NOD)=-EOJP(NOD) C** Update pointer
NSIZ=I1-1 NEXT=NEXT+2
Go to 110 C ** Update degrees of nodes JX and JY
End JAJT(JX)=JAJT{JX)+1
JAJT{JY)=JAJT(JY)+1
Subroutine GRAPHS (JOEP, JOES, JAJT, 160 Continue
JAJP, JAJS, NELM, NODE, NEDG) 170 Continue
Dimension JOEP(1), JOES(1), JAJTil), 180 Continue
JAJP(l), JAJS(l) C** •
C** C ** Setup adjacency structure for RCM method
C** Input: JOEP, JOES, NELM, NODE C** Given JAJT(J) as the degree of node J
C** Output: JAJP, JAJS, JAJT, NEDG C**
C** JAJP(1)=1
C** JOEP(NELM+1), JOESUOEP(NELM+iy-ll Do 200 J = l , NODE
C** Nodes of element / are JAJP(J+1)=JAJP(J)+JAJT(J)
JOESUOEP(I)l -, JOESUOEP(I+l)-n 200 JAJT(J)=0
C** C**
C** JAJP{N0DE+\), JAJSUAJP(NODE+1)-U Do 280 IE=1, NELM
C ** Adjacency nodes of node J are NJA=JOEP(IE)
JAJS[JAJP(J)J, -, JAJS[JAJP(J+1)-1] NJB=JOEP(IE+1)-1
C** If (NJA. GT. NJB) go to 280
C** JAJT(NODE): Degree of node J is JAJT{J) Do 270 KE=NJA, NJB
C** JX=JOES{KX)
C** Setup temporarily lower adjacency linked lists JXT=JAJT(JX)
C ** Adjacency nodes of J are Do 260 KY=NJA, NJB
JAJSUAJP(J)IJAJS{JAJSIJAJP(J)+1~]}, JY=JOES{KY)
JAJS{JAJS{JAJSUAJP(J)+n+l}}, - If (JX EQ. JY) go to 260
Next=l JXP=JAJP(JX)
Do 100 J = l , NODE If (JXT. EQ. O) go to 250
JAJP{J)=-J Do 240 JT=1, JXT
162 Journal of the Chinese Institute of Engineers. Vol. 12. No. 2, (1989)

If UAJS(JXP). EQ. JY1 go to 260 C** Set LVSN(J) temporarily as the degree of
240 JXP=JXP+1 node J
250 JAJS(JXP)=JY C**
JXT=JXT+\ Do 250 J=\, NODE
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

260 Continue 250 LVSN(J)=XADJ(J+l)-XADJ(J)


270 JAJT(JX)=JXT C**
280 Continue Do 380 .7=1, NODE
C** NJX^XADJ(J)
Do 380 J=\, NODE NJY~XADJ(J+\)-\
NJX=JAJP(J) If {NJX. GE. NJY) go to 380
NJY=JAPJ(J+\)-\ C**
If (NJX. GE. NJY) go to 380 C** Shaker sorting ADJN(NJX) - ADJN(NJY)
C** in increasing order of degree
C** Shaker sorting JAJS(NJX) - JAJS(NJY) C**
C** In increasing order of degree JYP=NJX
C**
330 JXP=JYP
JYP=NJX JYP=JYP+l
330 JXP=JYP JY=ADJN(JYP)
JYP=JYP+\
JYT~LVSN(JY)
JY=JAJS(JYP)
C**
JYT=JAJT(JY)
C** 340 JX=ADJN(JXP)
340 JX=JAJS(JXP) JXT=LVSN{JX)
JXT=JAJT(JX) If {JXT. LE. JYT) go to 350
If {JXT. LE. JYT) go to 350 ADJN(JXP+1)=JX
JAJS(JXP+\)=JX JXP=JXP-\
JXP=JXP-\ If (JXP. GE. NJX) go to 340
If (JXP. GE. NJX) go to 340 C**
C** 350 ADJN(JXP+l)=JY
350 JAJS(JXP+1)=JY If (JYP. LT. NJY) go to 330
If (JYP. LT. NJY) go to 330 380 Continue
380 Continue C**
C** Do 500 J=\, NODE
C** Compute the numbers of the edges 500 XADJ(J)=-XADJ(J)
C** C**
NEDG=JAJP(NODE+l)-1 NBGN=l
Return Do 600 J=l, NODE
End If [XADJ(J). GT. O] go to 600
Call MRRCM [J, XADJ, ADJN,
Subroutine GENRCM (NODE, XADJ, ADJN, LVSN(NBGN), NSIZ^
LVSN) NBGN=NBGN+NSIZ
Integer XADJ(l), ADJN(l), LVSN(l) If (NBGN. GT. NODE) return
C** 600 Continue
C** Input: XADJ, ADJN, NODE Return
C** End
C** XADJ(N0DE+\),
ADJNIXADJ(NODE+1)-1 ] Subroutine MRRCM (IROOT, XADJ, ADJN,
C** Adjacency nodes of node J are LVSN, NSIZ)
ADJNIXADJ(J)], -, Integer XADJ(\), ADJN(\), LVSN(\),
ADJN[XADJ(J+l)-U in increasing order LVBG(2), ROOT
of degree sorted by this subroutine • Data KLVL/V, MAXINT/32161/
C** ROOT=IROOT
C** Output: LVSN, ADJN (sorted by degree) IROO=Q
C** NLVL=0
C** LVSN(NODE): vector contains the RCM NBND=MAXINT
ordering NPRF=MAXINT
C** LVSNO), LVSN(NODE)=o\d node numbers 100 NSIZ = I
of the first and the last new nodes LVSN(NSIZ)=R00T
C** XADJ(ROOT)=-XADJ(ROOT)
T. W. Lin: Multiple Roots RCM Method for Reducing the Bandwidth and Profile of Finite Element Systems 163

110 NLVO=NLVL C**


NBNO-NBND 405 Format ['0** ROOT, NLVL, NBND,
NPRO=NPRF NPRFJLVSN(*)=', 4/8/(10/8)]
NLVL-Q Write (6, 405) ROOT, NLVL, NBND, NPRF,
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

NBND=0 ILVSN(I), 1=1, NSIZ}


NPRF=0 If [ROOT. EQ. IABS(IROO). OR. NLVL.
LVEND=0 EQ. NSIZ] go to 800
Do 120 K=\, KLVL
If (NLVL-NLVO) 700, 420, 450
120 LVBG(K)=\
420 If (NBND-NBNO) 450, 430, 700
C**
430 If (NPRF-NPRO) 450, 800, 700
C** LVBGN and LVEND are pointers to the
C*#
beginning and the end of this level C** Find new root from the last level with
C** minimum degree
200 NLVL=NLVL+1 C**
LVBGN=LVEND+1
LVEND=NSIZ 450 IROO-ROOT
Do 210 K=2, KLVL MINDEG=NSIZ
210 LVBG(K-1)=LVBG(K) Do 500 1= LVBGN, LVEND
LVBG{KLVL)=LVBGN NOD=LVSN(I)
C** NDEG=IABSIXADJ(NOD+1)]
C** Generate the new level by finding all the - IABS[XADJ( NOD)]
masked unleveled neighbors of nodes in If (NDEG. GE. MINDEG) go to 500
this level MINDEG=NDEG
C** ROOT=NOD
Do 400 / = LVBGN, LVEND 500 Continue
NOD=LVSN(I) C**
JSTRT=IABSIXADJ(NOD)] 550 Do 600 / = 1 , NSIZ
JSTOP=IABSlXADJ(NOD+iy\-1 NOD=LVSN(I)
If (JSTRT. GT. JSTOP) go to 400 600 XADJ(NOD)=-XADJ(NOD)
NSAV^NSIZ Go to 100
Do 300 J=JSTRT, JSTOP C**
NOD=ADJN(J) C** Reconstruct previous level structure
If LXADJ(NOD). GT. O] go to 300 C**
XADJ{NOD)=-XADJ{NOD) 700 ROOT^IROO
NSIZ=NSIZ+1 Go to 550
LVSN(NSIZ)NOD C** Reverse the Cuthill McKee ordering
300 Continue
C** C**
C** Compute the exact profile of RCM ordering 800 NS=NSIZ/2
by reducing the profile of CM ordering L=NSIZ
C** Do 900 I=\, NS
NDIF=NSIZ-I NOD=LVSN(I)
If (NSAV. LT. NSIZ) go to 380 LVSN(I)=LVSN(L)
320 If (NSAV. LE. I) go to 360 LVSN(L)=NOD
NOD=LVSN(NSAV) 900 /,=/.-1
Do 340 J=JSTRT, JSTOP If (NPRF. GT. NPRO) go to 550
If IADJN(J). EQ. NODI go to 360 If (IROO. LT. O) return
340 Continue IROO=-ROOT
NSAV=NSAV-1 C**
Go to 320 C** Use all nodes in the last KLVL levels as
360 NDIF=NSAV-I multiple roots
380 NBND=MAXO(NBND, NDIF) C**
NPRF=NPRF+NDIF Il=LVEND-LVBG(l)+2
400 Continue Do 960 1=11, NSIZ
If (NSIZ. GT. LVEND) go to 200 NOD=LVSN(I)
C** 960 XADJ(NOD)=-XADJ(NOD)
C** No more node in the new level NSIZ =11-1
C ** Compare the length (width, profile) of two Go to 110
level structures End
164 Journal of the Chinese Institute of Engineers. Vol. 12, No. 2. (1989)

Discussions of this paper may appear in the Manuscript Received: June 21, 1988;
discussion section of a future issue. All discussions Accepted: December 2, 1988.
should be submitted to the Editor-in-Chief.
Downloaded by [NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY], [Professor JCIE JCIE] at 19:57 18 May 2015

Das könnte Ihnen auch gefallen