FeResPost Web Site                     FeResPost Online User Manual

X.F.2.1 Post-processing of Cauchy stress tensor

One presents below the class "Post_Cauchy" which has been more deeply modified than
"Post_Connect". The inheritance of "GenPost" is ensured by the use of following statements:

require "genPost"  
class PostCauchy < GenPost

One decided also that member data are no-longer module or class member data. Instead, the become instance member data:

    @groupName  
    @layerNames  
    @stressTensor  
 
    @currentMoSResult  
    @minMosResults

For this post-processing, two member data have been added to allow the storage of results in the object between the different calls to its methods.

One also adds and initializes a method that defines the member data when an instance of the class is created:

    def initialize  
        super  
 
        @groupName = nil  
        @layerNames = nil  
        @stressTensor = nil  
 
        @currentMoSResult = nil  
        @minMosResults = {}  
    end

Note the call to "super" that ensures that the corresponding initialize method of "GenPost" class shall be called too. This ensures that each time an instance of "Post_Cauchy" is created, the "GenPost" class is made aware of it, and a pointer to this object is added to its "@@postList" class member data.

Class "Post_Cauchy" defines a method used to write Gmsh result files:

    def writeGmshMinMosResults(db,fileName,skeleton)  
        results=[]  
        @minMosResults.each do |key,val|  
            results << [val,key,"ElemCorners"]  
        end  
        db.writeGmsh(fileName,0,results,'  
                         [[skeleton,"mesh_slat"]],'  
                         [[skeleton,"skel_slat"]])  
    end

the Results stored in the file correspond to those stored in the new member data "@minMosResults". This member data is a Hash that contains the pairs of String identifiers and Results corresponding to minimum margins of safety. This variable is updated at the end of each criterion calculation to contain maps of the minimum margins of safety:

            tmpStr=@groupName+"_"+critName  
            if (@minMosResults.has_key?(tmpStr)) then  
                tmpRes1=@minMosResults[tmpStr]  
                tmpRes2=Post.min(tmpRes1,@currentMoSResult)  
                @minMosResults[tmpStr]=tmpRes2  
            else  
                @minMosResults[tmpStr]=@currentMoSResult  
            end

This method uses the last calculated margin mapping result, stored in "@currentMoSResult".