FeResPost Web Site                     FeResPost Online User Manual

III.2.1.5 Attaching “DES/FAC” files to a Samcef DataBase

Since version 3.5.0, FeResPost allows a random access to DES/FAC result files. This method is more efficient than the methods that import Results into the DataBase, and extracting copies of these Results. A peculiar case in which the random access methods will be more efficient is when only some small parts of the Result file are of interest to the programmer.

The principle of random access is as follows:

The different methods called to perform these operations are described in the following sub-sections.

Note that the content of DES file is read only when the DES/FAC files are attached to the DataBase. After that, the DES file is closed. This is why when information is extracted from a peculiar attachment, the attachment is identified by the name of the FAC file.

III.2.1.5.1 Managing DES/FAC file attachments

The method “attachDesFac” is used to attach a DES/FAC file to the Samcef DataBase. This method has between two and four arguments:

1.
A String containing the name of the DES file. (Full path name must be provided.)
2.
A String containing the name of the FAC file. (Full path name must be provided.)
3.
An integer or an Array of integers identifying load cases.
4.
A String or an Array of Strings corresponding to the names that are attributed to the load cases and which shall be used to retrieve corresponding Results.

The arguments 3 and 4 are optional. They correspond to arguments 3 and 4 of the “readDesFac” method discussed in section III.2.1.4.

Several other methods are used to manage the DES/FAC attachments to a DataBase:

III.2.1.5.2 Extracting information from DES/FAC attachments

The following methods extract information related to the Results stored in DES/FAC files attached to the DataBase:

All these methods have a single String argument containing the name of the FAC file that must have been previously attached to the DataBase. On the other hand, the following methods have one or two arguments:

The first argument is the name of the FAC file that must have been previously attached to the DataBase. The second argument is optional and corresponds to the name of a load case found in the attached FAC file. If the argument is not provided, all the load cases are investigated to build the list of sub-cases or Result names or IDs. If the argument is provided, only the sub-cases or Results of the corresponding load case are considered. If the provided load case does not exist in FAC attachment an error message is issued.

III.2.1.5.3 Extracting Results from attachments

The method “getAttachmentResults” is used to read Results from the FAC file. The Results are directly returned by the method to the caller. They are not inserted in the DataBase from which the method is called.

The method has minimum four arguments:

1.
A String corresponding to the name of FAC file attachment from which Results are read. (This file must have been previously attached to the DataBase.)
2.
A String corresponding to the name of the load case for which Results are read.
3.
A String or an Array of Strings corresponding to the names of sub-cases for which Results are read.
4.
A String or an Array of Strings corresponding to the names of Results for which Results are read.

The other arguments are optional and correspond to the specification of target entities for which Results are read. Actually, the reading operation from a FAC file combines the reading and some of the extraction operations described in section I.4.3. For example:

One can extract Results without specifying the ResKeyList, Result or Group argument. However, it is still possible to specify a list of layers, a list of sub-layers, and a location to filter the values that are inserted in Results. The “Location” argument corresponds to the “Method” argument when Results are extracted on Groups. Possible values of this parameter are “Elements”, “ElemCenters", “ElemCorners”...

Only lists below the list of valid calls to “getAttachmentResults”:

        h=db.getAttachmentResults(facName,lcName,scNames,resNames,  
                method,grpTarget[,layers[,subLayers]])  
        h=db.getAttachmentResults(facName,lcName,scNames,resNames,  
                resTarget)  
        h=db.getAttachmentResults(facName,lcName,scNames,resNames,  
                rklTarget)  
        h=db.getAttachmentResults(facName,lcName,scNames,resNames  
                [,layers[,sub-Layers[,location]]])

As several Result types, and sub-case names can be given as argument to “getAttachmentResults” method, this method can return several Results. This is why Results are returned in a Hash:

For example, the list of extracted Result sizes can be printed with the following statements:

    h=db.getAttachmentResults(facName,lcName,scNames,resNames,"Nodes",grp)  
    h.each do |id,res|  
        lcName=id[0]  
        scName=id[1]  
        resName=id[2]  
        size=res.Size  
        STDOUT.printf("%s - %s - %s : %d' n",lcName,scName,resName,size)  
        #~ Util::printRes(STDOUT,"brol",res)  
    end

The method “getAttachmentResultsCombili” is used to extract linear combinations of elementary Results found in one or several attached FAC files. As for method “getAttachmentResults” the Results are directly returned by the method to the caller. They are not inserted in the DataBase from which the method is called. This method is more or less a combination of the methods “getAttachmentResults” and “buildLoadCasesCombili” of the generic DataBase class.

Practically, the main difference between “getAttachmentResults” and “getAttachmentResultsCombili” is that the first argument is no longer a FAC file name. This argument is removed. Instead, one provides a “Combili” argument that describes the linear combination corresponding to extracted Results. This “Combili” argument is the second argument. The first argument is the “LcName” argument corresponding to the load case name attributed to the generated Results. This load case name is not supposed to correspond to any load case name found in the attached FAC file(s).

The method has minimum four arguments:

1.
A String corresponding to the name of the load case for which Results are read.
2.
A “Combili” Array containing the description of the linear combination of elementary load case Results. The Array is an Array of Arrays. Each secondary Array contains three elements:
3.
A String or an Array of Strings corresponding to the names of sub-cases for which Results are read.
4.
A String or an Array of Strings corresponding to the names of Results for which Results are read.

The other arguments are optional and correspond to the specification of target entities for which Results are read. Actually, the reading operation from a FAC file combines the reading and some of the extraction operations described in section I.4.3. For example:

One can extract Results without specifying the ResKeyList, Result or Group argument. However, it is still possible to specify a list of layers, a list of sub-layers, and a location to filter the values that are inserted in Results. The “Location” argument corresponds to the “Method” argument when Results are extracted on Groups. Possible values of this parameter are “Elements”, “ElemCenters", “ElemCorners”...

Only lists below the list of valid calls to “getAttachmentResultsCombili”:

        h=db.getAttachmentResultsCombili(lcName,combili,scNames,resNames,  
                method,grpTarget,layers)  
        h=db.getAttachmentResultsCombili(lcName,combili,scNames,resNames,  
                method,grpTarget)  
        h=db.getAttachmentResultsCombili(lcName,combili,scNames,resNames,  
                resTarget)  
        h=db.getAttachmentResultsCombili(lcName,combili,scNames,resNames,  
                rklTarget)  
        h=db.getAttachmentResultsCombili(lcName,combili,scNames,resNames,  
                layers)  
        h=db.getAttachmentResultsCombili(lcName,combili,scNames,resNames)

The Hash object returned by the method has a structure identical to the one returned by “getAttachmentResults” and can be manipulated the same way.

III.2.1.5.4 Storage buffers for result files random access

In order to reduce the number of accesses to disk, it may be useful to store some of the blocks read from binary result files into memory. FeResPost provides an algorithm that allows to store the blocks most recently read for later usage. Two singleton methods of the “SamcefDb” class allow the to tune the capacity of the buffer area:

Note that all buffers are now common to all the methods that provide random access to XDB and FAC result files. In particular, the method is used in management of the binary file access for XDB and FAC attachment or reading. This means that if one Result file attached to one DataBase is more used, the storage will contain a majority of buffers for this Result file and progressively delete the other buffers.

The default capacity for storage buffer is 0Mb. Note that the two methods described above can be called from any class derived from the generic “DataBase” class.