Debugging is made simple in OnScale through the use of two tools:
- Print File (.flxprt)
- Warning File (.flxwrn)
These files contain all of the information you need for debugging your code.
Was my simulation successful?
Cloud License
If a job completes successfully it will be marked as Finished in the Job Status window and will be highlighted green. If a job fails it will be marked as Failed in the Job Status window and will be highlighted red.
Tip: If a job fails, always download the print file to see where the issue is in the code. It will speed up the debugging process.
Local License
If a job completes successfully the console and debug windows will contain no error messages. If a job fails, the console will report an error message.
Print File
If a simulation is run, no matter successful or not, a print file is generated. Print files contain the following data:
- Model precision
- All symbol properties
- Model parameters
- Keypoint values
- Number of nodes
- Number of elements
- Number of elements per material
- Total Run time
- Memory Usage
The print file is the most important tool for debugging code as it shows exactly where a simulation runs to before it terminates. Print Files contain error messages to indicate the problem in the code. Print files can be opened in any text editor or in a tab in Analyst.
Example
Error - Cannot open material file
Solution - Ensure material file is in same directory as input file and is spelled correctly
Warning File
OnScale sometimes generates warning messages; not because the job needs be terminated, but because a situation has occurred that requires action to be taken. It is a good idea to look in the warning file if your model is not behaving as expected. Common warning examples include:
- Requests for colour tables for graphics that do not exist
- Insertion of real values into integer variables
- Requests for plots of time histories that do not exist
A warning file is a list of all warnings generated during a run. However, these messages also appear at the appropriate points in the print file.
Example
Warning - A variable of integer type has been assigned a real value
Solution - Variables with names beginning with the letters I-N are given integer type. Therefore, give variables names beginning with alternative letters
Debugging Tips
- Always plot the material model after material assignment to ensure that materials have been assigned to parts correctly
- If the model has a piezoelectric load use the following command to check the load has been applied properly:
grph
plot piez
- Ensure you have the latest version of the software (the newest version can be found at https://onscale.com as these often contain new bug fixes
- Make use of comments and term commands to locate bugs
- Check out our Common Error Messages Help Center section for a solution
- If an error occurs at a symbol command, check the OnScale Help Manual to ensure the syntax is correct for that command (This can be accessed via the Help button in the Help tab of the ribbon)
- Use print file to check your solver is correct (your solver should be flex_s if you are using single precision and flex_d if you are using double precision)