Adams Basic Package > Adams View > View Command Language > data_element > data_element create matrix file

data_element create matrix file

Allows you to direct Adams to read a MATRIX definition from a file.
The FILE keyword allows you to read large matrices into Adams using an external file. There is no limit on the size of an array read from a file.
The first record in the file contains an 80 character header of which the first seven or eight characters are meaningful. If the first record begins with the characters ADAMSMAT, then the file is assumedto be in a format used by Adams. If the first record begins with the characters MATRIXx, then the file is assumed to be in the FSAVE format of the MATRIXx software package. If the first record begins with the characters MATSAVE, then the file is assumed to be in the MATSAVE format of the MATRIXx software package.
No other kinds of files are currently supported. However, the ADAMSMAT option is fairly general since the format for reading in the data is specified within the file. See the section in the Adams Reference Manual on the MATRIX statement for a description of the file format.

Format:

 
data_element create matrix file
matrix_name =
new matrix
adams_id =
integer
comments =
string
file_name =
string
name_of_matrix_in_file =
string
units =
string

Example:

 
data_element create matrix file &
matrix_name =
matrix_read_from_file &
adams_id =
12 &
comments =
”example of a matrix read from a file” &
file_name =
/home/staff/demo/prob.dat &
name_of_matrix_in_file =
“trf” &
units =
string
In the above command, the prob.dat is in the directory, /home/staff/demo, and contains the following data:
1 2 3 4 5 6 7 8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
ADAMSMAT Floating platform example
3
TRF VALK STL
TRF FULL RORDER 4 2 8 ( 8F8.5 )
1.36400 0.00000 0.00000 0.00000 -3.54600 4.00800 0.00000 0.79900
VALK FULL CORDER 3 3 9 ( 3F6.3 )
1.970 0.000-3.440
0.000 4.510 6.020
-3.440 6.020 2.110
STL SPARSE 6 1 4 ( 2( 2I5, E14.6 ) )
1 1 0.169805E+02 2 1 -0.230745E+02
4 1 0.016390E+00 5 1 0.011271E+00
The second and third records are read with format I5 and 4(A8,10X), respectively. Then, the first record of each of the blocks corresponding to the three matrices TRF, VALK, and STL is read with the format 3A8, 3I5, A41. Finally, as can be seen in the copy of the file shown above between the two strings of 80 characters that mark the columns (which, of course, are not part of the file), the single record of data for the matrix TRF is read with the format 8F8.5; the three records for VALK are read with 3F6.3; and the two records for STL with 2(2I5,E14.6).

Description:

 
Parameter
Value Type
Description
matrix_name
New matrix
Specifies the name of the new matrix.
adams_id
Integer
Specifies an integer used to identify this element in the Adams data file.
comments
String
Specifies comments for the object being created or modified.
file_name
String
Specifies the name of a file that contains the values of the matrix.
name_of_matrix_in_file
String
Specifies the name of a MATRIX to be read from the file identified by the FILE_NAME parameter.
units
String
Allows you to specify the type of units to be used for this object.

Extended Definition:

1. You may use this name later to refer to this matrix. Adams View will not allow you to have two matrices with the same full name, so you must provide a unique name.
Normally, entity names are composed of alphabetic, numeric, or '_' (underscore) characters, and start with an alphabetic or '_' character. They may be any length. For more information, see Using Extended Names.
By enclosing the name in double quotes, you may use other printable characters, or start the name with a numeral. If a name contains characters, or starts with a numeral, you must always quote the name when entering it.
Note that you can specify the parentage of an entity (for example, what part "owns" a marker or a geometry element) when you CREATE it by changing the name. If you enter just the entity name, then the default parent will be assigned by Adams View. If you type in the full name, then you may over ride the default parent. In most cases, when creating an entity, Adams View will provide a default name. The default name that AdamsAdams View provides will specify the parentage that it has assumed.
You may, or course, delete this name and use your own. The form of a full name is:
"...._NAME.GRAND_PARENT_NAME.PARENT_NAME.ENTITY_NAME"
The number of levels used varies from case to case and the parentage must exist before an entity can be assigned to it.
2. When you use the FILE ADAMS_DATA_SET WRITE command, Adams View writes an Adams data file for your model. Adams requires that each modeling element be identified by a unique integer identifier. If you use this parameter to specify a non-zero identifier, Adams View will use it in the corresponding statement in the Adams data file.
You may also enter zero as an identifier, either explicitly or by default. The next time you write an Adams file, Adams View will replace the zero with a unique, internally-generated identifier.
Adams View will permanently store this identifier with the element just as if you had entered it yourself.
Normally, you would let all identifiers default to zero, and Adams View would generate the identifiers for you. You are never required to enter a non-zero identifier. You only need to specify it if, for some reason, you wish to control the Adams file output.
3. The FILE argument may be used to read large matrices into Adams. There is no limit on the size of an array read from a file.
The proper extension is the default but can be overridden by simply supplying a different extension.
You do not need to enclose the file name in quotes if it only contains alpha-numeric characters and starts with a letter. If you want to include other characters, such as a '.' for an extension or '/' or '[]' for directory paths, you must enclose the name in quotes.
The first record in the file contains an 80 character header of which the first seven or eight characters are meaningful. If the first record begins with the characters ADAMSMAT, then the file is assumed to be in a format used by Adams. If the first record begins with the characters MATRIXx, then the file is assumed to be in the FSAVE format of the MATRIXx software package. If the first record begins with the characters MATSAVE, then the file is assumed to be in the MATSAVE format of the MATRIXx software package.
Note that the three specifications for the format of the data file are case sensitive. Capital letters and a lower case x must be used to make a selection.
No other kinds of files are currently supported. However, the ADAMSMAT option is fairly general since the format for reading in the data is specified within the file. See the section in the Adams Reference Manual on the MATRIX statement for a description of the file format.
4. All three kinds of files, ADAMSMAT, MATRIXx, and MATSAVE, can contain data for more than one matrix. The NAME_OF_MATRIX_IN_FILE parameter is used to select a particular matrix from a file even if the file contains only one MATRIX. You must create additional MATRIX elements in your Adams View model if multiple matrices are to be read from the same file.