Model.morphwritenodes#

Model.morphwritenodes(filename, mode)#

Writes out a file with the specified name and list the positions and perturbations of a number of nodes in the model according to the specified mode.

The first three lines of the file will contain the filetype declaration, the maximum size of the model, and the maximum perturbation of any node in the model. The maximum model size is the length of the diagonal of the smallest box aligned with the global system which contains all of the nodes in the model.

The format of the remaining lines will have “Node”, followed by the node ID and the x, y, and z positions of the node on the first line and the x, y, and z perturbations on the second line.

Parameters:
  • filename (hwString) – The full path and name of the output file.

  • mode (int) –

    0 - Write all nodes.

    1 - Write perturbed nodes only.

    2 - Write out nodes with perturbations larger than 1% of the tolerance parameter. The morphing tolerance parameter can be set using the function Model.morphupdateparameter() with the handletolerance option.

Examples#

Write out a file containing all the nodes in the model#
import hm
import hm.entities as ent

model = hm.Model()

model.morphwritenodes(filename="nodefile.txt", mode=0)
Write out a file containing only the perturbed nodes#
import hm
import hm.entities as ent

model = hm.Model()

model.morphwritenodes(filename="nodemovefile.txt", mode=1)