ADAMS Example
explicit time // Time is request #0
assume linear // All requests take up one line
mangle "REQ/%short -- %long" // Combine long and short
// request names
long names // Both long and short names
// are significant
header // Read file header
// Begin block
type "Adams Results" // Set default request type
set precision = 9 // Set numeric precision for I/O
set maxfind = 1 // Search one line, maximum
find "A.R[0-9]" // Find signature string
readln null // Skip two lines (read and discard)
readln null
readln numrequests // Read in number of requests
set numcomponents = 8 // Set number of components to eight
components "X/Y/Z" // Specify component names
components "RX/RY/RZ\"
components "Magnitude/Rotational Magnitude"
do numrequests // for each request
// begin block
read shortname // read next short request name
read type "//1/Displacement//2/Velocity//3/Acceleration//4/Force//5/User Defined"
// read type ID and match
if // conditional (check for REQ comment
// begin block
set mark // remember position in file
find "[a-dg-zA-DF-Z]+" // check for letters in next line
} then // end block, then, if true
// begin block
rewind // return to previous mark in file
readln longname // read next long request name
} else // end block, then, if false
// begin block
rewind // return to previous mark in file
requests " " // set request name to blank
} // end block
} // end block
set start // mark start of data in file
readln strict "[+-]*[0-9]+\." // check for floating point
} // end block
record // Read a record
// Begin block
readln time // Read time (request #0)
do numrequests // For each other request
// Begin block
readln request // Read a request
} // End block
} // End block
request // Read a request
// Begin block
do 6 // Repeat six times
// Begin block
read component // Read a component
} // End block
read magnitude 0 // Get | comp0, comp1, comp2 |
read magnitude 3 // Get | comp3, comp4, comp5 |
}