FMS uses submatrix files for finite element programs. Each file record is designed to hold the information for one element.

When you call FMSOS to create a submatrix file, FMS completes the Submatrix File Attribute List LUS(25), which you provide. This array contains all the information FMS needs to manage the submatrix file.

FMS uses three files to store the data for each submatrix:

  • Real data file LUS(1)

    This file stores the submatrix data [S].
  • Integer data file LUS(2)

    This file stores the following:
    • M, the size of the submatrix
    • ITYPE, how the data is stored on the real data file LUS(1)
    • {IEQSUB}, the global equation vector that relates the rows and columns of the submatrix to rows and columns of the global matrix.
  • Vector data file LUS(8) (Optional)

    This file stores the submatrix vector data V(M,NUMVEC).
There is one record on each file for each submatrix.

Submatrix Real File, LUS(1)

Each record of the submatrix real file LUS(1) contains a submatrix stored according to one of the following formats:
Submatrix Format 1 SUBMATRIX FORMAT TYPE 1
Symmetric or Nonsymmetric;
Full matrix stored by columns;
Equation numbers may be in a random order, including repeated equation numbers. This format is standard FORTRAN format for the submatrix S(M,M).
Submatrix Format 
2 SUBMATRIX FORMAT TYPE 2
Symmetric or Nonsymmetric;
Full matrix stored by rows;
Equation numbers can be in a random order, including repeated equation numbers. This format is included for compatibility with existing programs.
Submatrix Formats 3 & 
4 SUBMATRIX FORMAT TYPES 3 and 4
Symmetric only;
Lower triangular stored by rows starting with column 1 and proceeding through the diagonal.

For format type 3, equation numbers must be in numerical order with no repeated equation numbers. This format provides the fastest assembly for symmetric matrices.

For format type 4, equation numbers can be in a random order, including repeated equation numbers that may result from degenerate finite elements.

Submatrix Format 
5 SUBMATRIX FORMAT TYPE 5
Symmetric only
Row matrix.
The equations can be in any order including repeated equation numbers, except the last equation number must be the highest and correspond to the diagonal term. This format is typically used to include constraint equations with Lagrange multipliers.

Submatrix Integer File, LUS(2)

Each record of the submatrix integer file LUS(2) contains two integers, followed by the global equation numbers as follows:
Submatrix Integer File Format
Word Name Description
1 M Number of equations in the submatrix.
2 ITYPE Submatrix format type (1 to 5).
3:m+2 {IEQSUB} Integer array of length M which contains the global equation numbers relating rows and columns of the submatrix to rows and columns of the global matrix. The submatrix term S(I,J) contributes to the global matrix term A(IEQSUB(I),IEQSUB(J)). If ITYPE=3, this list and the associated submatrix data must be in numerical order and cannot contain repeated numbers. If a zero value is specified for an entry in IEQSUB, the corresponding row and column of the submatrix are skipped and not added to the global matrix.
M+3:LENI FILL Optional fill to a constant record length of LENI = LUS(4).

A single equation vector IEQSUB(M) relates both rows and columns of the submatrix to rows and columns of the global matrix. This relationship implies that the diagonals of the submatrix lie on the diagonals of the global matrix. This interface is used for finite element programs. User supplied subroutines should be used if a more general interface is required.

The element submatrix [S] and vector {V} are assembled into the global matrix [A] and global vector {B} according to the equation number vector {IEQSUB} supplied on each record. The actual assembly process for a full matrix and right-hand side vector is equivalent to the following FORTRAN statements:

        DO I=1, M
           IGLOB = IEQSUB(I)
           IF(IGLOB .GT. 0) THEN
C             Add in matrix term:
              DO J=1, M
                 JGLOB = IEQSUB(J)
                 IF (JGLOB .GT. 0) THEN
                    A(IGLOB,JGLOB) = A(IGLOB, JGLOB) + S(I,J)
                 END IF
              END DO
C             Add in vector term:
              DO J=1, NUMVEC
                 B(IGLOB,J) = B(IGLOB,J) + V(I,J)
              ENDDO
           END IF
        END DO

If you are using wavefront numbering, create a single submatrix file. The order that you write the records to the file will determine the wavefront numbering scheme. When you write the integer file LUS(2), provide the equation nicknames in the equation vector IEQSUB(M). The FMS subroutine FMSWF will rewrite this file for you, replacing your nicknames with FMS equation numbers.

If you are not using wavefront numbering, supply the submatrix equation numbers directly in the IEQSUB(M) array. If possible, you should write the submatrices in the order of increasing lowest equation number. That is, all submatrices that contribute to equation 1 are written first, followed by all remaining submatrices that contribute to equation 2, etc. This record order results in the minimum amount of data transfers during the assembly process.

In order to achieve the above record order, you may want to use multiple submatrix files. For example, you may want to place each element type on its own file. When using multiple submatrix files, you must store the file attributes in a single array LUS(25,NUMSF).

Submatrix Vector File, LUS(8)

You may also provide a submatrix vector file LUS(8) which contains contributions to the right-hand side vectors. Each record on the file contains the array V(M,NUMVEC) for the submatrix.

Record Format

The record format used for the files is one of the following: