print "Analytical solution (for areaStrut=areaCable" F_cable=sigmaPret*areaCable/(1+math.sqrt(2)) F_strut=-F_cable*math.sqrt(2) deltL_cable=(F_cable/areaCable-sigmaPret)/E*l deltL_strut=F_strut/areaStrut/E*(l*math.sqrt(2)) print 'F_cable=', F_cable print 'F_strut=', F_strut print 'delta_L_cable=',deltL_cable print 'delta_L_strut=',deltL_strut from postprocess import utils_display from postprocess.xcVtk.FE_model import quick_graphics as QGrph from postprocess.xcVtk import vtk_graphic_base xcTotalSet=utils_display.setToDisplay(elSet=preprocessor.getSets.getSet('total'),genDescr='',sectDescr=[]) lcs=QGrph.LoadCaseResults(FEcase) #lcs.displayDispRot(itemToDisp='uX',setToDisplay=xcTotalSet.elSet,fConvUnits=1000,unitDescription='mm', vtk_graphic_base.CameraParameters('XYZPos',1),fileName=None,defFScale=0.0) # lcs.displayDispRot(itemToDisp='uZ',defFScale=1e2) # lcs.displayDispRot(itemToDisp='uY') lcs.loadCaseName='Prestressing stress= 420 Mpa ' xcTotalSet.elSet.name='' lcs.displayIntForcDiag(itemToDisp='N',setToDisplay=xcTotalSet.elSet,fConvUnits= 1.0e-3,scaleFactor=1,unitDescription=': Axial forces (kN)', viewDef=vtk_graphic_base.CameraParameters('ZPos',1),fileName='val_quad01.jpg',defFScale=25.0)
# -*- coding: utf-8 -*- execfile('../model_gen.py') #execfile(workingDirectory+'../../generic_bridges/voided_slab_bridge/loadStateDataActions.py') #execfile('../../generic_bridges/voided_slab_bridge/loadStateData.py') execfile('../loadStateData.py') from postprocess.xcVtk import vtk_graphic_base from postprocess.xcVtk.FE_model import quick_graphics as qg #ordered list of load cases (from those defined in ../loadStateData.py #or redefined lately) to be displayed: loadCasesToDisplay=[G1,G2,Q1a1,Q1a2,Q1b1,Q1b2,Q1c,Q1d,Q1e,Q1bFren,Q1dFren,Q1eFren,Q21,Q22] #End data for lc in loadCasesToDisplay: lcs= qg.LoadCaseResults(FEcase, loadCaseName=lc.loadCaseName, loadCaseExpr= lc.loadCaseExpr) lcs.solve() for st in lc.setsToDispLoads: # capt=lc.loadCaseDescr + ', ' + st.genDescr + ', ' + lc.unitsLoads capt=lc.loadCaseDescr + ', ' + lc.unitsLoads lcs.displayLoadVectors(setToDisplay=st,caption= capt,fileName=None,defFScale=1.0)
print "deltaL_diag1", deltaL_diag1 print "deltaL_diag2", deltaL_diag2 print "deltaL_diag3", deltaL_diag3 print "deltaL_saddTop1", deltaL_saddTop1 print "deltaL_saddTop2", deltaL_saddTop2 print "deltaL_saddTop3", deltaL_saddTop3 print "deltaL_saddBot1", deltaL_saddBot1 print "deltaL_saddBot2", deltaL_saddBot2 print "deltaL_saddBot3", deltaL_saddBot3 from postprocess import utils_display from postprocess.xcVtk.FE_model import quick_graphics as qg from postprocess.xcVtk import vtk_graphic_base xcTotalSet = utils_display.setToDisplay(elSet=prep.getSets.getSet('total'), genDescr='', sectDescr=[]) lcs = qg.LoadCaseResults(FEcase) # lcs.displayDispRot(itemToDisp='uZ',defFScale=1e2) # lcs.displayDispRot(itemToDisp='uY') lcs.loadCaseName = 'Prestressing stress= 420 Mpa , Loads: Fz,n4=Fz,n5=Fz,n6= -21 kN ' xcTotalSet.elSet.name = '' lcs.displayIntForcDiag(itemToDisp='N', setToDisplay=xcTotalSet.elSet, fConvUnits=1.0e-3, scaleFactor=1, unitDescription=': Axial internal forces [kN] ', viewDef=vtk_graphic_base.CameraParameters('XYZPos', 1), fileName=None, defFScale=2) quit()
import os from postprocess.xcVtk import vtk_graphic_base from postprocess.xcVtk.FE_model import quick_graphics as QGrph execfile('../model_data.py') execfile('../loadStateData.py') #ordered list of load cases (from those defined in ../loadStateData.py #or redefined lately) to be displayed: loadCasesToDisplay = [G1, G2, G3, Q1a, Q1b, Q2a, Q2b] #loadCasesToDisplay=[ELULoadCaseDisp] #End data for lc in loadCasesToDisplay: lcs = QGrph.LoadCaseResults(FEcase, lc.loadCaseName, lc.loadCaseExpr) #solve for load case lcs.solve() #Displacements and rotations displays for st in lc.setsToDispDspRot: for arg in lc.listDspRot: lcs.displayDispRot(itemToDisp=arg, setToDisplay=st, fileName=None, defFScale=1) #Internal forces displays on sets of «shell» elements for st in lc.setsToDispIntForc: for arg in lc.listIntForc: lcs.displayIntForc(itemToDisp=arg, setToDisplay=st, fileName=None,
def simplLCReports(self, FEproblem, texFile, cfg): '''Creates the graphics files of displacements and internal forces calculated for a simple load case and insert them in a LaTex file :param FEproblem: finite element problem :param texFile: laTex file where to include the graphics (e.g.:'text/report_loads.tex') :param cfg: instance of EnvConfig class with config parameters ''' fullPath = cfg.projectDirTree.getReportSimplLCGrPath() rltvPath = cfg.projectDirTree.getRltvReportSimplLCGrPath() lcs = QGrph.LoadCaseResults(FEproblem, self.loadCaseName, self.loadCaseExpr) #solve for load case lcs.solve() #Displacements and rotations displays for st in self.setsToDispDspRot: for arg in self.listDspRot: fullgrfname = fullPath + self.loadCaseName + st.name + arg rltvgrfname = rltvPath + self.loadCaseName + st.name + arg jpegFileName = fullgrfname + '.jpg' lcs.displayDispRot(itemToDisp=arg, setToDisplay=st, fileName=jpegFileName) # unitConversionFactor, unDesc= cfg.outputStyle.getUnitParameters(arg) unitConversionFactor, unDesc = cfg.getUnitParameters(arg) # if 'u' in arg: # unDesc=cfg.getDisplacementUnitsDescription() # else: # unDesc=cfg.getRotationUnitsDescription() capt = self.getDescription( ) + '. ' + st.description.capitalize( ) + ', ' + cfg.capTexts[arg] + ', ' + unDesc insertGrInTex(texFile=texFile, grFileNm=rltvgrfname, grWdt=cfg.grWidth, capText=capt) #Internal forces displays on sets of «shell» elements for st in self.setsToDispIntForc: for arg in self.listIntForc: fullgrfname = fullPath + self.loadCaseName + st.name + arg rltvgrfname = rltvPath + self.loadCaseName + st.name + arg jpegFileName = fullgrfname + '.jpg' lcs.displayIntForc(itemToDisp=arg, setToDisplay=st, fileName=jpegFileName) capt = self.getDescription( ) + '. ' + st.description.capitalize() + ', ' + cfg.capTexts[ arg] + ', ' + cfg.getForceUnitsDescription() insertGrInTex(texFile=texFile, grFileNm=rltvgrfname, grWdt=cfg.grWidth, capText=capt) #Internal forces displays on sets of «beam» elements for st in self.setsToDispBeamIntForc: for arg in self.listBeamIntForc: fullgrfname = fullPath + self.loadCaseName + st.name + arg rltvgrfname = rltvPath + self.loadCaseName + st.name + arg jpegFileName = fullgrfname + '.jpg' lcs.displayIntForcDiag(itemToDisp=arg, setToDisplay=st, fileName=jpegFileName) capt = self.getDescription( ) + '. ' + st.description.capitalize() + ', ' + cfg.capTexts[ arg] + ', ' + cfg.getForceUnitsDescription() insertGrInTex(texFile=texFile, grFileNm=rltvgrfname, grWdt=cfg.grWidth, capText=capt) texFile.write('\\clearpage\n')
av = [] a = seismeSIA.designSpectrum(soilClass, accelTerrain, CO, periods[0], q) ah.append(a) av.append(0.7 * a) print "periods= ", periods, ' s' print "accelerations: ", ah, ' m/s2' print "modalParticipationFactors: ", modalParticipationFactors print "effectiveModalMasses: ", effectiveModalMasses print "totalMass: ", totalMass #Display de deformed shape and the equivalent static loads #associated with mode modeToDisplay = 1 figureCaption = 'Mode ' + str( modeToDisplay) + ' deformed shape and equivalent static loads.' lcs = qg.LoadCaseResults(model) lcs.outputStyle.equivalentLoadVectorsScaleFactor = 1.5 lcs.displayEigenResult(eigenMode=modeToDisplay, setToDisplay=xcTotalSet, accelMode=ah[modeToDisplay - 1], caption=figureCaption, fileName=None, defFScale=2.0) import csv with open('earthquake_loads.csv', 'w') as csvfile: nodes = xcTotalSet.nodes data = [['nodeTag', 'Fx', 'Fy', 'Fz', 'Mx', 'My', 'Mz']] writer = csv.writer(csvfile) for n in nodes: forces = n.getEquivalentStaticLoad(1, ah[0])
def simplLCReports(self, FEcase, pathGr, texFile, grWdt, capStdTexts): '''Creates the graphics files of displacements and internal forces calculated for a simple load case and insert them in a LaTex file # :param gridmodl: object of type GridModel #26/03/2017 :param FEcase: finite element problem :param pathGr: directory to place figures (ex: 'text/graphics/loads/') :param texFile: laTex file where to include the graphics (e.g.:'text/report_loads.tex') :param grWdt: width to be applied to graphics :param capStdTexts:dictionary with the standard captions ''' # lcs=GridModel.QuickGraphics(gridmodl) #26/03/2017 lcs = qg.LoadCaseResults(FEcase) #solve for load case lcs.solve(loadCaseName=self.loadCaseName, loadCaseExpr=self.loadCaseExpr) #Displacements and rotations displays for st in self.setsToDispDspRot: for arg in self.listDspRot: if arg[0] == 'u': fcUn = self.unitsScaleDispl unDesc = self.unitsDispl else: fcUn = 1.0 unDesc = '' grfname = pathGr + self.loadCaseName + st.name + arg lcs.displayDispRot(itemToDisp=arg, setToDisplay=st, viewDef=self.cameraParameters, fileName=grfname + '.jpg') lcs.displayDispRot(itemToDisp=arg, setToDisplay=st, viewDef=self.cameraParameters, fileName=grfname + '.eps') capt = self.loadCaseDescr + '. ' + st.name.capitalize( ) + ', ' + capStdTexts[arg] + ' ' + unDesc insertGrInTex(texFile=texFile, grFileNm=grfname, grWdt=grWdt, capText=capt) #Internal forces displays on sets of «shell» elements for st in self.setsToDispIntForc: for arg in self.listIntForc: if arg[0] == 'M': fcUn = self.unitsScaleMom unDesc = self.unitsMom else: fcUn = self.unitsScaleForc unDesc = self.unitsForc grfname = pathGr + self.loadCaseName + st.name + arg lcs.displayIntForc(itemToDisp=arg, setToDisplay=st, viewDef=self.cameraParameters, fileName=grfname + '.jpg') lcs.displayIntForc(itemToDisp=arg, setToDisplay=st, viewDef=self.cameraParameters, fileName=grfname + '.eps') capt = self.loadCaseDescr + '. ' + st.name.capitalize( ) + ', ' + capStdTexts[arg] + ' ' + unDesc insertGrInTex(texFile=texFile, grFileNm=grfname, grWdt=grWdt, capText=capt) #Internal forces displays on sets of «beam» elements for st in self.setsToDispBeamIntForc: for arg in self.listBeamIntForc: if arg[0] == 'M': fcUn = self.unitsScaleMom unDesc = self.unitsMom scaleFact = self.scaleDispBeamIntForc[2] else: fcUn = self.unitsScaleForc unDesc = self.unitsForc if arg[0] == 'N': scaleFact = self.scaleDispBeamIntForc[0] else: scaleFact = self.scaleDispBeamIntForc[1] grfname = pathGr + self.loadCaseName + st.name + arg lcs.displayIntForcDiag(itemToDisp=arg, setToDisplay=st, viewDef=self.cameraParametersBeams, fileName=grfname + '.jpg') lcs.displayIntForcDiag(itemToDisp=arg, setToDisplay=st, viewDef=self.cameraParametersBeams, fileName=grfname + '.eps') capt = self.loadCaseDescr + '. ' + st.name.capitalize( ) + ', ' + capStdTexts[arg] + ' ' + unDesc insertGrInTex(texFile=texFile, grFileNm=grfname, grWdt=grWdt, capText=capt) texFile.write('\\clearpage\n') return
# -*- coding: utf-8 -*- execfile('./model_data.py') execfile('./loadStateData.py') from postprocess.xcVtk import vtk_graphic_base from postprocess.xcVtk.FE_model import quick_graphics as qg #ordered list of load cases (from those defined in ../loadStateData.py #or redefined lately) to be displayed: loadCasesToDisplay = [ Q664Det1B_point ] #[G1,G2,Q269A_point,Q269A_unif,Q269B_point,Q269B_unif,Q664CraneA_point,Q664CraneB_point,Q664Det1A_point,Q664Det1B_point,T] #End data for lc in loadCasesToDisplay: lcs = qg.LoadCaseResults(model, loadCaseName=lc.loadCaseName, loadCaseExpr=lc.loadCaseExpr) lcs.solve() for st in lc.setsToDispLoads: # capt=lc.loadCaseDescr + ', ' + st.genDescr + ', ' + lc.unitsLoads capt = lc.loadCaseDescr + ', ' + lc.unitsLoads lcs.displayLoadVectors(setToDisplay=st, caption=capt, fileName=None, defFScale=1.0)