Script Detailed Description

This script creates a portion of the naUTilus ISBL input file. Using the branch and node attribute tables, it creates a new virtual table which holds the information required by naUTilus to establish branch/node connectivity.

naUTilus establishes branch node connectivity by creating an incidence matrix. This matrix is an two dimensional array with n rows and m columns, where:

This matrix is, for the most part, empty. A value of "1" is placed in a cell (n,m) if branch m flows into node n. If branch m flows out of node n, a value of "-1" is placed in the cell (n,m).

To create this matrix, the naUTilus input file reads the following for each node:

The first line indicates that three branches flow into or out of the node and that the nodes is a junction (indicated by the value 1 in the second position of the line). The second and third lines indicate that branches 2 and 4 flow into the node. Inflow is indicated by the value of 1 in the second position of each line. The fourth line indicates that branch 5 flows out of the node. Similar to second and third lines, the second value in the row indicates the direction of the flow. A set of lines similar to this is required for each node in the system. Note that only the nodes numbered by the naUTilus numbering system should have data in the new table.

The script creates the required lines for each node in the system. It begins by creating a new table (nodecon.dbf) consisting of two fields. It creates several lists which are used to fill the two fields with the appropriate values. The lists created are:

The script goes through these lists several times. First, the script fills the naUTList. If the value in naUTList is zero, the first loop is ignored because the node is not considered by naUTilus. For nodes which are numbered in both the ArcView and naUTilus systems, a record is added to the new table. Then, the node number is found in TNodeList using the command FindByValue. Because the command FindByValue only finds the first occurrence of a value in a list, to find the number of occurrences in the list, the script deletes the values once they are found. In this way, the number of branches which flow into the nodes is found. This number is stored in NumConList.

For each branch flowing into a node, the script adds a record to the table. It also adds one line for the outflowing branch and one line to hold the number of inflowing/outflowing branches and the node type. To fill the records with the appropriate values, values in TNodeList are restored to the original values and the lists are processed again.

The first line entered for each node is the number of branches (inflowing or outflowing) connected to the node. This value is read from the NumConList. The script then checks to see if that node is a manhole or a junction. The second value of the first line (for each node) is then set as 1 for junction or 2 for manhole.

The value from NumConList also indicates the number of iterations to be made by the next loop. The loop searches through TNodeList to find which branches flow into the node. The index number from TNodeList indicates which branch flows to the node. By searching through FNodeList, the branch which flows out of the nodes is found. The branches are recorded in the next 2-4 lines of the table. Note that some manipulation is done to adjust for the difference in ArcView and naUTilus numbering.

Key Avenue commands used:

Return to Update document