01.12.2012 Views

OrcaFlex Manual - Orcina

OrcaFlex Manual - Orcina

OrcaFlex Manual - Orcina

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Automation, Text Data Files<br />

4.3.2 Automating Generation<br />

106<br />

w<br />

The <strong>OrcaFlex</strong> Spreadsheet has facilities for automating the generation of text data files for a regular set of cases. To<br />

use this facility select the Pre-processing worksheet, then select the Text Data Files cell and then click the Create<br />

Text Data Files command which can be found on the <strong>OrcaFlex</strong> menu in Excel.<br />

The basic idea is very similar to the facility for automating generation of batch script files. An example table is<br />

shown below:<br />

Figure: Example table for automatic text data file generation<br />

The cell containing "Text Data Files", highlighted in yellow, is known as the anchor cell. The text data files are<br />

generated based on the template file specified the in cell immediately to the right of the anchor cell. In this example<br />

the template file might look like this:<br />

BaseFile: Base Case.dat<br />

Environment:<br />

WaveDirection: %direction<br />

WaveHeight: %height<br />

Line1:<br />

Length[1]: %length<br />

The row immediately below the anchor cell, highlighted in blue, contains variable names. You are free to choose<br />

these names as you please. We have adopted a convention that the variable names begin with a percentage sign (%).<br />

Although you do not need to follow this convention, doing so will have the benefit of making the variable names<br />

stand out.<br />

The rows beneath the variable names row are known as the value rows. Each row defines a single text data file. The<br />

text data file is generated by starting from the template file and then replacing each variable name, in turn, by the<br />

value specified in the table. The %filename variable name is compulsory, that is it must be included as one of the<br />

variable names. It specifies the name of the generated text data file. Relative paths can be used for the template file<br />

name and the output file names.<br />

The extent of the table is determined by the presence of empty cells. So the variable names row ends at the first<br />

empty cell. Likewise the value rows end at the first empty cell in the column beneath the anchor cell.<br />

The example above produces 8 text data files as its output, named Case01.yml, Case02.yml, etc. This first of these<br />

looks like this:<br />

BaseFile: Base Case.dat<br />

Environment:<br />

WaveDirection: 0<br />

WaveHeight: 8<br />

Line1:<br />

Length[1]: 100<br />

Note: The generated text data files adhere to the formatting specified in the Excel cells. So, if a cell is<br />

formatted to have, say, 1 decimal place, the corresponding value in the text data file will also have<br />

1 decimal place.<br />

Choosing variable names<br />

It is clearly important that you choose unique variable names. However, there is a further subtlety which can arise<br />

when one variable name is a sub-string of another. For example, consider the variable names %x1 and %x10. When

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!