stp
stp sets the tolerance under which the merge joins surface nodes that lie close together, and it prints a report of what it merged.
Syntax
stp tolerance
tolerance is a real number, in the length units of the mesh.
What it does
stp records a merge tolerance for surface nodes. At the next write, James merges every pair of surface nodes of the covered parts that lie closer together than the tolerance, as st does, and then reports what it merged. It is the usual way to join two parts that touch.
When James applies it
When the next write runs, which merges the parts that the write covers. The command itself only records the tolerance, so it takes effect at that write. It is legal in the Control, Part and Merge phases.
Rules James adds
- The command takes surface nodes only, and both nodes of a pair must be surface nodes. A surface node lies on a face of an element that has no element across it in the same part. That covers the six outer faces of a part and every face that
deordeiexposed. Two parts that touch each have the touching face on their own side, so both count. - Two nodes merge when the distance between them is less than the tolerance. A distance exactly equal to the tolerance does not merge.
- The first-defined node survives. That is the node with the lowest number before merging: parts in order, then k, then j, then i, with i changing fastest. James takes the nodes in that order and merges each one into the closest survivor within the tolerance. Of two survivors at the same distance, it takes the one with the lower number. The rule is not transitive. Three nodes in a row, each 0.9 of the tolerance from the next, leave two nodes: the second merges into the first, and the third is too far from the first and stays.
- A tolerance of zero or below merges nothing. A script uses this to restore a mesh that an earlier tolerance merged.
- Only the last tolerance command read before a
writegoverns that write. Earlier ones, of any of the four commands, have no effect on it. - After a merge the node numbers are dense: the survivors are numbered 1 upward in the order of their old numbers, and the numbers of merged nodes leave no gaps.
- A node that no element uses never merges, whether James writes it or not.
- A merge that leaves an element with zero volume does not drop the element. James writes it and warns,
part #P has N elements with zero volume after merging, once for each part. The number afterpart #counts parts from 0, sopart #0is the first part. A wedge, which is a hexahedron with a collapsed edge, keeps its volume and raises nothing. - James reports the merge after it has written the file. It prints the note
N nodes were deleted by tolerancingevery time, which is the number of nodes before merging less the number after. It then prints one noteN nodes merged between parts A and Bfor each pair of parts that merged a node.Ais the part number of the surviving node andBthe part number of the merged one, withAno larger thanB. A merge inside one part hasAequal toB. The pairs come in order ofB, thenA. A count of one reads1 node was deletedand1 node merged. Writes that cover the same parts under the same tolerance share one merge and one report.
Diagnostics
- E1103: the tolerance is missing or is not a number.
Example
The script examples/two-blocks.tg, which make test runs:
c Two blocks of 3 x 3 x 3 nodes sharing the face x = 1. The stp command
c merges the nine nodes of the shared face and reports what it merged:
c 54 nodes become 45.
c
c james two-blocks.tg --format exodus -o two-blocks.exo
block 1 3;1 3;1 3;0 1;0 1;0 1;
endpart
block 1 3;1 3;1 3;1 2;0 1;0 1;
endpart
merge
stp .001
write
The two blocks of 3 by 3 by 3 nodes share the face x = 1. The comment lines give the command line. It names the format with --format, because the script has none. The nine nodes of the shared face merge, so 54 nodes become 45. James prints this, as examples/two-blocks.diag.txt holds:
two-blocks.tg:11:1: note: 9 nodes were deleted by tolerancing
two-blocks.tg:11:1: note: 9 nodes merged between parts 1 and 2
A tolerance of 0 merges nothing on these blocks. James then prints 0 nodes were deleted by tolerancing, and the file keeps 54 nodes.
See also
- st: the same merge, with no report.
- tp: the same merge and report, for every node.
- write: runs the merge.
- Merge and output: how nodes are merged and numbered.