It is not possible to define several iterators in a given class in Python. Therefore, several special “Iterator” classes have been created in Python library. They are returned by the different FeResPost classes as is done for the COM component.
Let us illustrate it by an example... Consider the “each_ply” iterator defined in ClaLam class of FeResPost ruby extension. With the ruby extension, the iteration on the plies of a laminate may be performed as follows:
With Python, the code becomes:
One could also write:
As in the FeResPost ruby extension, each iterator method name starts with “each_”, correspondingly, the Python methods returning an Iterator object have a name that starts with “iter_”. The correspondence between ruby extension methods and COM component methods is obvious: “each_ply” becomes “iter_ply”, “each_material” becomes “iter_material”,...