Review is a useful post-processing language in OnScale which allows users to write personalised scripts which display and mathematically manipulate data to determine common design requirements such as operational impedance, acoustic beamplots, transmitting voltage response (TVR), and pressure fields.
Review script example:
Check this script:
read f1 'xx.flxhst' grph plot f1 1 writ mydata.txt end
This script does the following:
- It reads a time history output file called 'xx.flhst',
- It saves that the file available at that path in the hard drive to a variable f1 so that review can open it and access the data inside
- It then takes the first time history curve saved in f1 and writes it into a text file called 'mydata.txt'
Note: the file called 'xx.flxhst' is this example must be located in the same folder than the review script
How to Create a Review Script
You can create a Review script in OnScale Analyst Mode by writing your script instructions in a new file window and saving it with the extension *.revinp
How to run the script
As soon as you save your script in the *.revinp format, the button "Run Local" will become activated. That's because you can run freely review scripts locally or on the cloud, no additional license is required.
Note: Review scripts can be run on the cloud without estimation as Review scripts do not contain processes.
- Check that your script is saved with the extension *.revinp
- In the file explorer, we can check the 'xx.flxhst' is in the same folder than the script 'myscript.revinp'
- Click on "Run Local" or "Run on Cloud" button to execute your script
- If your script is executed without error, you will obtain "Warning: 0"
How to debug a review script?
Scripts are executed by review line by line.
When an error occurs at a specific line, the script will provide some warnings which indicates that the instruction couldn't be completed correctly.
You can debug a review script by checking the errors that occurred during the execution of your script.
If we introduce a bug in the script, then some warnings will appear in red in the Debug window.
In the previous image right, I changed f1 to f2 while no file called "f2" has ever been read into my script...!
When I run that script, a warning "Plotting data not found - Interpretation of plot command failed on argument 1:f2" will then be displayed.
Correct that problem and you will be good to go.
Important: Read those warnings carefully and make the appropriate changes to your script until you become able to execute it without a warning.
Where is saved the error log?
All the warnings and errors will be automatically written to a text file with the extension *.flxprt that will be generated in the same folder than your current script.
This *.flxprt file contains all the debug information (warnings and errors) generated by review during the execution of a script.