You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

New XBeach repository and portal website

The new XBeach portal website is released on http://oss.deltares.nl! It replaces the general parts of this WIKI space and the Google Groups website.
The Subversion (SVN) repository is migrated as well. The new address is: https://svn.oss.deltares.nl/repos/xbeach. Read the instruction on how to register and create a new working copy or how to relocate to start using the new SVN server.

XBeach structure

A few very specific functions in the XBeach Toolbox just return the desired result. If any flexibility of the returned value is needed, the XBeach structure is used. For example, the result of the xb_read_input function, which reads an entire model input, returns such a structure. Several XBeach structures can be nested into each other. The xb_human collection of functions provides low-level interaction functions for the XBeach structure.

Format

An example of a full-formatted XBeach structure is given below. The "data" field contains the actual data. All other fields contain meta-information added by the several toolbox functions.

xb = struct(
    'date',     '01-Dec-2010 00:00:00'
    'function', 'xb_read_input',
    'type',     'input',
    'file',     'C:\path_to_model\params.txt',
    'data',     [1x7 struct]
);

The field "data" contains a structure array, which contains the actual data. An example of such structure array is:

data = struct(
    'name',  {'nx', 'ny', 'xfile',      'yfile',      'depfile',    'xori', 'yori' },
    'value', {200,  3,    [1x1 struct], [1x1 struct], [1x1 struct], 12345,  67890  },
    'units', {[],   [],   [],           [],           [],           'm',    'm'    }
);

The fields "xfile", "yfile" and "depfile" are nested XBeach structures, which can look like this:

bathy = struct(
    'date',     '01-Dec-2010 00:00:00'
    'function', 'xb_read_bathy',
    'type',     'bathymetry',
    'file',     {'C:\path_to_model\x.grd', 'C:\path_to_model\y.grd', 'C:\path_to_model\bed.dep'},
    'data',     [1x3 struct]
);

Again, all fields contain meta-information except the "data" field. The "data" field contains a structure array which can look like this:

data = struct(
    'name',  {'xfile',        'yfile',        'depfile'      },
    'value', {[200x3 double], [200x3 double], [200x3 double] },
    'units', {'m',            'm',            'm'            }
);

Usage

The xb_human function collection provides low-level functions to interact with the XBeach structure. The most important functions are described in the following table:

Function

Description

xb_empty

Returns an empty XBeach structure

xb_set

Sets one or more specific fields in a XBeach structure or nested structure

xb_get

Returns one or more specific field values from a XBeach structure or nested structure

xb_meta

Sets meta-information in XBeach structure (date, function, type and filenames)

xb_check

Returns a boolean indicating if the supplied variable is a valid XBeach structure

xb_show

WHOS-like display of XBeach structure or nested structures with regexp-based filtering

  • No labels