FeResPost Web Site                     FeResPost Online User Manual

IV.2.4.4 Printing Results’ content

One presents here an example in which Results corresponding to the STRAIN Nastran output statement are printed. Note that the non-diagonal components of the Nastran tensors corresponding to STRAIN statement are multiplied by two by Nastran. So, when imported into a DataBase, one divides the corresponding components by two (see remark 4 page 831 in Chapter III.1).

The preliminary part of the program is similar to the previous one: one initializes a DataBase, imports a Nastran model, produces the Groups and read Results. Then, the strain tensor in the honeycomb of +Z panel is output. This is done as follows:

   targetGrp = db.getGroupCopy("pan_PZ_Honey_72")  
   strain =  db.getResultCopy("TEMP_GRAD_X","Statics",'  
      "Strain Tensor","ElemCenters",targetGrp,[])  
 
   puts  
   puts "Strain tensor in panel +Z honeycomb :"  
   puts  
   strain.each("int","int","int") do |key,values|  
      for j in 0..3  
         printf("%10s",key[j].to_s)  
      end  
      if (values[0]) then  
         printf("%10s",values[0].to_s)  
      else  
         printf("%10s","nil")  
      end  
      for j in 1..6  
         printf("%14f",values[j])  
      end  
      printf("' n")  
   end

The "each" iterator is used with three "int" parameters. This leads to a printed output in which the layers are output with integer values.

In surface elements, two Results correspond to the STRAIN Nastran output statement: the strain tensor and the curvature tensor. The way components of the strain tensor are printed is similar as for the honeycomb. For the curvature tensor, the print is done as follows:

   targetGrp = db.getGroupCopy("pan_PZ_Al_2024")  
   strain =  db.getResultCopy("TEMP_GRAD_X","Statics",'  
      "Strain Tensor","ElemCenters",targetGrp,[])  
 
   puts  
   puts "Strain tensor in panel +Z skins :"  
   puts  
   strain.each do |key,values|  
      for j in 0..3  
         printf("%10s",key[j].to_s)  
      end  
      if (values[0]) then  
         printf("%10s",values[0].to_s)  
      else  
         printf("%10s","nil")  
      end  
      for j in 1..6  
         printf("%14f",values[j])  
      end  
      printf("' n")  
   end

This example is provided in file "RUBY/EX08/printStrain.rb".

Similarly, one print Results corresponding to Forces and Moments in CBAR elements. The interesting part is given below:

   targetGrp = db.getGroupAllFEM  
 
   forces = db.getResultCopy("LAUNCH_ONE_MS2_X","Statics",'  
      "Beam Forces","Elements",targetGrp,[])  
 
   moments = db.getResultCopy("LAUNCH_ONE_MS2_X","Statics",'  
      "Beam Moments","Elements",targetGrp,[])  
 
   Util::printRes(STDOUT,"Forces",forces)  
   Util::printRes(STDOUT,"Moments",moments)

The reader will observe in Results that “Beam Forces” in CBAR elements are given at the center of elements only, while “Beam Moments” are printed at the two end nodes of each element.

This example is provided in file "RUBY/EX08/printBeamForces.rb".