tp
tp sets the tolerance under which the merge joins nodes of any part that lie close together, and it prints a report of what it merged.
Syntax
tp tolerance
tolerance is a real number, in the length units of the mesh.
What it does
tp records a merge tolerance. At the next write, James merges every pair of nodes of the covered parts that lie closer together than the tolerance, as t does, and then reports what it merged. Use it when you want to see which parts joined and how many nodes they gave up.
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 every node of the parts that the
writecovers. - 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 tests/golden/011-merge-chain/input.tg, which make test runs:
c Three unit cubes, each 0.9 of the tolerance along x from the one before.
c The second merges into the first; the third is 1.8 tolerances from the
c first and the second did not survive, so it stays: 24 nodes become 16,
c where a rule that merged through a chain would leave 8.
block 1 2;1 2;1 2;0 1;0 1;0 1;
endpart
block 1 2;1 2;1 2;.009 1.009;0 1;0 1;
endpart
block 1 2;1 2;1 2;.018 1.018;0 1;0 1;
endpart
merge
tp .01
neutral
write
Three unit cubes stand in a row, each 0.009 along x from the one before, and the tolerance is 0.01. The second cube merges into the first. The third is 0.018 from the first, which is more than the tolerance, and the second did not survive, so the third stays. The 24 nodes become 16, where a rule that followed the chain would leave 8. James prints this, as tests/golden/011-merge-chain/input.diag.txt holds:
input.tg:12:1: note: 8 nodes were deleted by tolerancing
input.tg:12:1: note: 8 nodes merged between parts 1 and 2
See also
- t: the same merge, with no report.
- stp: the same merge and report, for surface nodes only.
- write: runs the merge.
- Merge and output: how nodes are merged and numbered.