block

block opens a part: a structured grid of one or more rectangular blocks of elements, laid out from three index lists and three coordinate lists.

Syntax

block i_index_list ; j_index_list ; k_index_list ;
      x_coordinate_list [ ; ] y_coordinate_list [ ; ] z_coordinate_list [ ; ]
  • i_index_list, j_index_list, k_index_list: whole numbers, one list for each direction, each ending in ;. Each list starts at 1 and grows. Every entry is a position of a partition line, so the list’s length is the number of reduced indices in that direction. After partmode i each entry is instead the number of elements in one region, and the list is one entry shorter than its coordinate list.
  • x_coordinate_list, y_coordinate_list, z_coordinate_list: reals, one per entry of the matching index list. The ; that ends each of them may be left out. When it is, James splits the run of numbers by the counts of the index lists.

A 0 in an index list marks a gap and a negative entry marks a shell. James refuses both in this version.

What it does

block ends the part that is open, if any, starts a new part and enters the Part phase. The index lists give the node index of each partition line, so the differences between entries are the element counts. The coordinate lists say where the partition lines are. The part’s reduced indices are the positions in the lists, so the part has as many reduced indices in a direction as that direction’s list has entries. The concepts chapter explains reduced indices.

When James applies it

Step 1i of the hierarchy: James lays out the part’s initial vertex coordinates first, before any vertex is moved by pb or any edge is attached to a curve. block is legal in the Control, Part and Merge phases. Read in the Part phase, it closes the open part exactly as endpart does.

Rules James adds

  • A part whose lists fail still opens. James reports each bad list, then reads every later command of the part against lists it has repaired, so one mistake in a block line gives one diagnostic and no cascade. The part adds nothing to the mesh when it ends.
  • A list with one entry makes one node in its direction and no elements. James meshes the part. It has no element, so James warns and writes none of its nodes unless you pass --write-unref-nodes.
  • James refuses gaps (E0413) and shell partitions (E0400) in this version. The compatibility chapter says when they come.
  • The state set by partmode and meshscal before the command applies to it.

Diagnostics

  • E0400: an index list has a negative entry.
  • E0401: an index list does not start with 1.
  • E0402: an index list entry does not exceed an earlier one.
  • E0403: a coordinate list’s length does not match its index list.
  • E0413: an index list holds a 0.
  • E0416: related. James raises it at end or at the end of the input, not at this command, when a part is still open.

Example

The script tests/corpus/030-block-ends-open-part/input.tg, which make test runs:

block 1 3; 1 3; 1 2; 0 1; 0 1; 0 1;
pb 2 2 1 2 2 1 x 5
block 1 2; 1 2; 1 2; 0 1; 0 1; 0 1;
endpart

The second block closes the first part without an endpart. The IR holds two parts, and the pb belongs to the first.

See also

  • cylinder: the same lists in radius, angle and height.
  • endpart: ends the part.
  • partmode: changes what the index lists mean.
  • meshscal: scales every part’s element counts.
  • Parts: the six lists in detail.

James 0.3.1.

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