Inline Summation for Integers


Integer variables and constants may be concatenated with the + and - operators to produce an inline expression (with no embedded blanks) that is evaluated automatically at the time it is encountered. The following example shows two equivalent ways of defining the number of nodes on a GRID command. The first specifies the number of nodes explicitly. The second specifies the number of elements explicitly and uses inline integer summation to add 1 to each value to produce the actual number of nodes

symb inode = 10
symb jnode = 20
grid $inode $jnode /* the number of nodes is explicitly declared
symb ielem = 9
symb jelem = 19
grid $ielem+1 $jelem+1 /* the number of elements is incremented by 1 
0 out of 0 found this helpful



Please sign in to leave a comment.