write
write writes one mesh file. It is the only command that does.
Syntax
write
The command takes no argument.
What it does
James merges the parts under the governing tolerance and writes the result in the chosen format. Neither entering the Merge phase nor choosing a format writes anything: only write does. Each write makes one file.
The name of the file comes from mof if the script gave one, then from the -o flag, then it is trugrdo. The first write under a name uses the name as it stands. The second write under the same name appends .0001, the third .0002, and so on. James counts each name on its own, so a mof to a new name starts a new count.
The format comes from exodusii or neutral in the script, or else from --format on the command line. The script wins when both are present.
When James applies it
When it is read, in the Merge phase. write is legal only in the Merge phase. James refuses it in the Control and Part phases (E1100).
Rules James adds
- A
writewith no format, from the script or from--format, is an error (E1101). - A
writewith no tolerance command before it merges nothing. The numbering then follows the order of the parts. - After a merge the node numbers are dense, with no gaps where merged nodes were. James writes only the nodes that an element uses. The flag
--write-unref-nodeswrites every node of every part. A part whose elements are all deleted raises a warning that says how many of its nodes are not written. - The merge report, if the governing tolerance is
tporstp, and the warnings of the merge come after James has written and closed the file. A tolerance that leaves an element with zero volume warns, and James still writes the element. - A
writethat would exceed 250,000,000 grid nodes in the parts it covers is an error. James checks the count before it allocates anything. - If James cannot open the file for writing, it says so and leaves any file already there as it was. If a neutral write fails partway, James deletes the part-written file.
Diagnostics
Example
The script tests/corpus/141-write-suffix-per-name/input.tg, which make test runs:
block 1 2;1 2;1 2;0 1;0 1;0 1;
endpart
merge
neutral
write
write
mof other.out
write
mof trugrdo
write
The script writes four files. The first write makes trugrdo. The second makes trugrdo.0001. After mof other.out, the third makes other.out. After mof trugrdo, the fourth returns to the first name and makes trugrdo.0002. The IR holds the four names on its write rows.