SMS:Command Objects: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
Line 12: Line 12:


==Creating Command Objects==
==Creating Command Objects==
Command objects are created using right-click commands in the project explorer. After creating a TUFLOW simulation, a folder named “Command Objects” in the TUFLOW root folder should appear. Create command objects by right-clicking on the “Command Objects” folder, choosing '''Create Command Object''', and choosing the appropriate type from the submenu. This will create a folder for command objects of this type along with a new command object. This approach can be repeated to create additional command objects of the same or different type.
Command objects are created using right-click commands in the project explorer. After creating a TUFLOW simulation, a folder named “Command Objects” in the TUFLOW root folder should appear. Create command objects by right-clicking on the “Command Objects” folder, choosing ''Create Command Object'', and choosing the appropriate type from the submenu. This will create a folder for command objects of this type along with a new command object. This approach can be repeated to create additional command objects of the same or different type.


==Editing Command Object Contents==
==Editing Command Object Contents==

Revision as of 15:37, 29 February 2016

Command Objects provide the ability to provide additional commands for TUFLOW simulations using the TUFLOW command file syntax. The SMS interface provides some guidance for using these commands and allows users to link to objects created in SMS. Command objects can be used for:

  • Create scenarios to do multiple runs using the same simulation.
  • Share commands between multiple simulations or 2D Geometry components.
  • Utilize commands not available in the SMS interface.
  • Enter commands to read GIS data generated outside of SMS.

TUFLOW Command Object syntax is described in the TUFLOW Manual. Each line (except for blank/comment lines) has a command identifier. After the identifier most commands have are followed by a double equals “==” and a command value. In some cases, the command value may have multiple parts separated by blank spaces or “|.” A few commands don’t have any arguments and do not have a “==” at all.

Types of Commands

There are several kinds of commands that can be utilized through command objects. The types of commands that can be issued used include: 2D Model control commands (*.tcf), 1D Model control commands (ecf), 2D Geometry commands (tgc), Boundary conditions commands (*.tbc), and commands for specific events (*.tef). The event commands are defined with each event when using composite events. The rest are managed in the project explorer as command objects.

The Appendix of the TUFLOW manual contains a complete list of the commands that are available, the purpose of each command, and its syntax. The identifiers above in parentheses (*.tcf, *.ecf, *.tgc, *.tbc, and *.tef) are the abbreviations used by TUFLOW for file naming and also used to find the appropriate section of the Appendix for a set of commands.

Creating Command Objects

Command objects are created using right-click commands in the project explorer. After creating a TUFLOW simulation, a folder named “Command Objects” in the TUFLOW root folder should appear. Create command objects by right-clicking on the “Command Objects” folder, choosing Create Command Object, and choosing the appropriate type from the submenu. This will create a folder for command objects of this type along with a new command object. This approach can be repeated to create additional command objects of the same or different type.

Editing Command Object Contents

When command objects are first created, their contents are blank. A user can edit the contents of a command object by double clicking on the object or right-clicking and choosing “edit.” This will bring up the command object editor dialog.

The command object editor dialog has two main parts. One part consists only of a text editor. The text in this editor is what is stored with the command object and will be used with the TUFLOW model. The commands for the object may be typed directly into the editor. Comments may be added and must start with the exclamation mark (!).

The other part of the dialog contains controls to assist the user in creating commands for the command object. There is a control showing the list of commands in a tree structure organized by the appendix where the command is found in the TUFLOW manual. This part of the dialog will also contain other controls based upon the command that is selected in tree control. For example, if the command requires a single floating point value a edit control will shown where the user can specify the value for the command.

Once the command creation controls have been specified as desired, the command is inserted into the command text using the insert button. Once this has been done, editing of the command must be done in the editor. A user can’t edit commands already created using the create command controls. A user can delete an existing command and insert another to use the controls to setup the command text.

Using Command Objects in Simulations

With the exception of event command objects (discussed later), command objects are used by creating links to the objects from simulations and geometry components. Links are created by dragging the command object under the simulation object. 2d model control command objects and 1d model control command objects are linked to simulations. 2D geometry commands and boundary condition commands are linked to 2D Geometry Components.

When a command object is linked to a simulation or geometry component, SMS writes a file with the exact text from the command object and links to the file from the TCF or TGC file as appropriate. Command objects are always used after any commands specified in the SMS interface and therefore will override duplicate specifications. Multiple command objects can be linked to the same object and will be used in order from top to bottom. Command objects can override settings defined in command objects used previously.

Event command objects are only used with composite events (** need to add link to this help topic). To set commands for a composite event, click on the button “Additional commands” in the TUFLOW events dialog (***link to dialog help). This text will be stored with the event and written to a file with the extension “tef” which will be used when running TUFLOW. The event command objects do not show up in the project explorer.

Scenarios in Command Objects

TUFLOW command objects can define scenarios in order to setup multiple models that have shared data without the need for separate simulation objects. Anything not specified for one or more scenarios is used in all scenarios for the simulation. Scenarios could be used to model different geometries by including z-lines or tins for specific scenarios but not others.

Scenarios can only be defined using command objects. Scenarios are defined by using the following commands:

  • If Scenario
  • Else If Scenario
  • Else
  • End If

A scenario block must start with “If Scenario” and end with “End If.” The other commands are optional.

Related Topics