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 (or -1, a shell partition) and its magnitudes grow. 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 partition. A shell partition carries a layer of four-node shell elements, and a gap is a slab that holds no element; the parts chapter explains both.

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.
  • A negative entry is a shell partition, and a solid element stands in a cell only when both partitions bounding it in every direction are positive. A 0 is a gap: it takes a coordinate and a reduced index, and the part is not connected across it. A 0 must lie between two partitions (E0413). A command that names a gap’s reduced index is refused (E0418), and mseq and lmseq are refused in a direction that holds a gap (E0419). The parts chapter gives the rules, and the shells’ corners, normals and thicknesses.
  • Under partmode i an entry is an element count and must be positive (E0400); only the standard mode writes shells and gaps.
  • The state set by partmode and meshscal before the command applies to it.

Diagnostics

  • E0400: under partmode i, an index list entry is zero or negative.
  • E0401: an index list does not start with 1 or -1.
  • E0402: an index list entry’s magnitude does not exceed an earlier one’s.
  • E0403: a coordinate list’s length does not match its index list.
  • E0413: a 0 does not lie between two partitions.
  • E0418 and E0419: related. James raises them at the later command that names a gap or runs mseq or lmseq across one, not at this command.
  • 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.8.0.

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