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:
There is one record on each file for each submatrix.
![]() |
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 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 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 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. |
| 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
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
C Add in vector term:
DO J=1, NUMVEC
B(IGLOB,J) = B(IGLOB,J) + V(I,J)
ENDDO
C
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).
V(M,NUMVEC)
for the submatrix.