FeResPost Web Site                     FeResPost Online User Manual

IV.2.4.1 Inspecting Results contained in a DataBase

The following example prints the information on Results available in the DataBase. It starts with the following lines:

   require "FeResPost"
   include FeResPost

   #DataBase::disableLayeredResultsReading
   #DataBase::disableSubLayersReading("Bottom")
   #DataBase::disableSubLayersReading("Mid")
   #DataBase::disableSubLayersReading("Top")

The commented lines are methods that disable partially or entirely the reading of composite element layered Results. After reading the corresponding manual in section I.1.3.2, you may un-comment some of these instructions to check the effect on the reading of composite Results.

The main part of the example program looks like this:

# Reading or generating Results :

   db.readOp2("../../MODEL/EXEC_OP2/unit_xyz.op2","Results")

   db.generateCoordResults
   db.generateCoordResults("Fake Coords Case","No SubCase","coords")

# Inspecting and reading Results :

   db.each_resultKeyCaseId do |lcName|
      printf("LOADCASE: \"%s\"\n",lcName)
   end
   db.each_resultKeySubCaseId do |scName|
      printf("SUBCASE: \"%s\"\n",scName)
   end
   db.each_resultKeyLcScId do |lcName,scName|
      printf("LOADCASE and SUBCASE: \"%s\" - \"%s\"\n",lcName,scName)
   end
   db.each_resultKeyResId do |resName|
      printf("RESULT: \"%s\"\n",resName)
   end

   db.each_resultKey do |lcName,scName,tpName|
      tmpRes=db.getResultCopy(lcName,scName,tpName)
      printf("%-20s%-15s%-50s%-10d\n",lcName,scName,tpName,\
             tmpRes.Size)
   end

It works as follows:

The example is provided in file “RUBY/EX04/printResLists.rb”.

Another example illustrating the reading of Results from a Nastran OP2 file is provided in file “RUBY/EX04/printResLists_filter.rb”. This example illustrates the use of “readOp2FilteredResults” method.