What are the minimum requirements for Matlab (i.e. oldest release) that I need to run the FV visualisation tools?

Ta

Michael

]]>By using the "bounds" input you can trim down the model thus making it more manageable when zooming, rotating and panning in 3D.

Example:

% create the fvcontrol object (if you are not going to add any other fvg objects then you could just create a figure) fvcObj = fvgraphics; % create the axes into which to plot your bathymetry. ax = axes; % use the DataAspectRatio property to scale the elevations with respect to the x-y plane. set(ax,'DataAspectRatio',[1 1 0.1]) % set(ax,'DataAspectRatio',[1 1 10000]) % Something more like this will be required when your model is in spherical coordinates % plot the bathymetry within the rectangle defined by 4 points h = mybathy(ax,'mymodel.nc','bounds',[x1 y1; x2 y2; x3 y3; x4 y4]); % manually adjust the view angle using the pan, zoom and rotate 3D icons in the figure tool bar % apply some lighting (see matlab help doc) lighting phong camlight right]]>

If you want to input some function that requires input from two separate model runs, this can be achieved with a simple specifier.

First you need to input a cell array of model files in the modfil input, the order of this is important.

Then, (for example if we were comparing water level between two runs with different bathymetery), we specify our variables with M1. or M2. beforehand.

eg.

'M1.H - M2.H' will subtract the water level of the second model in the model cell array from the water level of the first model.

This has the same limitations of normal expressions, therefore at this stage it is not possible to do these comparisons on models with different numbers of cells.

]]>The handle to this patch object is stored as a property of the fvg objects, which allow us to customize various aspects of the visualisation.

Just a few of the options for this:

If you want to apply a slight transparency to the entire mesh equally, you can edit the patch object's facealpha property.

sheet1 = fvgsheet(fobj, modfil) patchhandle = sheet1.PatchObj; set( patchhandle , 'FaceAlpha', 0.5)

This sets all the faces of the patch to be 50% transparent.

Be careful when setting these patch properties as some of them will be updated by moving the slider bar, and all your hard work will be erased.

for more info on patches and their properties, see MathWorks documentation on patches.

http://www.mathworks.com.au/help/matlab/ref/patch.html

http://www.mathworks.com.au/help/matlab/ref/patch_props.html

]]>

]]>

Just put a dollar sign ($) in front of the variable that you wish to include from your workspace, ie. if you have a variable a=2; and you want to offset your water levels by this then '$a+H' would be your expression string.

For single scalars though it is probably better to specify it directly, ie. if you want to offset all the water levels by 2m then 'H+2' is easier than storing the 2m in a variable beforehand.

The real strength of this is for vectors, keep in mind that as usual, these vector and matrix operations will have specific limitations on size, and there are no extra checks in place to account for this. A useful example of using this is to plot the difference in a variable since a particular timestep, for example the start.

A quick example is plotting the total change in bed level since the beginning of the model run, it will require extracting a variable seperately first.

tmp = netcdf_get_var(modfil,'names','ZB','timestep',1); %BMTWBM function that will extract ZB at the first timestep firstbedlevel = tmp.ZB; %get it out of a structure and save it to a useful variable fobj = fvgraphics; %usual, gca customsheet = fvg_sheet(fobj, modfil, 'expression', 'ZB - $firstbedlevel')

There are a lot of possibilities with this, the only downside being that it does require a bit of setting up first to get the variable that you want. Keep in mind that this variable will be 'saved' into the function persistantly, so even if you clear the original 'firstbedlevel' from your workspace, or change it, only the original one will be used in the calculations.

If you wish to update the variable, then you must call the 'set' method on the expression again.

ie.

firstbedlevel = firstbedlevel+1; %changed the variable set(customsheet,'expression','ZB - $firstbedlevel'); %now it will bring in the new version of 'firstbedlevel';]]>

This allows the users to overload the variables with a custom combination of variables.

The scope of uses for this ranges from changing current velocity units to km/h, up to computing total change in bed level over time.

the expression needs to be a string.

eg.

fvg_sheet(fobj , modfil , 'expression' , 'V*3.6')

This will read in the variable V, then multiply it by 3.6, then plot that. You do not specify the variables when doing this, it is all done on the expression.

This doesnt affect any other properties.

a few things to keep in mind:

- The expression will allow some matlab builtins, sum, hypot, min, max, etc. but the correct, and sensible usage of all the functions is up to the users discretion. The variables that you will be working with will typically have some dimension followed by a number of cells dimension. The first dimension can be depth levels, or it could be number of sediments. keep that in mind when executing expressions that might change depending on whether doing calculations 'element-wise', or on the whole array.
- The expression calculations occur before depth averaging, so operations that occur on 2D and 3D variables at the same time ie. H*SAL will not work.
- Derived variables that may be allowed in the 'variables' property (ie. Vmag) will not be available in the expression string, you will have to calculate these from scratch if you need them, ie. 'hypot(V_x,V_y)'.

Example:

% create the control object fvcObj = fvgraphics; % visualise the wave heights sheetObj = fvg_sheet(fvcObj,'mymodel.nc','Variables','WVHT'); % create the expression which defines the x-component and then the y-component of your vectors. The x-component must come first expression{1} = 'WVHT.*cosd(WVDIR)'; expression{2} = 'WVHT.*sind(WVDIR)'; % create the vector object vecObj = fvg_sheetvec(fvcObj,'mymodel.nc','Expression',expression)]]>