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:1for a solid partition,-1for a shell partition, as a negative entry of ablocklist is. A shell partition carries a layer of shell elements and takes the solid elements beside it away; the parts chapter gives the rules.type:1to6. It picks the direction and the side ofindexthe new partition lies on:1is i to the left,2i to the right,3j to the left,4j to the right,5k to the left and6k to the right.index: a reduced index of the part in the directiontypepicks.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. A dom issued before the insprt is renumbered with the rest, so the equations after it keep their region (tests/corpus/277-insprt-after-equation-renumbers-dom).
Rules James adds
- A shell (
sign -1) is built as the new list entry negative. Inserted between two solid partitions it removes the solids on both sides of it, as a negative entry ofblockdoes (tests/corpus/229-insprt-shell-partition). Inserted past either end of the list it puts a skin of shells on the end face, with their own nodes: the skin of the TrueGrid Examples manual, p. 245, whichtests/golden/038-shell-skinwrites inblockas the list-1 2 5 -6. - An insertion beside a gap, or inside a gap’s slab, is refused (E0418).
- A number written in a coordinate equation, such as the
3ofi .eq. 3or the14of(j-14)/3, names a node of the part’s final lattice, so aninsprtwritten after the equation changes which node it names.%idxlist(n)is the n-th entry of the final list, so an insertion before the n-th entry makes it name another partition too (x=). - 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
pbcan move them apart. A shell skin made this way lies on the end face. Any other shell plane that crosses the collapsed slab is left with shells of zero height in the new region, and the write warns of them as folded or collapsed.
Diagnostics
- E0405: the sign, type, index or element count is invalid, or the element count is not smaller than the region it splits.
- E0418:
indexor the partition beside it is a gap, or the new partition would lie inside a gap’s slab.
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.