insprt

insprt inserts one new partition into the open part, next to a reduced index, and renumbers every command already given for the part.

Syntax

insprt sign type index n_elements
  • sign: 1 for a solid partition. -1 asks for a shell, which James refuses.
  • type: 1 to 6. It picks the direction and the side of index the new partition lies on: 1 is i to the left, 2 i to the right, 3 j to the left, 4 j to the right, 5 k to the left and 6 k to the right.
  • index: a reduced index of the part in the direction type picks.
  • n_elements: the number of elements of the new region, a positive whole number.

What it does

insprt adds a partition line to one direction of the part. The part then has one more reduced index in that direction. When the new partition splits an existing region, the new region takes n_elements of that region’s elements, so the count must be smaller than the region’s. When the insertion lies past either end of the list, the new region has zero width: its new coordinate repeats the end coordinate, and its vertices lie on the end vertices.

When James applies it

When it is read, in the Part phase. insprt is not one of the 21 steps. James rewrites the part’s lists at once, so the hierarchy only ever sees the result.

Every command issued before the insprt has its reduced indices renumbered in the direction type picks, so that each still names the partition it named before. For a left type (1, 3, 5) an index at or above index becomes one larger. For a right type (2, 4, 6) an index above index becomes one larger. Indices below stay as they are. A command issued after the insprt is read against the new numbering, as any command is.

Rules James adds

  • A shell (sign -1) is refused with E0400.
  • An insertion between two partitions adds no coordinate command. The new vertices take interpolated places, so the mesh keeps its shape and gains a partition line.
  • An insertion past either end of a list collapses the new region onto that end’s vertices. A later pb can move them apart.

Diagnostics

  • E0405: the sign, type, index or element count is invalid, or the element count is not smaller than the region it splits.
  • E0400: the sign is -1.

Example

The script tests/corpus/165-insprt-renumbers-later-pb/input.tg, which make test runs:

c The pb names reduced i 2; the insprt that follows renumbers it to i 3.
block 1 3 5;1 3;1 2;0 1 2;0 1;0 1;
pb 2 1 1 2 2 1 z 0.5
insprt 1 1 2 1
endpart

The insprt puts one new element to the left of reduced index 2, so the i list becomes [1 2 3 5] with the coordinates [0 0.5 1 2]. The pb was written before it and named reduced index 2. The IR shows its region as 3 1 1 3 2 1, the same vertices as before. The pb still moves the edge at x = 1, z = 0.

See also

  • mseq: changes element counts without adding a partition.
  • de: deletes part of a block after insprt splits it.
  • pb: a command that insprt renumbers.
  • Concepts: reduced indices.
  • Parts: inserting partitions.

James 0.3.1.

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