FeResPost Web Site                     FeResPost Online User Manual

IV.3.4.1 Extension “extendedCLA.rb”

Presently, only “ClaMat” and “ClaLam” classes have been modified in “extendedCLA.rb”.

IV.3.4.1.1 Modification of “ClaLam” class

One adds methods devoted to the printing of stiffness and compliance matrices, laminate engineering constants... The list of these functions include:

Each of these diagnostic functions has two arguments: an ostream object corresponding to the File in which Results are printed, and a Real value corresponding to the angle wrt laminate axes for which the diagnostic is to be written. The following lines show the programming of “write_engineering” method:

   class ClaLam  
 
      ...  
 
      def write_engineering(os,theta=0.0)  
         constants=get_engineering(theta)  
         tab=["E_xx", "E_k0_xx", "E_f_xx",'  
              "E_yy", "E_k0_yy","E_f_yy",'  
              "G_xy", "G_k0_xy", "G_f_xy",'  
              "nu_xy", "nu_k0_xy", "nu_f_xy",'  
              "nu_yx", "nu_k0_yx", "nu_f_yx",'  
              "G_xz", "G_yz"]  
         counter=0  
         tab.each do |elem|  
            if (counter.modulo(3)==0) then  
               os.printf("   ")  
            end  
            str=format("%s = %11g",elem,constants[elem])  
            os.printf("%25s",str)  
            counter+=1  
            if (counter.modulo(3)==0||counter==tab.size) then  
               os.printf("' n")  
            end  
         end  
      end  
 
      ...  
 
   end # class ClaLam

The programming of the other diagnostic methods is very similar to this one.

The following method writes the laminate load response at laminate level (i.e. no ply results):

    def write_loadResponse(os,theta=0.0)  
        if (!isMechanicalLoadingDefined()) then  
            raise "No load response has been calculated."  
        end  
 
        if (isThermalLoadingDefined()) then  
            deltaT=getDeltaT  
            os.printf("   %14s%14g' n","deltaT",deltaT)  
            t0=getT0()  
            os.printf("   %14s%14g' n","T0",t0)  
            gradT=getGradT  
            os.printf("   %14s%14g' n' n","gradT",gradT)  
        end  
 
        if (isMoistureLoadingDefined()) then  
            deltaH=getDeltaH  
            os.printf("   %14s%14g' n","deltaH",deltaH)  
            h0=getH0  
            os.printf("   %14s%14g' n","H0",h0)  
            gradH=getGradH  
            os.printf("   %14s%14g' n' n","gradH",gradH)  
        end  
 
        os.printf("   %30s%14s%14s%14s' n","type","XX","YY","XY")  
        f=getNormalForces(theta)  
        m=getMoments(theta)  
        s=getNormalStrains(theta)  
        c=getCurvatures(theta)  
        os.printf("   %30s%14g%14g%14g' n","Normal Forces",f[0],f[1],f[2])  
        os.printf("   %30s%14g%14g%14g' n","Moments",m[0],m[1],m[2])  
        os.printf("   %30s%14g%14g%14g' n","Normal Strains",s[0],s[1],s[2])  
        os.printf("   %30s%14g%14g%14g' n","Curvatures",c[0],c[1],c[2])  
        f=getAverageInPlaneStresses(theta)  
        m=getFlexuralStresses(theta)  
        s=getAverageInPlaneStrains(theta)  
        c=getFlexuralStrains(theta)  
        os.printf("   %30s%14g%14g%14g' n","Average in-plane stresses",f[0],f[1],f[2])  
        os.printf("   %30s%14g%14g%14g' n","Flexural stresses",m[0],m[1],m[2])  
        os.printf("   %30s%14g%14g%14g' n","Average strains",s[0],s[1],s[2])  
        os.printf("   %30s%14g%14g%14g' n","Flexural in-plane strains",c[0],c[1],c[2])  
 
        os.printf("' n   %30s%14s%14s' n","type","XZ","YZ")  
        q=getShearForces(theta)  
        g=getShearStrains(theta)  
        os.printf("   %30s%14g%14g' n","Shear Forces",q[0],q[1])  
        os.printf("   %30s%14g%14g' n","Shear Strains",q[0],q[1])  
        q=getAverageShearStresses(theta)  
        g=getAverageShearStrains(theta)  
        os.printf("   %30s%14g%14g' n","Average shear stresses",q[0],q[1])  
        os.printf("   %30s%14g%14g' n","Average shear strains",g[0],g[1])  
   end

Again, in this case, the method has two arguments. Indeed, the components of Laminate load response can be obtained in any direction. Note that this method gives sensible results, only if the “calcResponse” method has been called on the ClaLam object. This remark is valid for all the methods that return information related to a peculiar loading.

The method “write_PliesInPlaneStrainsAndStresses” has only one argument and writes plies in-plane stresses and strains:

    def write_PliesInPlaneStrainsAndStresses(os)  
        if (!isMechanicalLoadingDefined()) then  
            raise "No load response has been calculated."  
        end  
 
        epsTab=getPliesStrains  
        sigTab=getPliesStresses  
        epsMechTab=getPliesMechanicalStrains  
        os.printf("   %8s%5s","layer","loc")  
        os.printf("%14s%14s%14s","eps_11","eps_22","gamma_12")  
        os.printf("%14s%14s%14s","sig_11","sig_22","sig_12")  
        os.printf("%14s%14s%14s","eps_mech_11","eps_mech_22","gamma_mech_12")  
        os.printf("' n")  
        (0...epsTab.size).each do |i|  
            os.printf("   %8d%5s",epsTab[i][0],epsTab[i][1])  
            os.printf("%14g%14g%14g",epsTab[i][2],epsTab[i][3],epsTab[i][7])  
            os.printf("%14g%14g%14g",sigTab[i][2],sigTab[i][3],sigTab[i][7])  
            os.printf("%14g%14g%14g",epsMechTab[i][2],epsMechTab[i][3],epsMechTab[i][7])  
            os.printf("' n")  
        end  
    end

One also defines methods “write_PliesTemperatures” and “write_PliesMoistures” that write thermal and hygrometric laminate states at ply level. These methods are very similar to “write_PliesInPlaneStrainsAndStresses”.

Correspondingly, the ply failure indices and reserve factors can be calculated and written:

   def write_crit(os,db,criteria,fos=1.0)  
        if (!isMechanicalLoadingDefined()) then  
            raise "No load response has been calculated."  
        end  
 
        if (db==nil) then  
            sdRes=getDerived(criteria)  
            fiRes=getFailureIndices(criteria)  
            rfRes=getReserveFactors(criteria,fos)  
        else  
            sdRes=getDerived(db,criteria)  
            fiRes=getFailureIndices(db,criteria)  
            rfRes=getReserveFactors(db,criteria,fos)  
        end  
 
        ...  
   end

This last method has several arguments:

1.
“os” specifies where the results are written.
2.
“db” is the ClaDb that is used to calculate failure indices and reserve factors. This argument may be necessary to retrieve plies material allowables and calculate the failure indices. If the argument is nil, then the laminate allowables are used to estimate failure indices.
3.
“criteria” is an Array of strings corresponding to the criteria for which reserve factors and failure indices are requested.
4.
“fos” is an optional argument corresponding to the factor of safety used in the calculation of reserve factors. Its default value is 1.

Note that all the methods added to the ClaLam class perform write operations only. Obviously, methods returning values can also be defined and will ultimately be more useful. But the examples above show that FeResPost is highly customizable and can be adapted to the needs of nearly any user. For example, it should be possible to interface it with graphical packages like ImageMagick or Gnuplot, or with spreadsheets like excel through the win32ole package. Using the Tcl/Tk, it should even be possible to create an interactive program with graphical interfaces.

IV.3.4.1.2 Modification of “ClaMat” class

Similarly, in “ClaMat” class, several printing methods have been defined. A list of these methods follows:

Each of these methods has two arguments: an output stream object, and an optional angle θ. (Its default value is 0.)