Beispiel #1
0
    def writeReport(self, archTex, pathFigura):
        if (self.geomSection):
            pfs.plotGeomSeccion(self.geomSection, pathFigura)
        else:
            sys.stderr.write('error: geometry of section: ' + self.sectName +
                             ' not defined\n')
        fileHandler = open(archTex, 'w')
        fileHandler.write(
            '%% ****** Packages needed for LaTeX document: ****** \n')
        fileHandler.write('%%\usepackage{graphicx} %%\postscript includes\n')
        fileHandler.write('%%\usepackage{multirow} %%\multirow command\n')
        fileHandler.write('%%\usepackage{wasysym} %%\permil command\n')
        fileHandler.write('%%\usepackage{gensymb} %%\degree command\n')

        fileHandler.write('\\begin{table}\n')
        fileHandler.write('\\begin{center}\n')
        fileHandler.write('\\begin{tabular}{|c|}\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\begin{large} ' +
                          latexUtils.toLaTex(self.sectName) +
                          ' \end{large}\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write(self.sectDescr + '\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\begin{tabular}{c|l}\n')
        fileHandler.write('\\begin{minipage}{85mm}\n')
        fileHandler.write('\\vspace{2mm}\n')
        fileHandler.write('\\begin{center}\n')
        #  name without extension to allow pdfLatex process the file
        nameWOExt = os.path.splitext(pathFigura)[0]
        fileHandler.write('\\includegraphics[width=80mm]{' + nameWOExt + '}\n')
        # name without extension and without path
        # nameWOExt= os.path.splitext(pathFigura)[0]
        # fileHandler.write('\\includegraphics[width=80mm]{'+self.sectName[4:]+'}\n')
        fileHandler.write('\\end{center}\n')
        fileHandler.write('\\vspace{1pt}\n')
        fileHandler.write('\\end{minipage} & \n')
        fileHandler.write('\\begin{tabular}{l}\n')
        fileHandler.write('width: \\\\\n')
        fileHandler.write('$b= ' + '{0:.2f}'.format(self.width) +
                          '\\ m$\\\\\n')
        fileHandler.write('depth: \\\\\n')
        fileHandler.write('$h= ' + '{0:.2f}'.format(self.depth) +
                          '\\ m$\\\\\n')
        fileHandler.write('\\end{tabular} \\\\\n')
        fileHandler.write('\\end{tabular} \\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\textbf{Materials - mechanical properties}:\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\begin{tabular}{ll}\n')
        fileHandler.write('Concrete: ' + self.concrete.materialName +
                          ' & Modulus of elasticity: $E_c= ' +
                          '{0:.2f}'.format(self.Ec / 1e9) + '\\ GPa$\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('Steel: ' + self.rfSteel.materialName +
                          ' & Modulus of elasticity: $E_s= ' +
                          '{0:.2f}'.format(self.Es / 1e9) + '\\ GPa$\\\\\n')
        fileHandler.write('\\end{tabular} \\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write(
            '\\textbf{Sections - geometric and mechanical characteristics}:\\\\\n'
        )
        fileHandler.write('\\hline\n')
        fileHandler.write('Gross section:\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\begin{tabular}{ll}\n')
        fileHandler.write(
            '$A_{gross}=' + fmt6_3f.format(self.AB) +
            '\\ m^2$ & \\multirow{3}{*}{Inertia tensor ($cm^4$): $ \\left( \\begin{array}{ccc}'
            + fmt5_2f.format(self.JTorsion * 1e4) +
            ' & 0.00 & 0.00 \\\\ 0.00 & ' + fmt5_2f.format(self.IyB * 1e4) +
            ' & ' + fmt5_2f.format(self.PyzB) + ' \\\\ 0.00 & ' +
            fmt5_2f.format(self.PyzB) + ' & ' +
            fmt5_2f.format(self.IzB * 1e4) + ' \\end{array} \\right)$} \\\\\n')
        fileHandler.write('& \\\\\n')
        fileHandler.write('C.O.G.: $(' + fmt5_3f.format(self.GB[0]) + ',' +
                          fmt5_3f.format(self.GB[1]) + ')\\ m$  & \\\\\n')
        fileHandler.write('\\end{tabular} \\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('Homogenized section:\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\begin{tabular}{ll}\n')
        fileHandler.write(
            '$A_{homog.}=' + fmt6_3f.format(self.AH) +
            '\\ m^2$ & \\multirow{3}{*}{Inertia tensor ($cm^4$): $ \\left( \\begin{array}{ccc}'
            + fmt5_2f.format(self.JTorsion * 1e4) +
            ' & 0.00 & 0.00 \\\\ 0.00 & ' + fmt5_2f.format(self.IyH * 1e4) +
            ' & ' + fmt5_2f.format(self.PyzH) + ' \\\\ 0.00 & ' +
            fmt5_2f.format(self.PyzH) + ' & ' +
            fmt5_2f.format(self.IzH * 1e4) + ' \\end{array} \\right)$} \\\\\n')
        fileHandler.write('& \\\\\n')
        fileHandler.write('C.O.G.: $(' + fmt5_3f.format(self.GH[0]) + ',' +
                          fmt5_3f.format(self.GH[1]) + ')\\ m$  & \\\\\n')
        fileHandler.write('\\end{tabular} \\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\textbf{Passive reinforcement}:\\\\\n')
        fileHandler.write('\\hline\n')
        writeMainReinforcement(self.reinforcement, self.AB, fileHandler)
        fileHandler.write('\\hline\n')
        fileHandler.write('Layers of shear reinforcement:\\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\begin{tabular}{cccccccc}\n')
        fileHandler.write(
            'Id & N$^o$ branch & $\\phi$ & area & spac. & area/m & $\\alpha$ & $\\beta$\\\\\n'
        )
        fileHandler.write(
            ' &  & $(mm)$ & $(cm^2)$ & $(cm)$ & $(cm^2/m)$ & $( \\degree)$ & $( \\degree)$\\\\\n'
        )
        writeShearReinforcement(self.shReinfZ, fileHandler, self.width)
        writeShearReinforcement(self.shReinfY, fileHandler, self.depth)
        fileHandler.write('\\end{tabular} \\\\\n')
        fileHandler.write('\\hline\n')
        fileHandler.write('\\end{tabular}\n')
        fileHandler.write('\\end{center}\n')
        fileHandler.write('\\caption{' + self.sectDescr + ' (' +
                          latexUtils.toLaTex(self.sectName) + ').' +
                          '} \\label{tb_' + self.sectName + '}\n')
        fileHandler.write('\\end{table}\n')
        fileHandler.close()
Beispiel #2
0
  def writeReport(self,archTex, pathFigura):
    if(self.geomSection):
      pfs.plotSectionGeometry(self.geomSection,pathFigura)
    else:
      sys.stderr.write('error: geometry of section: '+self.sectName+' not defined\n')
    fileHandler= open(archTex,'w')
    fileHandler.write('%% ****** Packages needed for LaTeX document: ****** \n')
    fileHandler.write('%%\usepackage{graphicx} %%\postscript includes\n')
    fileHandler.write('%%\usepackage{multirow} %%\multirow command\n')
    fileHandler.write('%%\usepackage{wasysym} %%\permil command\n')
    fileHandler.write('%%\usepackage{gensymb} %%\degree command\n')

    fileHandler.write('\\begin{table}\n')
    fileHandler.write('\\begin{center}\n')
    fileHandler.write('\\begin{tabular}{|c|}\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\begin{large} '+latexUtils.toLaTex(self.sectName)+' \end{large}\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write(self.sectDescr+'\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\begin{tabular}{c|l}\n')
    fileHandler.write('\\begin{minipage}{85mm}\n')
    fileHandler.write('\\vspace{2mm}\n')
    fileHandler.write('\\begin{center}\n')
    #  name without extension to allow pdfLatex process the file
    nameWOExt= os.path.splitext(pathFigura)[0]
    fileHandler.write('\\includegraphics[width=80mm]{'+nameWOExt+'}\n')
    # name without extension and without path
    # nameWOExt= os.path.splitext(pathFigura)[0]
    # fileHandler.write('\\includegraphics[width=80mm]{'+self.sectName[4:]+'}\n')
    fileHandler.write('\\end{center}\n')
    fileHandler.write('\\vspace{1pt}\n')
    fileHandler.write('\\end{minipage} & \n')
    fileHandler.write('\\begin{tabular}{l}\n')
    fileHandler.write('width: \\\\\n')
    fileHandler.write('$b= '+'{0:.2f}'.format(self.width)+'\\ m$\\\\\n')
    fileHandler.write('depth: \\\\\n')
    fileHandler.write('$h= '+'{0:.2f}'.format(self.depth)+'\\ m$\\\\\n')
    fileHandler.write('\\end{tabular} \\\\\n')
    fileHandler.write('\\end{tabular} \\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\textbf{Materials - mechanical properties}:\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\begin{tabular}{ll}\n')
    fileHandler.write('Concrete: '+self.concrete.materialName+' & Modulus of elasticity: $E_c= '+'{0:.2f}'.format(self.Ec/1e9)+'\\ GPa$\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('Steel: '+self.rfSteel.materialName+' & Modulus of elasticity: $E_s= '+'{0:.2f}'.format(self.Es/1e9)+'\\ GPa$\\\\\n')
    fileHandler.write('\\end{tabular} \\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\textbf{Sections - geometric and mechanical characteristics}:\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('Gross section:\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\begin{tabular}{ll}\n')
    fileHandler.write('$A_{gross}='+fmt6_3f.format(self.AB) +'\\ m^2$ & \\multirow{3}{*}{Inertia tensor ($cm^4$): $ \\left( \\begin{array}{ccc}'+ fmt5_2f.format(self.JTorsion*1e4) +' & 0.00 & 0.00 \\\\ 0.00 & '+ fmt5_2f.format(self.IyB*1e4) +' & '+fmt5_2f.format(self.PyzB) +' \\\\ 0.00 & '+fmt5_2f.format(self.PyzB) +' & '+fmt5_2f.format(self.IzB*1e4) +' \\end{array} \\right)$} \\\\\n')
    fileHandler.write('& \\\\\n')
    fileHandler.write('C.O.G.: $('+fmt5_3f.format(self.GB[0])+','+fmt5_3f.format(self.GB[1])+')\\ m$  & \\\\\n')
    fileHandler.write('\\end{tabular} \\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('Homogenized section:\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\begin{tabular}{ll}\n')
    fileHandler.write('$A_{homog.}='+fmt6_3f.format(self.AH) +'\\ m^2$ & \\multirow{3}{*}{Inertia tensor ($cm^4$): $ \\left( \\begin{array}{ccc}'+ fmt5_2f.format(self.JTorsion*1e4) +' & 0.00 & 0.00 \\\\ 0.00 & '+ fmt5_2f.format(self.IyH*1e4) +' & '+fmt5_2f.format(self.PyzH) +' \\\\ 0.00 & '+fmt5_2f.format(self.PyzH) +' & '+fmt5_2f.format(self.IzH*1e4)+' \\end{array} \\right)$} \\\\\n')
    fileHandler.write('& \\\\\n')
    fileHandler.write('C.O.G.: $('+fmt5_3f.format(self.GH[0])+','+fmt5_3f.format(self.GH[1])+')\\ m$  & \\\\\n')
    fileHandler.write('\\end{tabular} \\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\textbf{Passive reinforcement}:\\\\\n')
    fileHandler.write('\\hline\n')
    writeMainReinforcement(self.reinforcement,self.AB,fileHandler)
    fileHandler.write('\\hline\n')
    fileHandler.write('Layers of shear reinforcement:\\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\begin{tabular}{cccccccc}\n')
    fileHandler.write('Id & N$^o$ branch & $\\phi$ & area & spac. & area/m & $\\alpha$ & $\\beta$\\\\\n')
    fileHandler.write(' &  & $(mm)$ & $(cm^2)$ & $(cm)$ & $(cm^2/m)$ & $( \\degree)$ & $( \\degree)$\\\\\n')
    writeShearReinforcement(self.shReinfZ,fileHandler,self.width)
    writeShearReinforcement(self.shReinfY,fileHandler,self.depth)
    fileHandler.write('\\end{tabular} \\\\\n')
    fileHandler.write('\\hline\n')
    fileHandler.write('\\end{tabular}\n')
    fileHandler.write('\\end{center}\n')
    fileHandler.write('\\caption{'+self.sectDescr+' ('+ latexUtils.toLaTex(self.sectName) +').'+'} \\label{tb_'+self.sectName+'}\n')
    fileHandler.write('\\end{table}\n')
    fileHandler.close()