mseq

mseq changes the number of elements in every region of one direction of the open part.

Syntax

mseq direction d1 d2 ... dn [ ; ]
  • direction: i, j or k.
  • d1 to dn: signed whole numbers, one for each region of that direction. Each is added to that region’s element count. A direction with n + 1 index entries has n regions.

The closing ; may be left out.

What it does

mseq gives each region a new element count and leaves the partitions and coordinates alone. The result is the same as writing the new counts into the part’s own index list.

When James applies it

When it is read, in the Part phase. mseq is not one of the 21 steps. James folds it into the part’s index list at once, so every later command sees the new element counts.

Rules James adds

  • mseq reads every number it finds, up to the ; or the first word that is not a number, and then compares the count with the number of regions. Too many values and too few both give E0406.
  • mseq after a coordinate equation is accepted (tests/corpus/269-mseq-after-equation-accepted): the equation runs at step 20 over the part’s lists as they stand at the end, and TrueGrid’s own examples issue mseq after a z=. update is not supported in this version (E0100); once it is, mseq after it will be refused (E0408), not ignored.
  • A number written in an equation, such as the 3 of i .eq. 3 or the 14 of (j-14)/3, names a node of the part’s final lattice, so an mseq written after the equation changes which node it names. %idxlist(n) names the n-th partition whatever the lattice (x=).

Diagnostics

  • E0406: the direction is not i, j or k, or the number of values is not the number of regions.

Example

The script tests/corpus/166-mseq-doubles-j/input.tg, which make test runs:

c mseq j adds two elements to each j region, so 1 3 5 becomes 1 5 9.
block 1 3;1 3 5;1 2;0 1;0 1 2;0 1;
mseq j 2 2
endpart

The j list 1 3 5 has two regions of two elements. Adding 2 to each makes them four, and the IR shows the j list as [1 5 9]. The part has twice as many elements along j.

See also

  • lmseq: changes one region only.
  • insprt: adds a partition.
  • meshscal: scales every part’s counts.
  • Parts: element counts in detail.

James 0.8.0.

This site uses Just the Docs, a documentation theme for Jekyll.