* D06CCF Example Program Text * Mark 20 Release. NAG Copyright 2001. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER NBEDMX, NVMAX, NNZMAX, LRWORK, LIWORK PARAMETER (NBEDMX=100,NVMAX=300,NNZMAX=10*NVMAX, + LRWORK=NVMAX,LIWORK=20*NVMAX) * .. Local Scalars .. INTEGER I, I1, IFAIL, ITRACE, K, NEDGE, NELT, NNZ, NV, + REFTK CHARACTER PMESH * .. Local Arrays .. DOUBLE PRECISION COOR(2,NVMAX), RWORK(LRWORK) INTEGER CONN(3,2*NVMAX+5), EDGE(3,NBEDMX), ICOL(NNZMAX), + IROW(NNZMAX), IWORK(LIWORK) * .. External Subroutines .. EXTERNAL D06CBF, D06CCF * .. Executable Statements .. * WRITE (NOUT,*) 'D06CCF Example Program Results' WRITE (NOUT,*) * * Skip heading in data file * READ (NIN,*) * * Reading of the geometry * READ (NIN,*) NV, NELT, NEDGE * IF (NV.GT.NVMAX .OR. NEDGE.GT.NBEDMX) THEN WRITE (NOUT,*) 'Problem with the array dimensions ' WRITE (NOUT,99999) 'NV MAX ', NV, NVMAX WRITE (NOUT,99999) 'NEDGE MAX ', NEDGE, NBEDMX STOP END IF * DO 20 I = 1, NV READ (NIN,*) COOR(1,I), COOR(2,I) 20 CONTINUE * DO 40 K = 1, NELT READ (NIN,*) CONN(1,K), CONN(2,K), CONN(3,K), REFTK 40 CONTINUE * DO 60 I = 1, NEDGE READ (NIN,*) I1, EDGE(1,I), EDGE(2,I), EDGE(3,I) 60 CONTINUE * READ (NIN,*) PMESH * * Compute the sparsity of the FE matrix * from the input geometry * IFAIL = 0 CALL D06CBF(NV,NELT,NNZMAX,CONN,NNZ,IROW,ICOL,IFAIL) * IF (PMESH.EQ.'N') THEN WRITE (NOUT,*) 'The Matrix Sparsity characteristics' WRITE (NOUT,*) 'before the renumbering' WRITE (NOUT,99998) 'NV =', NV WRITE (NOUT,99998) 'NNZ =', NNZ ELSE IF (PMESH.EQ.'Y') THEN * * Output the sparsity of the mesh to view it * using the NAG Graphics Library * WRITE (NOUT,99997) NV, NNZ DO 80 I = 1, NNZ WRITE (NOUT,99997) IROW(I), ICOL(I) 80 CONTINUE ELSE WRITE (NOUT,*) 'Problem with the printing option Y or N' STOP END IF * * Call the renumbering routine and get the new sparsity * IFAIL = 0 ITRACE = 1 CALL D06CCF(NV,NELT,NEDGE,NNZMAX,NNZ,COOR,EDGE,CONN,IROW,ICOL, + ITRACE,IWORK,LIWORK,RWORK,LRWORK,IFAIL) * IF (PMESH.EQ.'N') THEN WRITE (NOUT,*) WRITE (NOUT,*) 'The Matrix Sparsity characteristics' WRITE (NOUT,*) 'after the renumbering' WRITE (NOUT,99998) 'NV =', NV WRITE (NOUT,99998) 'NNZ =', NNZ WRITE (NOUT,99998) 'NELT =', NELT ELSE IF (PMESH.EQ.'Y') THEN * * Output the sparsity of the renumbered mesh to view it * using the NAG Graphics Library * WRITE (NOUT,99997) NV, NNZ DO 100 I = 1, NNZ WRITE (NOUT,99997) IROW(I), ICOL(I) 100 CONTINUE * * Output the renumbered mesh to view it * using the NAG Graphics Library * WRITE (NOUT,99997) NV, NELT DO 120 I = 1, NV WRITE (NOUT,99996) COOR(1,I), COOR(2,I) 120 CONTINUE * REFTK = 0 DO 140 K = 1, NELT WRITE (NOUT,99995) CONN(1,K), CONN(2,K), CONN(3,K), + REFTK 140 CONTINUE END IF * STOP 99999 FORMAT (1X,A,2I6) 99998 FORMAT (1X,A,I6) 99997 FORMAT (1X,2I10) 99996 FORMAT (2(2X,E12.6)) 99995 FORMAT (1X,4I10) END