Encyclopaedia Index

Contents list

VR-Viewer

VR Viewer Overview
Selecting the Files to Plot
VR-Viewer Environment

VR-Viewer Toolbar

VR-Viewer Hand-set and Toolbar Icons
The Main Menu dialog
The Object Dialog Box
VR-Viewer Scripting (Macro) facility

The function of the VRV Macro
Saving MACROs
Running MACROs
MACRO Commands
PHOTON USE Files

Saving Animations

Short cuts to Viewer functions:

Short cuts to Viewer Macro commands:


VR Viewer Overview

The VR-Viewer is the solution visualisation counterpart of the VR-Editor. It is accessed from Run - Post processor - GUI Post processor (VR Viewer) on the main VR-Editor window. It can display;

Typical plots showing all graphics elements are shown below:

 

Viewer screen and hand set

Typical line plot

At first glance, the VR Viewer looks very similar to the VR Editor. There are however differences in the controls and graphics-window annotations that facilitate viewing results on the flow domain, for example:

Further details of all the hand-set buttons and main window menus are given below.


Selecting the Files to Plot

The files to be plotted are selected during the VR-Viewer start-up sequence. If another set of results is to be plotted, clicking on the F6 icon or pressing the F6 function key will display the file selection dialog without changing any of the display settings. Clicking on 'File' - 'Open existing case' or 'File' - 'Reload working files' will restart the Viewer and reset all the display settings to default.

Steady-State Cases

When the VR-Viewer starts, or when F6 is pressed, it displays this dialog box:

IMAGE: File names dialog- default files

To plot the most recent results, click 'OK' and the VR-Viewer will read the default files and display the first image. If intermediate dumps have been selected, 'Latest dumped files' will display the name of the most-recently written file. If the solver run has finished, the name will be phi (or phida) as shown.

Pressing F9 or clicking the F9 icon will load the most recently-dumped files and refresh the screen image with the new results. This is useful when the Earth solver is still running and is dumping solution files at regular intervals. Pressing F9 will update the screen image using the most-recently written solution files.

A right-click on F9 will cause Viewer to update the screen image automatically each time a new solution file is written by the Earth solver.

The Use intermediate sweep files button is displayed if intermediate dumps have been selected in the VR-Editor Main Menu - Output - Dump Settings panel. When Use intermediate sweep files is selected, the following dialog is displayed:

IMAGE: File names dialog - Use intermediate files

The > symbol advances to the next stored sweep,>> to the last stored sweep. Similarly, < and << go back to the previous and first stored sweeps. Clicking or pressing F7 or F8 will also load the previous or next sweep files. Clicking or pressing F9 will load the most recent files.

To plot the results of a different case, click on 'No' next to User-set file names to produce this dialog:

IMAGE: File names
dialog - User files

Click on 'Select files' to bring up a dialog which allows the selection the files it is desired to plot. These may or may not have any connection to the current case.

IMAGE: User file names dialog

This dialog allows the specification all the files the VR-Viewer might want to read - it is only required to specify those, which are to be different from the default. The BFC grid file is only required if a BFC case is to be plotted, the PARSOL file only if a PARSOL case is to be plotted.

If a name of the form 'name.q1' is specified for the input q1 file, the VR-Viewer will assume that it is required to plot the results of that case, and will change the names of the other files in line with the table shown in VR-Editor - File - Save as a case.

Transient Cases

In a transient case, the dialog is slightly different.

IMAGE: File names dialog - Transient

The Use intermediate step files button is displayed if intermediate dumps have been selected in the VR-Editor Main Menu - Output - Dump Settings panel. When Use intermediate step files is selected, the following dialog is displayed:

IMAGE: File names dialog - Use intermediate files

The > symbol advances to the next stored time-step,>> to the last stored time-step. Similarly, < and << go back to the previous and first stored time-steps. Clicking or pressing F7 or F8 will also load the previous or next time-step files. Clicking or pressing F9 will load the most-recently dumped set of results. Right-clicking the F9 icon will cause Viewer to update the screen image each time the Earth solver writes a new solution file.


VR-Viewer Environment

The VR-Viewer has a reduced set of pull-down menus, as can be seen above. Only the File, Settings, View, Run, Options and Help menus are active.

File

These work as in the VR-Editor.

Settings

IMAGE: VR-Viewer Settings menu

Domain Attributes, Probe Location, Add Text, New Clipping plane, New Plotting Surface, New Track Counter, Object Attributes, Find Object, Editor Parameters, Contour Options, Vector Options, Iso-surface Options, Plot Limits, Xcycle settings, Plot variable profile, Near Plane, Rotation speed, Zoom speed, Depth effect, Adjust lighting

The Add Text, Editor Parameters, View Direction, Near plane, Rotation speed, Zoom speed, Depth effect and Adjust lighting dialogs are the same as in the VR-Editor.

View

This leads to the Options tab of the Viewer Options dialog.

These are as in VR-Editor.

This will mirror the domain and all plot elements in either X, Y or Z. It is not possible to mirror in several directions at once. The following image shows the domain mirrored in the Z direction

Run

The VR-Viewer Run menu contains the same options as the VR-Editor, with the exception that in the Pre processor sub-menu, the 'GUI Pre processor (VR-Editor)' is enabled, and in the Post processor sub-menu, the 'GUI Post processor (VR-Viewer)' is inactive.

This is how to return to VR-Editor.

Options

This is as in VR-Editor.

Help

This is as in VR-Editor.


The Tool Bar

The Viewer toolbar includes the same General, Domain, Object and Movement toolbar icon groups as the Editor. In these, only the Start a new case icon is inactive. In addition, there are four further icon groups.

Slice toolbar, Animate toolbar, Variables toolbar, Function key toolbar

Slice toolbar

Slice tool bar

These lead to the Slice Toggle, Slice Direction X/Y/Z, Contour Toggle/Contour Options, Vector Toggle/Vector Options, Iso-surface Toggle/Iso-surface Options, Streamline Management/Stream Options, Graph Options and Slice Management dialogs described below.

Animate toolbar

Animation toolbar

These lead to the Macro, Animation Toggle/Animation Options and Record animation dialogs described below.

Variables toolbar

Variables toolbar

These lead to the Select Pressure, Select Velocity, Select Temperature and Select a Variable dialogs described below.

Function key toolbar

Viewer function key toolbar

The F3-F5 icons are used to control the VR-Viewer macros.

F6 - F8 control the plotting files, as described above.

F9 loads the most-recently written set of results, preserving the current view and display settings. A right-click on F9 activates the auto file update mode. Each time the Earth solver writes a new solution file, Viewer will read the new file and update the screen image.

The tool bar also displays the name and type of any selected object. If no object is selected, it will display the name of the domain (usually CHAM).

The Status Bar

The status bar displays information regarding the progress of the current plot. When reading files, it shows the percentage of the file that has been read. The current working directory is displayed in the status bar when it is not showing other information.


VR Viewer Hand-Set Toolbar Icons

The VR-Viewer hand-set is shown below:

Image: HAND-SET

The top two rows of buttons, Axis toggle through to Bounding Box toggle, are exactly the same as in the VR-Editor, except for the Macro and Record animation buttons, which are described in detail later.

The movement controls are also the same as in the VR-Editor, including Fly-through Mode.

The remaining hand-set buttons are described here.

Object Management, Contour Toggle/Contour Options, Vector Toggle/Vector Options, Iso-surface Toggle/Iso-surface Options, Streamline Management/Stream Options, Streamlines from GENTRA Tracks, Slice Toggle, Slice Management, Animation Toggle/Animation Options, Slice Direction X/Y/Z, Select Pressure, Select Velocity, Select Temperature, Select a Variable, Probe position hand-set controls, Show Probe Location, Display Minimum and Maximum Values, Viewer Options 'Options' Dialog, Plot Variable Profile

The object management panel has similar functionality as in the VR-Editor, although the options which allowed the objects to be modified have been disabled. This includes the facility to create or delete objects. There are four additional items on the Action and Context menus. These are:

These are described in VR-Viewer Object context menu


The Main Menu dialog

IMAGE:
    Graph options Dialog

The Main Menu in the Viewer is much simpler than in the Editor.

SI Units   FPS Units    CGS Units

Note that it is only the contour scale, probe value and average value which are changed - the data is left untouched. The probe location is also shown in the selected unit set.


The Object Dialog Box

Just as in the VR-Editor, double-clicking on an object will display the object dialog box.

IMAGE: Object
  dialog in VR-Viewer

Unlike in the VR-Editor, the values in the size and position boxes cannot be changed - they display the size and position of the current object. Similarly, the Geometry button on the Shape page is inactive, although textures can still be modified.

The Go To and Hide buttons work as in the VR-Editor. The Colour button allows the colour and/or transparency of an object to be temporarily changed. Permanent changes can only be made in the VR-Editor, and become permanent when the working files are saved.

The Show nett sources button on the Options page has several functions, depending on the object selected. The possibilities are:

'Show nett sources' can also be found on the Object Management Dialog action menu, and on the right-click context menu.


Contours and Vectors on the Surfaces of Objects

To colour an object by the current plotting variable, select the object, right-click on it and select 'Surface contour' from the context menu.

Alternatively select the object or objects from the Object Management Dialog, and then select 'Surface contours' from the Action Menu.

To plot contours or vectors on an arbitrary surface, create a Plotting Surface object. This can be done in the Viewer (or Editor) from 'Settings - New Object - Plotting surface', or from the Object management Dialog, 'Object, New, Plotting Surface'. Double-click the new object to open its Specification dialog, set any desired shape and place it where required.

 

In the Viewer, select the new object, right-click and select 'Surface contours'.

Now select 'Surface vectors'


VR-Viewer Object context menu

IMAGE: Viewer Object context menu

When an object is selected, the right mouse button will bring up a context menu for the current object. Most options which allow for the modification of an object have been disabled, except 'Modify Colour'. However, there are five items which are only available in the viewer

Both .csv files can be easily imported into Excel for further processing. They are also compatible with AUTOPLOT.


VR-Viewer Scripting (Macro) Facility

The function of the VRV Macro

A typical use of a VRV macro is to record a particular view and magnification, and then restore it whenever required, for example when preparing images for a report. Using a macro in this way will guarantee that a sequence of images from different phi files, perhaps generated on separate occasions, can all use the identical view and magnification settings.

A macro file can contain a single image, or a sequence of images separated by PAUSE commands.

Macro command files are ASCII text files, and can be edited (or created) using any convenient text-file editor.

Saving VR-Viewer Macros

Macro files can be created by the following means:

Running VR-Viewer Macros

The macro commands can be copied into the Q1 input file, by placing them between the statements VRV USE and ENDUSE. These two lines, and all the macro lines, must start in column 3 or more to ensure that they are treated as comments by the VR-Editor.

Macros can be run by as follows:

IMAGE:
  MACRO Functions dialog (run)

The default file name is Q1.

VR-Viewer Macro Commands

The commands set the state of the VR-Viewer settings. The screen image is updated when a PAUSE command is encountered, or the end of the file is reached. The image is the outcome of the final states of all the settings.

The commands making up the macro language can be divided into a number of groups. Only those commands that change a default or change an existing setting need be placed in the macro file.

The individual commands can be shortened, as long as the remaining part is unique.

Short cuts to commands

Setting the File Name

FILE name [xyz name for BFC case]  Sets the name of the PHI (and XYZ file) to plot
FILE + Read the next saved PHI file (equivalent to F8)
FILE - Read the previous saved PHI file (equivalent to F7)
USE file Read commands from another file. Use files can be nested to a depth of 5.

Setting the View

VIEW x, y, x Sets the View direction
UP x, y, z Sets the Up direction
VIEW CENTRE x, y, z Sets the Cartesian co-ordinates of the view centre - the point about which the image rotates.
[VIEW DEPTH depth For the Windows Viewer, sets the View Depth. The default is 3.0. A value of 100000 makes the view isometric]
[VIEW TILT angle For the DOS/Unix Viewer, sets the perspective angle. The default is 0.8. A value of 0.0 makes the view isometric]
SCALE scalex, scaley, scalez Sets the overall domain scaling factors
NEARPLANE depth Sets the near plane position.

The View Centre, Scale factors and View Depth/Tilt settings can be seen by clicking on 'Reset'.

Setting the Position of Screen Items.

The primary keyword POSITION is followed by a secondary keyword to identify which item is under consideration. The two integers represent the normalised location in the range 0.0 - 1.0 for the first character of the item. [The origin is at the top left hand corner of the client area.]  Each item also has an associated ON / OFF switch to indicate whether it is to be drawn or not.

POSITION CELL x, y Shows the current probe position in terms of cells
CELPOS ON / OFF Shows or hides the display of the probe position
POSITION CONTOURKEY x, y Positions the contour colour scale
CONTOUR SCALE ON / OFF Shows or hides the display of the contour key
POSITION TITLE x, y Positions the run title
TEXT ON / OFF Shows or hides the display of the run title
POSITION PROBE x, y Positions the echo of the probe value
PROBE ON / OFF Shows or hides the probe
POSITION AXIS x,y Positions the location of the axes
AXIS ON / OFF Shows or hides the axes
AXIS LINE WIDTH ipixel Sets the axes line width to ipixel
AXIS LINE COLOURS icolX, icolY, icolZ Sets the colours of the X, Y and Z axes to icolX, icolY and icolZ

Labeling the Plot

TEXT CLEAR Deletes all previous text items
TEXT size, colour Sets size (1=large, 4=small) and colour, immediately followed by
string Sets the actual text to be placed on the plot
Xpos Ypos Sets the normalised position of the first character as above

Setting the Variable to be Plotted

VARIABLE name Sets the name of the current plotting variable
VARIABLE RANGE min max Sets the minimum and maximum values for the plot.

If the minimum/maximum values are changed from the default (i.e. the current field values), the set values will be used for all subsequent plots for this variable. Setting specific minimum and maximum values ensures that contour plots from different PHI files are scaled consistently.

Controlling the Plot Elements

Contours

CONTOUR ON / OFF / CLEAR Clear also deletes all saved slices.
CONTOUR FILL ON / OFF Controls the display of the filled contour bands.
CONTOUR LINE ON / OFF Controls the display of the contour lines between bands.
CONTOUR LINE COLOUR index / MULTI Controls the colour index of the contour lines between bands. MULTI indicates using contour band colours.
CONTOUR LINE WIDTH ncwid Controls the width in pixels of the contour lines between bands.
CONTOUR SCALE ON / OFF Controls the display of the contour scale.
CONTOUR OPAQUENESS iopaq Sets the contour opaqueness to iopaq.
CONTOUR BLANK ON / OFF Sets the out-of-range transparency.
CONTOUR AVERAGE ON / OFF Sets contour averaging on or off.
CONTOUR CONTINUOUS ON / OFF Sets the contours to use smooth shading
CONTOUR INVERSE ON / OFF Inverts the colour scale so that red is low and blue is high
CONTOUR GREYSCALE ON / OFF Switches the contour colours to greyscale. Note that this will also affect vectors and iso-surfaces.
CONTOUR RANGE Vmin Vmax [LOG] Sets the contour range to be Vmin to Vmax. The optional last argument LOG switches to a log10 scale.

Vectors

VECTOR ON / OFF / CLEAR Clear also deletes all saved slices.
VECTOR SCALE vscal Sets the vector scaling factor
VECTOR REFERENCE vref Sets the vector reference velocity
VECTOR INTERVALS intx, inty, intz Sets the vector plotting frequency
VECTOR PHASE 1 / 2 Sets the phase for the vectors
VECTOR COLOUR n Sets the vector colour to colour number n
VECTOR WIDTH ipixel Sets the vector width to ipixel pixels
VECTOR TYPE type Sets the vector type to TOTAL or IN-PLANE
VECTOR MAXLENGTH maxlen Sets the maximum vector length (m/s)
VECTOR COMPONENTS var1, var2, var3 Sets the names of the vector component variables.

If the vector scale or reference is changed from the default, this value will be used for all subsequent vector plots. Setting a specific vector reference will ensure that vectors from different PHI files are scaled consistently.

Iso-surfaces

SURFACE ON / OFF  
SURFACE VALUE surfval Sets the surface value, otherwise uses the probe value if not set.
SURFACE COLOUR iPalette Sets a colour from the VR palette to colour the surface by, otherwise uses the contour colour associated with surface value.
SURFACE COLOUR iRed iGreen iBlue As an alternative to setting palette index one may set RGB values (0-255) to colour the surface by.
SURFACE VARIABLE variable Sets a secondary variable the surface contour will be coloured by. The VARIABLE RANGE (for contours) will now apply to this secondary variable.
SURFACE VARIABLE OFF Turns off any secondary variable the surface contour will be coloured by.
SURFACE OPAQUENESS iopaq Sets the surface opaqueness to iopaq, unless a secondary variable indicated in which case the CONTOUR OPAQUENESS setting is used.

Streamlines

STREAM DELETE / CLEAR Clear also deletes all saved slices.
STREAM x y z Start a streamline at (x,y,z)
STREAM MODE line/arrow/ribbon Set stream mode
STREAM DIRECTION downstream/upstream/both Set stream direction
STREAM COLOUR variable/track/total Set stream colour mode
STREAM ORIGIN probe/line/circle Set stream start point
STREAM START x y z Set start of line for start along line
STREAM END x y z Set end of line for start along line
STREAM RADIUS rad Set radius for start around circle
STREAM TIME tmin tmax Set minimum and maximum track flight time
STREAM TRACKS ntrack Set number of tracks for line or circle mode
STREAM WIDTH ipixel Set the streamline width to ipixel
STREAM DRAW Create streamlines based on current mode settings

Streamline Animations

A secondary keyword, ANIM, is added to streamlines. By default the animation will be with a grey ball. Optional keyword COLOURED for animation balls to be coloured appropriately. Alternatively VECTOR will produce coloured vectors.

STREAM ANIM BALL [COLOURED] Animate as balls
STREAM ANIM VECTOR Animate as vectors
STREAM ANIM SEGMENT seg_length Animate as segments with length seg_length

The secondary keyword FREQUENCY has two integers, the first is the number of frames per cycle, the latter the number of balls or vectors .

STREAM FREQUENCY nframe nball Set number of frames and number of balls or vectors.
STREAM VISIBILITY [ON/OFF] Determines the streamline visibility during animation.

The ball size and vector scale are set as shown below.

Setting the Colour Palette

Although the keyword CONTOUR is used to control this feature, the same palette is used for all plotting elements - contours, vectors, iso-surfaces and streamlines.

CONTOUR NUMCOLS numcols sets the number of colours used to numcols. If the line is absent, the current number of colours will be used.

CONTOUR PALETTE iRed, iGreen, iBlue sets the red, green and blue values. Values are in the range 0 - 255. There must be numcols lines, one to define each colour. If these lines are absent, the current palette will be used.

If the number of colours is set to 4, the colours will red (255 0 0), yellow (255 255 0), green (0 255 0) and blue (0 0 255).

As an alternative, the name of a palette file can be specified by using:

CONTOUR PALETTE filename where filename is the name of the palette file. A palette file can be saved from the 'Update palette' option of the Contour Options dialog. The format of the file matches the 'CONTOUR NUMCOLS','CONTOUR iRed, iGreen,iBlue' format described above. The default 16-colour palette is given here:

VR Contour palette
16
255 0 0
255 66 0
255 128 0
255 176 0
255 224 0
255 255 48
192 255 0
100 255 0
0 255 0
0 232 72
0 220 160
0 200 220
0 160 240
0 120 255
40 40 255
0 0 255

Line Plots

LINE START x,y,x Sets the start point of the line
LINE END x,y,z Sets the end point of the line
LINE NPOINTS np Sets the number of points to extract along the line
LINE XLABEL label Sets a label for the X axis (must be only item on line)
LINE YLABEL label Sets a label for the Y axis (must be only item on line)
LINE TITLE title Sets a title for the plot (must be only item on line)
LINE DUMP SIZE nx,ny Sets the size in pixels of the saved image file
LINE DUMP file_name Sets the name of the GIF file of the time plot. To save pcx, bmp or jpg add the required extension (must be only item on line)
LINE FILE file_name Sets the name of the saved data file (must be only item on line)
LINE PLOT Creates the plot and saves files using latest settings

The variable plotted is the current plotting variable, set with VARIABLE name, as above.

Time History Plots

TIMEPLOT OBJECT name Sets the name of the POINT_HISTORY object to take data from
TIMEPLOT VARIABLE name Sets the name of the variable to be plotted. It must be one of the variables selected for storage at the named POINT_HISTORY object.
TIMEPLOT YLABEL label Sets a label for the Y axis. X axis label is always 'Time'. (must be only item on line)
TIMEPLOT DUMP SIZE nx,ny Sets the size in pixels of the saved image file
TIMEPLOT DUMP file_name Sets the name of the GIF file of the time plot. To save pcx, bmp or jpg add the required extension (must be only item on line)
TIMEPLOT FILE file_name Sets the name of the saved data file (must be only item on line)
TIMEPLOT PLOT Creates the plot and saves files using latest settings

X Cycle Options

XCYCLE CLEAR Clears any previous X Cycle settings
XCYCLE REPEAT [n] Indicates domain is to be repeated n times
XCYCLE REPEAT [GEOMETRY] [CONTOUR] [VECTOR] [STREAM] [ISOSURF] [GRID] [MINMAX] [SLICE] Indicates which plot components are to be repeated

Controlling Slices

SLICE X / Y / Z Sets the slice direction
SLICE SAVE / DELETE / CLEAR Saves, deletes and clears slices
SLICE OUTLINE ON / OFF Turns the slice toggle on and off
SLICE LIMITS XYZ xmin,xmax,ymin,ymax,zmin,zmax Sets the plotting limits in physical co-ordinates
SLICE LIMITS IJK ixmin,ixmax,iymin,iymax,izmin,izmax Sets the plotting limits in cell numbers

Probe Position and Appearance

PROBE x, y, z Places the probe in Cartesian co-ordinates
PROBE Theta, r, z Places the probe in Polar co-ordinates
PROBE i, j, k Places the probe in BFC co-ordinates
PROBE STYLE DEFAULT / SPHERE Set the probe to display as a pencil or sphere. If the line is absent, a pencil is assumed.
PROBE SIZE size Sets the diameter of the sphere probe.
PROBE COLOUR iRed, iGreen, iBlue sets the red, green and blue values. Values are in the range 0 - 255

Low and High Spots

MINMAX ON/OFF Turns low/high spots on or off
BALLSIZE rad Radius to be used for low high spots

General Display Toggles

PROBE ON / OFF  
WIREFRAME ON / OFF  
AXIS ON / OFF  
TEXT ON / OFF  
GRID ON / OFF  
DOMAIN ON / OFF  

Controlling the Display of Objects

OBJECT SHOW ALL / NONE Show or hide all objects
OBJECT SHOW NAME name Show named object
OBJECT SHOW TYPE type Show all objects of the given type
OBJECT SHOW LIST Show objects listed in following list
[LIST name1, name2, name3.....] List of names to show.
[LIST namen, namen+1...]  
OBJECT HIDE ALL / NONE Hide or show all objects
OBJECT HIDE NAME name Hide named object
OBJECT HIDE TYPE type Hide all objects of the given type
OBJECT HIDE LIST Hide objects listed in following list
[LIST name1, name2, name3.....] List of names to hide.
[LIST namen, namen+1...]  
OBJECT PAINT ALL / NONE Colour all objects by the surface value of the plotting variable
OBJECT PAINT NAME name ON / OFF Colour the named object
OBJECT PAINT TYPE type ON / OFF [or ALL / NONE] Colour all objects of the given type
OBJECT PAINT LIST ON / OFF Colour the listed objects
[LIST name1, name2, name3.....] List of names to colour.
[LIST namen, namen+1...]  
OBJECT VECTOR ALL / NONE Draw surface vectors on all objects
OBJECT VECTOR NAME name ON / OFF Draw surface vectors on the named object
OBJECT VECTOR TYPE type ON / OFF [or ALL / NONE] Draw surface vectors on all objects of the given type
OBJECT VECTOR LIST ON / OFF Draw surface vectors on the listed objects
[LIST name1, name2, name3.....] List of names to vector.
[LIST namen, namen+1...]  
OBJECT WIREFRAME ALL / NONE Draw all objects in wireframe
OBJECT WIREFRAME NAME name ON / OFF Draw the named object in wireframe
OBJECT WIREFRAME TYPE type ON / OFF [or ALL / NONE] Draw all objects of the given type in wireframe
OBJECT WIREFRAME LIST ON / OFF Draw the listed objects in wireframe
[LIST name1, name2, name3.....] List of names to draw in wireframe.
[LIST namen, namen+1...]  
OBJECT DUMP NAME name Dump surface values of current variable to a csv file (name_variable.csv).
OBJECT DUMP LIST Dump object surface values of current variable for the listed objects to a csv file
[LIST name1, name2, name3.....] List of object names from which to dump surface values.
[LIST namen, namen+1...]  
OBJECT PROFILE NAME name Write a profile of object surface values for the current variable along a line, in the current plane direction (set by SLICE X/Y/Z) passing through the current probe location (set by PROBE x, y, z), to a csv file (name_variable_plane_distance.csv).
OBJECT PROFILE LIST Profile surface values of current variable for the listed objects to a csv file
[LIST name1, name2, name3.....] List of object names from which to profile surface values.
[LIST namen, namen+1...]  

Clipping plane options

If clipping planes are present, they are written to the macro file separately, after the other objects. The settings read from the macro will override any current clipping plane settings. If there are no current clipping planes, they will be created.

CLIP SHOW object name Display this clipping plane
CLIP POSITION xpos, ypos, zpos Set position
CLIP SIZE xsiz, ysiz, zsiz Set size
CLIP ROTATION alpha, beta, theta Set the rotation angles
CLIP TYPE low / high Set clip type

Saving Images

DUMP SIZE [nx] [ny] Set the size (in pixels) for subsequent saved images
DUMP filename Generates an image file of the current screen image using the default image type. The default file type is set in the [Graphics] section of the CHAM.INI file. To explicitly save png, pcx, bmp or jpg add the required extension.

Images of line and time plots can also be saved.

Progress Controls

PAUSE Displays a 'Press return to continue' dialog
UPAUSE n Pauses for n seconds, where n is an integer
REWIND [n] Rewinds the macro file an optional n times.
MSG text Displays the text in a subsequent PAUSE dialog

Other items

PROFILE objnam Write a profile file for object objnam

GENTRA Particle Tracks

To read GENTRA particle tracks from the GENTRA particle history file:

HISTORY READ Indicates a particle history file is to be read; the name of file should given on the following line in the macro file
filename m n filename is the name of the history file. All tracks are read unless;
if m is present, it is the track to be read
if n is present, all tracks in the range m-n are read

Extracting multiple data points

Viewer can extract data values at multiple locations read from a file, and output the probe values at these locations to another file.

PROBE READ file1 file1 is the name of the file containing the X,Y,Z coordinates at which the data values are required. The file should be an ASCII text file, with three columns of numbers in free format.
PROBE VARIABLE name name is the name of the variable whose values are required.
PROBE WRITE file2 file2 is the name of the file to be created. The file will contain a header line followed by lines of four numbers. The first three are the X,Y,Z coordinate of the point, and the fourth is the value of the requested variable. There is no limit to the number of points handled. If contour averaging is on, the values will be interpolated in the averaged data field. If contour averaging is off, the value will be the value in the cell containing the data point.

As an example, let us assume we wish to know the pressure and velocity values at the points (0.475,0.475,0.24), (0.775,0.450,0.24) and (0.772,0.275,0.24). We create a file called, say, pos.txt which contains the lines:

0.475 0.475 0.24
0.775 0.450 0.24
0.772 0.275 0.24

We now create a macro file called, say, extract.mac, which contains the commands:

probe read pos.txt
probe variable pressure
probe write pres.csv
probe variable Velocity
probe write vel.csv

When this macro is run, two files will be created:

pres.csv containing

      XP,           YP,           ZP,        pressure   
 4.750000E-01, 4.750000E-01, 2.400000E-01,-1.772031E+01
 7.750000E-01, 4.500000E-01, 2.400000E-01,-8.381842E+01
 7.720000E-01, 2.750000E-01, 2.400000E-01,-2.149323E+01

and vel.csv containing

      XP,           YP,           ZP,        Velocity    
 4.750000E-01, 4.750000E-01, 2.400000E-01, 1.116307E+01
 7.750000E-01, 4.500000E-01, 2.400000E-01, 4.566224E+00
 7.720000E-01, 2.750000E-01, 2.400000E-01, 2.221509E+01

The use of the .csv extension for the output files means they can be read directly into Excel without any further conversion. The values come from the first example in Starting with PHOENICS-VR; TR324.

Saving animations in macros

The user may save transient animations from with a macro, but there are special considerations with regards to threading.
Threaded transient animation is set on by default in the CHAM.INI file, however when using the threaded animation in a macro it is necessary to have a PAUSE immediately after the final ANIMATE command to prevent any subsequent macro commands being issued before the macro has completed.
To avoid using PAUSE it will be necessary to switch off the threaded animation using the macro command ANIMATE THREADED OFF before starting the animation.

ANIMATE [DUMPALL] FILE filename Sets the name of the file to be dumped by the subsequent ANIMATE line. The file type, AVI or GIF, is determined by the extension given to the filename e.g. mymovie.avi. If DUMPALL is present, each frame will also be saved to a JPG file. The names will be mymovie1.jpg, mymovie2.jpg etc. The pixel size of the animation is set by a preceding DUMP SIZE command if present.
ANIMATE THREADED ON / OFF Indicates whether to use threaded option when reading the intermediate PHI files.
ANIMATE [START m] [END n] [INTERVAL o] [DUMP] The image defined by the macro is regenerated in an animation sequence starting at time step m, ending at step n every o steps, and optionally dumping an animated GIF or AVI file containing each frame of the animation. If there is no preceding ANIMATE FILE command, the filename and type will be requested.
ANIMATE Starts the animation using the current settings

To create an AVI file called mymovie.avi with a pixel size of 640 * 480, the following commands would be needed:

DUMP SIZE 640 480
ANIMATE FILE mymovie.avi
ANIMATE

PHOTON 'USE' Files

For compatibility, VR-Viewer can also read a limited range of commands in the PHOTON command language. This enables it to display images from PHOTON USE files, which may be embedded in the Q1.

The commands it can interpret are:

PHI (+ scale +XYZ) filename
VIEW dir, UP dir
VECTOR plane number(+ MVECTOR)
SET VECTOR REFERENCE vref
SET VECTOR PHASE 1/2
CONTOUR variable plane number(+ MCONTOUR)
SURFACE
GEOMETRY READ
filename     (restricted to PLINE)
DUMP filename
MSG text
PAUSE + UPAUSE
USE
filename


Saving Animations

Animations can be saved in a number of ways. These are:

From the Animation Options dialog recanim.gif (1038 bytes)

This is reached by a right-click on the Animation toggle. The file saved will contain one frame for each time-step of the transient animation (or each sweep of the steady animation). This is the only way to capture a transient animation correctly.

From the Streamline Animation Control dialog

This is reached from the Animate menu of the Streamline Management Dialog. The file saved will contain all the frames making up the streamline animation.

From the Record animation button. recanim.gif (1038 bytes)

Clicking this button on the hand-set brings up the dialog shown below:

Image: Movement
  Animation dialog

Record: starts recording the screen image. The frame counter (left input box) shows the current frame number. Recording will start from the current frame number. This can be changed by moving the frame slider, or entering a number in the frame counter box. Any existing frames with higher numbers will be overwritten. The right input box is the maximum number of frames. This can be increased if required by typing in a larger number.

Play: plays back the recorded image. Playback starts from the current frame. This can be changed by moving the frame slider, or entering a number in the frame counter box.

Pause: pauses recording. Click Record to continue. Any movements made during a pause will not be captured.

Stop: stops recording. The frame counter will be reset to zero for playback.

Save: saves the entire recording as an animated GIF or AVI file.

Image: Save Animation file

The dialog has similar options to the 'Save window as ...' dialog. As well as setting the size of the animation image, it is possible to set the delay time between the display of each frame in the animation. The default delay is one tenth of a second for animated GIF, and 10 frames per second for AVI. When saving AVI the Microsoft Video 1 compression is a good compromise between size and quality.

The 'Start' and 'End' boxes set the first and last frame to be saved. It is often required to have 1-2000 frames for a streamline animation to run smoothly, but it is rarely needed to save all these frames to AVI - the file would be huge. With these settings a much shorter and smaller file can be made.

There is also an option to save the individual frames in the animation as separate image files; these frames may be saved in either the gif, jpeg, bmp or pcx file format.

The name of the current plotting variable is not recorded, so on playback the entire scene will be played with the plotting variable in force at the end of the recording. If animated streamlines are active during the recording, each frame of the streamline will also be captured.

This method of recording is the most general, as it will capture whatever is on screen during the recording period.

Note that when recording transient animations this way, the change of time-steps will not be captured, so on playback the entire scene will be played using the final results. Transient animations must be captured from the Animation toggle dialog.


Contents list