FeResPost Web Site                     FeResPost Online User Manual

IV.4.1.1 Management of databases and load cases

Module “DbAndLoadCases” is devoted to the management of FEM databases and load cases. Three classes are defined in the module:

All the static load cases that have been defined in “DbAndLoadCases” module are not necessarily post-processed. The list of static load cases to be post-processed is specified via following instructions:

    DbAndLoadCases.addOneSelection(lcName,params)

The definition of databases, elementary and combined load cases, and of the selection of static load cases are a preliminary step in the post-processing project. This means that corresponding entities must be defined before the loop on static load cases which looks as follows:

    DbAndLoadCases.loopOnStaticCases() do |lcName|  
        puts lcName  
        postList.each do |p|  
            begin  
                p.initCalcSteps()  
                p.calculate("Static")  
            rescue Exception => x then  
                printf("Failed Post object %s with ID %s' n",p.to_s,p.postID())  
                PrjExcept.debug(x)  
            end  
        end  
        DbAndLoadCases.saveMosResults(postList)  
        DbAndLoadCases.saveSrResults(postList)  
    end

For dynamic load cases (post-processing of Nastran SOL 111 analysis), no elementary or combined load cases are defined. Instead, the loop on the different sub-cases is done via instructions that look as follows:

    db=DbAndLoadCases::DB.new(dbName,"NASTRAN",bdfFileName,  
        sesFileNames,claDbs,gmshFileName)  
    DbAndLoadCases.databases[dbName]=db  
 
    DbAndLoadCases.prepareDataBase(dbName)  
 
    DbAndLoadCases.loopOnDynamSubCases(resFileType,resFileName,  
            lcName,fMin,fMax,scNbrMax) do |lcNameA,lcNameB|  
        puts lcNameB  
        postList.each do |p|  
            begin  
                p.initCalcSteps()  
                p.calculate("Dynamic Complex")  
            rescue Exception => x then  
                printf("Failed Post object %s with ID %s' n",p.to_s,p.postID())  
                PrjExcept.debug(x)  
            end  
        end  
        DbAndLoadCases.saveMosResults(postList)  
        DbAndLoadCases.saveSrResults(postList)  
    end

(The loop on sub-cases is obtained via an iterator directly defined in “DbAndLoadCases” without defining “ElemLc” or “CombiLc” objects.) Note that, another iterator is associated to dynamic (complex) results:

    DbAndLoadCases.iterateOnTheta(currentLcName,bakResults) do |srLcName,mosLcName,results|  
        # One performs the calculations with the Real results :  
        @step_1_results=results  
        calc_2(srLcName,mosLcName)  
    end

This iterator produces real Results from the complex Results , corresponding to different phases. (In out post-processing 12 phases are considered for each output frequency.) This iterator is called by the “calculate” method defined in “GenPost” class described in section IV.4.1.2.

“DbAndLoadCases” module also defines the methods that can be used to store results in an SQL database:

Note that “DbAndLoadCases” module is unaware of SQLite. All interactions with SQL database are done via “SqlWrap” module discussed in section IV.4.1.3. This has been done to ease the swap from SQLite to another SQL database system.