t2=
t2= sets the second temporary of every node in the region named by dom to the value of an expression, evaluated at that node.
Syntax
t2= expression
t2 = expression
expression: as for x=, which states every rule the six equations share: the variables, the order, the blanks around the=, the line’s end,∧.
What it does
At every node of the region that an active element uses, James evaluates the expression and stores the result as the node’s t2, a value every later equation of the part may read. The rules of x= apply unchanged.
When James applies it
Step 20 of the hierarchy, once, after the part’s last pass, as x= says. Legal only in the Part phase.
Diagnostics
Example
The script tests/corpus/262-squared-index-twist-p280/input.tg, which make test runs:
c the squared-index twist of Vol. 1, p. 280
block 1 2 3 4;1 2 3 4;1 2 3 4;0 1 2 3 0 1 2 3 0 1 2 3
x=i*i;y=j*j;z=k*k; $ each coordinate is its squared index
t1 = sqrt(x*x+y*y) $ radial polar coordinate
t2 = atan2(x,y) $ angular polar coordinate
t2 = t2 + 0.1 * k $ increasing the polar angle
x = t1 * cos(t2) $ convert back to Cartesian
y = t1 * sin(t2) $ ditto
endpart
The manual’s twist: t1 holds each node’s distance from the z axis and t2 its polar angle, which grows with k, so the mesh twists as the index climbs.