def appendLoadToLoadPattern(self, loadPattern): ''' Append load to the load pattern passed as parameter.''' pDef = xc.DeformationPlane(self.strain) for l in self.xcSet.getLines: for e in l.elements: eLoad = loadPattern.newElementalLoad("beam_strain_load") eLoad.elementTags = xc.ID([e.tag]) eleLoad.backEndDeformationPlane = pDef eleLoad.frontEndDeformationPlane = pDef
def appendLoadToCurrentLoadPattern(self): ''' Append load to the load pattern passed as parameter.''' prep = self.xcSet.getPreprocessor lcm = load_cases.LoadCaseManager(prep) loadPatternName = prep.getLoadHandler.getLoadPatterns.currentLoadPattern loadPattern = prep.getLoadHandler.getLoadPatterns[loadPatternName] pDef = xc.DeformationPlane(self.strain) for e in self.xcSet.elements: eLoad = loadPattern.newElementalLoad("beam_strain_load") eLoad.elementTags = xc.ID([e.tag]) eLoad.backEndDeformationPlane = pDef eLoad.frontEndDeformationPlane = pDef
modelSpace.fixNode000_000(1) modelSpace.fixNode000_000(3) # Loads definition loadHandler= preprocessor.getLoadHandler lPatterns= loadHandler.getLoadPatterns ts= lPatterns.newTimeSeries("linear_ts","ts") lPatterns.currentTimeSeries= "ts" lp0= lPatterns.newLoadPattern("default","0") lp0.gammaF= gammaF #lPatterns.currentLoadPattern= "0" eleLoad= lp0.newElementalLoad("beam_strain_load") eleLoad.elementTags= xc.ID([1,2]) defTermica= xc.DeformationPlane(alpha*AT) eleLoad.backEndDeformationPlane= defTermica eleLoad.frontEndDeformationPlane= defTermica #We add the load case to domain. lPatterns.addToDomain("0") # Solution procedure analisis= predefined_solutions.simple_static_modified_newton(feProblem) result= analisis.analyze(1) nodes= preprocessor.getNodeHandler nod2= nodes.getNode(2)
ratioD0 = (D0Teor - D0).Norm() # Shortening in 1 and 4 # Elongation in 2 and 3 # STATIC SIGN CONVENTION: Mz and kZ negative (Right hand rule). # XC SIGN CONVENTION: Mz and kZ POSITIVE (it is annoying Yeah!) elasticSection2d.revertToStart() epsilon1 = -epsilon epsilon2 = epsilon epsilon3 = epsilon epsilon4 = -epsilon p1 = geom.Pos3d(epsilon1, y1, z1) p2 = geom.Pos3d(epsilon2, -y1, z1) p3 = geom.Pos3d(epsilon3, -y1, -z1) p4 = geom.Pos3d(epsilon4, y1, -z1) elasticSection2d.setTrialDeformationPlane(xc.DeformationPlane(p1, p2, p3)) DD = elasticSection2d.getSectionDeformation() N1 = elasticSection2d.getN() Mz1 = elasticSection2d.getMz() RR = elasticSection2d.getStressResultant() R1 = xc.Vector([RR[0], RR[1]]) # N= RR[0], Mz= RR[1] epsilonTeor = (epsilon1 + epsilon2 + epsilon3 + epsilon4) / 4.0 kZ1Teor = -((epsilon4 - epsilon3) + (epsilon1 - epsilon2)) / depthOverY / 2.0 elasticSection2d.sectionDeformation = xc.Vector([epsilonTeor, kZ1Teor]) D1 = xc.Vector([DD[0], DD[1]]) # epsilon= DD[0], Kz= DD[1] N1S = elasticSection2d.getN() Mz1S = elasticSection2d.getMz() N1Teor = epsilonTeor * E * A Mz1Teor = kZ1Teor * E * Iz R1Teor = xc.Vector([N1Teor, Mz1Teor])
elements.defaultTag = 1 beam1 = elements.newElement("ForceBeamColumn3d", xc.ID([1, 2])) beam2 = elements.newElement("ForceBeamColumn3d", xc.ID([2, 3])) # Constraints modelSpace.fixNode000_000(1) modelSpace.fixNode000_000(3) # Load case definition. lp0 = modelSpace.newLoadPattern(name='0') lp0.gammaF = gammaF eleLoad = lp0.newElementalLoad("beam_strain_load") eleLoad.elementTags = xc.ID([1, 2]) thermalDeformation = xc.DeformationPlane(alpha * AT) eleLoad.backEndDeformationPlane = thermalDeformation eleLoad.frontEndDeformationPlane = thermalDeformation # We add the load case to domain. modelSpace.addLoadCaseToDomain(lp0.name) # Solution procedure analysis = predefined_solutions.plain_static_modified_newton(feProblem) result = analysis.analyze(1) nodes = preprocessor.getNodeHandler nod2 = nodes.getNode(2) dX = nod2.getDisp[0] dY = nod2.getDisp[1]
eleLoad = cLC.newElementalLoad("shell_strain_load") eleLoad.elementTags = shells.getElements.getTags() eleLoad.setStrainComp(0, 0, alphaAT) #(id of Gauss point, id of component, value) eleLoad.setStrainComp(0, 1, alphaAT) eleLoad.setStrainComp(1, 0, alphaAT) eleLoad.setStrainComp(1, 1, alphaAT) eleLoad.setStrainComp(2, 0, alphaAT) eleLoad.setStrainComp(2, 1, alphaAT) eleLoad.setStrainComp(3, 0, alphaAT) eleLoad.setStrainComp(3, 1, alphaAT) eleLoad = cLC.newElementalLoad("beam_strain_load") eleLoad.elementTags = beams.getElements.getTags() defPlane = xc.DeformationPlane(alphaAT) eleLoad.backEndDeformationPlane = defPlane eleLoad.frontEndDeformationPlane = defPlane cLC = loadCaseManager.setCurrentLoadCase('temp_up') alphaAT = 20.0 * 10e-6 eleLoad = cLC.newElementalLoad("shell_strain_load") eleLoad.elementTags = shells.getElements.getTags() eleLoad.setStrainComp(0, 0, alphaAT) #(id of Gauss point, id of component, value) eleLoad.setStrainComp(0, 1, alphaAT) eleLoad.setStrainComp(1, 0, alphaAT) eleLoad.setStrainComp(1, 1, alphaAT) eleLoad.setStrainComp(2, 0, alphaAT) eleLoad.setStrainComp(2, 1, alphaAT)
import os fiberModel= preprocessor.getMaterialHandler.newMaterial("fiber_section_3d","fiberModel") fiberSectionRepr= fiberModel.getFiberSectionRepr() fiberSectionRepr.setGeomNamed("geomSCC") fiberModel.setupFibers() fibras= fiberModel.getFibers() zinf= z0-z1 zsup= z0+z1 epsilon= 3.5e-3 p1= geom.Pos3d(-epsilon,width/2.0,zsup) p2= geom.Pos3d(-epsilon,-width/2.0,zsup) p3= geom.Pos3d(epsilon,width/2.0,zinf) fiberModel.setTrialDeformationPlane(xc.DeformationPlane(p1,p2,p3)) N= fiberModel.getStressResultantComponent("N") Mz= fiberModel.getStressResultantComponent("Mz") My= fiberModel.getStressResultantComponent("My") nfiber= fibras.getNumFibers() hFiber= depth/rg.nDivJK IyFiber= 1/12.0*width*hFiber**3 Iy= 1/12.0*width*depth**3 MyTeor= -2*E*Iy*epsilon/depth MFiber= -2*E*IyFiber*epsilon/depth expectedError= rg.nDivJK*MFiber MyCorr= My+expectedError error= (1/rg.nDivJK**2)
R01 = n1.getReaction[0] ratio01 = abs(R01) R02 = n2.getReaction[0] ratio02 = abs(R02) strandInitStress0 = strandTruss.getMaterial().initialStress strandStress0 = strandTruss.getMaterial().getStress() concreteStress0 = (concreteBeam.getN1 + concreteBeam.getN2) / 2.0 / sectionProperties.A() uX0 = n2.getDisp[0] # Shrinkage. lp0 = modelSpace.newLoadPattern(name='0') eleLoad = lp0.newElementalLoad("beam_strain_load") eleLoad.elementTags = xc.ID([concreteBeam.tag]) initialShrinkage = -6.733333333333333e-05 beamDeformation = xc.DeformationPlane(initialShrinkage) eleLoad.backEndDeformationPlane = beamDeformation eleLoad.frontEndDeformationPlane = beamDeformation modelSpace.addLoadCaseToDomain(lp0.name) ## Solve for shrinking. analOk = solProc.solve(True) R11 = n1.getReaction[0] ratio11 = abs(R11) R12 = n2.getReaction[0] ratio12 = abs(R12) strandInitStress1 = strandTruss.getMaterial().initialStress strandStress1 = strandTruss.getMaterial().getStress() concreteStress1 = (concreteBeam.getN1 + concreteBeam.getN2) / 2.0 / sectionProperties.A()
eleLoad = cLC.newElementalLoad("shell_strain_load") eleLoad.elementTags = part.elements.getTags() eleLoad.setStrainComp( 0, 0, shrinkage) #(id of Gauss point, id of component, value) eleLoad.setStrainComp(0, 1, shrinkage) eleLoad.setStrainComp(1, 0, shrinkage) eleLoad.setStrainComp(1, 1, shrinkage) eleLoad.setStrainComp(2, 0, shrinkage) eleLoad.setStrainComp(2, 1, shrinkage) eleLoad.setStrainComp(3, 0, shrinkage) eleLoad.setStrainComp(3, 1, shrinkage) for part in modelLines: eleLoad = cLC.newElementalLoad("beam_strain_load") eleLoad.elementTags = part.elements.getTags() defPlane = xc.DeformationPlane(shrinkage) eleLoad.backEndDeformationPlane = defPlane eleLoad.frontEndDeformationPlane = defPlane #Live load A. cLC = loadCaseManager.setCurrentLoadCase('liveLoadA') qk = -4e3 for s in setDeck.getSurfaces: label = s.getProp('label') if (label == 'deck04' or label == 'deck06' or label == 'deck07'): for e in s.elements: e.vector3dUniformLoadGlobal(xc.Vector([-0.1 * qk, 0.0, qk])) else: for e in s.elements: e.vector3dUniformLoadGlobal(xc.Vector([-0.05 * qk, 0.0, qk / 2.0]))