FeResPost Web Site                     FeResPost Online User Manual

IV.2.8.3 Accessing results

We give here an example, in which CBAR element forces are read from the XDB file. This is done to illustrate the extraction of element results. Otherwise, there is no practical use to this example, as the corresponding extractions can be done by the “usual” XDB result extraction methods. The example is provided in file “RUBY/EX22/recoverFBAR.rb”.

One first attempts to access the definition of load cases:

db.each_xdbRaw(xdbFileName,["SUBCASES",0],"iiiiiiii") do |tab|  
    puts tab  
end  
 
str="i"  
(0..95).each do |i|  
    str+="s"  
end  
db.each_xdbRaw(xdbFileName,["SUBCTITL",0],str) do |tab|  
    STDOUT.printf("%d' n",tab[0])  
    (0..2).each do |j|  
        str=""  
        (1..32).each do |i|  
            str+=tab[32*j+i]  
        end  
        str.strip!  
        STDOUT.printf("%s' n",str)  
    end  
end

The integers extracted from “SUBCASES” table correspond to sub-case integer ID, the corresponding load ID, the SPC ID... The access to “SUBCTITL” shows how strings must be concatenated when they correspond to several words.

The reading of CBAR forces is done as follows:

modulo=-1;  
db.each_xdbRaw(xdbFileName,["FBARR",2],"iiiiiiiii") do |tab|  
    if (tab[0]==0) then  
        modulo=tab[1]  
    end  
    break;  
end  
db.each_xdbRaw(xdbFileName,["FBARR",2],"iffffffff") do |tab|  
    accessType=12  
    if (tab[0]>0) then  
        elemIntId=tab[0]/modulo  
        elemExtId=db.getAttachmentElementExtId(xdbFileName,accessType,elemIntId)  
        STDOUT.printf("%30s : %d' n","Element ID",elemExtId)  
        STDOUT.printf("%30s : %g' n","M bending A 1",tab[1])  
        STDOUT.printf("%30s : %g' n","M bending A 2",tab[2])  
        STDOUT.printf("%30s : %g' n","M bending B 1",tab[3])  
        STDOUT.printf("%30s : %g' n","M bending B 2",tab[4])  
        STDOUT.printf("%30s : %g' n","F shear 1",tab[5])  
        STDOUT.printf("%30s : %g' n","F shear 2",tab[6])  
        STDOUT.printf("%30s : %g' n","F axial",tab[7])  
        STDOUT.printf("%30s : %g' n' n","M torque",tab[8])  
    end  
end

One must add a few explanations: