8.1.5 Methods returning string representations

point2str( point)
Return a string representation of a point. The string holds the three coordinates, separated by a comma. This is a class method, not an instance method.

elem2str( elem)
Return a string representation of an element. The string contains the string representations of all the element's nodes, separated by a semicolon. This is a class method, not an instance method.

asFormex( )
Return a string representation of a Formex.

Coordinates are separated by commas, points are separated by semicolons and grouped between brackets, elements are separated by commas and grouped between braces. Thus a Formex F = Formex([[[1,0],[0,1]],[[0,1],[1,2]]]) is formatted as '{[1.0,0.0,0.0; 0.0,1.0,0.0], [0.0,1.0,0.0; 1.0,2.0,0.0]}'.

asFormexWithProp( )
Return string representation as Formex with properties. The string representation as done by asFormex() is followed by the words "with prop" and a list of the properties.

asArray( )
Return a string representation of the Formex as a numpy array.

setPrintFunction( func)
This sets how a Formex will be formatted by the print statement or by a "%s" formatting string. func can be any of the above functions asFormex, asFormexWithProp or asArray, or a user-defined function.

This is a class method, not an instance method. Use it as follows: Formex.setPrintFunction(Formex.asArray).

fprint( fmt="%10.3e %10.3e %10.3e")
Prints all the points of the formex with the specified format. The format should hold three formatting codes, for the three coordinates of the point.