General HydroStatics
Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)

TITLE /BAR
(Requires GHS version 16.50A or later)

You find yourself running simulations of many, many damage scenarios on a Tuesday afternoon. The ski report is excellent; it is going to be a bluebird tomorrow. If only you knew how far along you were in your simulation.

One way to track progess in a long loop or simulation is to issue a NOTE command at the beginning of each scenario. However, if screen output is not suppressed, these notes will quickly disappear as data moves across the screen. This makes it quite easy to lose track of progress. If a report is open, the notes will also be included in the report file, which may be unacceptable. And if that weren't enough, lift lines are usually much shorter on weekdays.

TITLE /BAR provides a convenient alternative. The command allows you to send a string to the window title bar, without affecting the report title as in a regular TITLE command, or the body of the report as in a NOTE command. The information is preserved in the window title bar until a subsequent TITLE /BAR command is issued, so it won't be lost as calculations continue. And because you are effectively changing the window title, the changes will also be recognized by your operating system (such as when previewing a minimized window on Windows).

TITLE /BAR accepts any string or string variable, so it can be used to track the values of multiple variables all in the same location. For example, you could track the height of a critical point, or the condition number of an iteration, or...

But you want to go skiing, so all you really care about is how much run time is left in your run file. To help you through these dire times, we've created a few macros, aptly named tick, tock, and how_long, which you will find in this run file. TITLE /BAR is then used to update the time remaining in the window title bar on each loop as shown below:

macro loop
.tick
`...
`Calculations go here
`...
.tock
.how_long {n} %1 `total iterations, current iteration
TITLE "Time remaining: {h}h {m}m {s}s" /BAR
/

vari n=5000
.loop({n},1)1


The macros take advantage of the time system variable as well as the SET command and a plethora of user variables. The time remaining is estimated from the average of up to three previous iterations, stored in the variables h, m, s and then displayed using TITLE /BAR.

You can now watch the progress of your simulation and the snow report at the same time. But let's just agree that it simply helps you multi-task.

(For those who don't have access to a ski area, we extend our sympathies. Just replace "skiing" with your favorite activity.)

Questions, comments, or requests?
Contact Creative Systems, Inc.

support@ghsport.com

USA phone: 360-385-6212 Fax: 360-385-6213
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday

Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA

www.ghsport.com

Click here for an index to this and previous COWs