FeResPost Web Site                     FeResPost Online User Manual

VII.1.4.2 Laminate load response with FE Results

This example is stored in file “COMEX/EX05/testClaFem.rb”. It corresponds to the example “RUBY/EX15/testClaFem.rb” described in section IV.3.6. Just one remark about this example: the COM methods do not accept the ruby “Hash” arguments. Therefore, this argument must be translated into Arrays the elements of which are Arrays of two elements corresponding to the keys and values respectively. In ruby, this operation is done by calling the “to_a” method of Hash class. For example, the insertion of allowables in a Laminate is done as follows:

         lam=compDb.getLaminateCopy(6)  
         allowables={}  
         allowables["sc"]=200.0e6  
         allowables["s1c"]=200.0e6  
         ...  
         allowables["s12"]=100.0e6  
         allowables["ilss"]=30.0e6  
         lam.insertAllowables(allowables.to_a)  
         compDb.insertLaminate(lam)

The example is also translated in python in file “COMEX/EX05/testClaFem.py”. Then, the “items” method of “map” class is used to produce an Array suitable for allowables insertion:

         lam=compDb.getLaminateCopy(6)  
         allowables={}  
         allowables["sc"]=200.0e6  
         allowables["s1c"]=200.0e6  
         ...  
         allowables["s12"]=100.0e6  
         allowables["ilss"]=30.0e6  
         lam.insertAllowables(allowables.items())  
         compDb.insertLaminate(lam)

Note also the use of “Dispatch” method in python to retrieve Result objects from an Array like in the following statements:

         for tab in outputs:  
            id=tab[0]  
            res=Dispatch(tab[1])  
            util.printRes(os,id,res)

(We presume that the “Dispatch” statement is necessary to convert a VARIANT.)