comb = combs.newLoadCombination("ELU018", "1.35*G + 1.50*SC + 0.90*VT + 0.90*NV") comb = combs.newLoadCombination("ELU019", "1.35*G + 1.50*VT") comb = combs.newLoadCombination("ELU020", "1.35*G + 1.50*VT + 0.90*NV") comb = combs.newLoadCombination("ELU021", "1.35*G + 1.05*SC + 1.50*VT") comb = combs.newLoadCombination("ELU022", "1.35*G + 1.05*SC + 1.50*VT + 0.90*NV") comb = combs.newLoadCombination("ELU023", "1.35*G + 1.50*NV") comb = combs.newLoadCombination("ELU024", "1.35*G + 0.90*VT + 1.50*NV") comb = combs.newLoadCombination("ELU025", "1.35*G + 1.05*SC + 1.50*NV") comb = combs.newLoadCombination("ELU026", "1.35*G + 1.05*SC + 0.90*VT + 1.50*NV") #printFlag= 0 #ctest.printFlag= printFlag analysis = predefined_solutions.penalty_newton_raphson(feProblem) from solution import database_helper def solveStaticLinearComb(tagComb, comb, tagSaveFase0): preprocessor.resetLoadCase() db.restore(tagSaveFase0) #exec(open("solution/database_helper_solve.xci").read()) ''' print("previousName= ",previousName) print("tag= ",tagComb) print("tagPrevia= ",tagPrevia) print("descomp previa= ",getDescompCombPrevia) print("resto sobre previa= ",getDescompRestoSobrePrevia)
combContainer = combs.CombContainer() combContainer.SLS.qp.add('c0', '1.0*uLoad+1.0*p0') combContainer.SLS.qp.add('c1', '1.0*uLoad+1.0*p1') combContainer.SLS.qp.add('c2', '1.0*uLoad+1.0*p2') combContainer.SLS.qp.add('c3', '1.0*uLoad+1.0*p3') ### Dump combination definition into XC. combContainer.dumpCombinations(preprocessor) # Reference values refMom = [26.6e3, 30.4e3, 35.4e3, 42.4e3] refDisp = [5.02e-3, 5.71e-3, 6.63e-3, 7.91e-3] # Solution analysis = predefined_solutions.penalty_newton_raphson(steelColumn) disp = list() bendingMoments = list() ## Compute values for c in ['c0', 'c1', 'c2', 'c3']: preprocessor.resetLoadCase() preprocessor.getLoadHandler.addToDomain(c) result = analysis.analyze(1) disp.append(n1.getDisp[1]) M = 0.0 for e in midElements.elements: if (e.getNodes[0].tag == n1.tag): M += e.getMz1 else: M += e.getMz2
def calcInternalForces(modelSpace, calcSet, steelMembers, diagonalSet, lstSteelBeams, loadCombinations, limitState, baseNodes, writer, mxNumIter=10, convergenceTestTol=1e-4): ''' Compute internal forces (solve). :param modelSpace: model space of the problem. :param calcSet: element set to compute internal forces on. :param steelMembers: steel members to be "softened" according to clause C2.3 of AISC 360-16. :param diagonalSet: diagonals to be deactivated when compressed. :param lstSteelBeams: list of members that need to update their lateral buckling reduction factors. :param loadCombinations: load combinations to use. :param limitState: limit state to compute internal forces for. :param baseNodes: nodes attached to the foundation. :param writer: comma separated values writer to use for writing reactions. :ivar mxNumIter: maximum number of iterations (defauts to 10) :ivar convergenceTestTol: convergence tolerance (defaults to 1e-9) ''' # Non linear analysis modelSpace.analysis = predefined_solutions.penalty_newton_raphson( modelSpace.preprocessor.getProblem, mxNumIter, convergenceTestTol) # Element to deal with elemSet = calcSet.elements nodSet = calcSet.nodes limitState.createOutputFiles() internalForcesDict = dict() failedCombinations = list() for key in loadCombinations.getKeys(): comb = loadCombinations[key] print(comb.name) resetCompressedDiagonals(modelSpace) modelSpace.preprocessor.resetLoadCase() restoreStiffness(steelMembers) modelSpace.preprocessor.getDomain.revertToStart() #Solution print('first round A.') comb.addToDomain(['DL', 'LL']) # Add the first part of the combination. result = modelSpace.analyze(calculateNodalReactions=False) if (result != 0): quit() failedCombinations.append(comb.name) #Solution print('first round B.') comb.addToDomain() # Combination to analyze. result = modelSpace.analyze(calculateNodalReactions=False) if (result != 0 or not comb.isActive()): quit() failedCombinations.append(comb.name) # out.displayIntForcDiag('N',diagonal) removeCompressedDiagonals(modelSpace, diagonalSet) print('second round.') result = modelSpace.analyze(calculateNodalReactions=False) if (result != 0): quit() failedCombinations.append(comb.name) softenElements(steelMembers) print('third round.') result = modelSpace.analyze(calculateNodalReactions=True) if (result != 0): quit() failedCombinations.append(comb.name) bpd.exportULSReactions(writer, comb.name, baseNodes) if lstSteelBeams: for sb in lstSteelBeams: sb.updateReductionFactors() # out.displayIntForcDiag('N',diagonal) #Writing results. internalForcesDict.update( eif.getInternalForcesDict(comb.getName, elemSet)) limitState.writeDisplacements(comb.getName, nodSet) comb.removeFromDomain() #Remove combination from the model. limitState.writeInternalForces(internalForcesDict) if (len(failedCombinations) > 0): lmsg.error('Analysis failed in the following combinations: ' + str(failedCombinations)) else: print(Fore.GREEN + 'Analysis for combinations for ' + str(limitState.label) + ': ' + str(loadCombinations.getKeys()) + ' finished.\n' + Style.RESET_ALL)
exec(open('./xc_model.py').read()) exec(open('./loads.py').read()) # def getPointAxes(p): # yAxes= ['A','B','C'] # xAxes= ['1','2','3'] # j= yAxes[int(round(p.y/2.415,0))] # i= xAxes[int(round(p.x/5.525,0))] # return (j, i) # stairTowerId= 'st' # f= open('reactions.csv', 'w') # writer= csv.writer(f) # Set non-linear analysis. modelSpace.analysis = predefined_solutions.penalty_newton_raphson( modelSpace.preprocessor.getProblem) # Graphic stuff. oh = output_handler.OutputHandler(modelSpace) # loadCaseNames= [ # 'DL', # 'SELF_DL', # 'LR', # 's_balanced', # 's_unbalanced_left', # 's_unbalanced_right', # 'wx_pos', # 'wx_neg', # 'wy_pos', # 'wy_neg', # 'win_pos',
comb = combs.newLoadCombination("ELU018", "1.35*G + 1.50*SC + 0.90*VT + 0.90*NV") comb = combs.newLoadCombination("ELU019", "1.35*G + 1.50*VT") comb = combs.newLoadCombination("ELU020", "1.35*G + 1.50*VT + 0.90*NV") comb = combs.newLoadCombination("ELU021", "1.35*G + 1.05*SC + 1.50*VT") comb = combs.newLoadCombination("ELU022", "1.35*G + 1.05*SC + 1.50*VT + 0.90*NV") comb = combs.newLoadCombination("ELU023", "1.35*G + 1.50*NV") comb = combs.newLoadCombination("ELU024", "1.35*G + 0.90*VT + 1.50*NV") comb = combs.newLoadCombination("ELU025", "1.35*G + 1.05*SC + 1.50*NV") comb = combs.newLoadCombination("ELU026", "1.35*G + 1.05*SC + 0.90*VT + 1.50*NV") #printFlag= 0 #ctest.printFlag= printFlag analysis = predefined_solutions.penalty_newton_raphson(prueba) from solution import database_helper def resuelveCombEstatLin(tagComb, comb, tagSaveFase0): preprocessor.resetLoadCase() db.restore(tagSaveFase0) #execfile("solution/database_helper_solve.xci") ''' print "nombrePrevia= ",nombrePrevia print "tag= ",tagComb print "tagPrevia= ",tagPrevia print "descomp previa= ",getDescompCombPrevia print "resto sobre previa= ",getDescompRestoSobrePrevia
comb= combs.newLoadCombination("ELU016","1.35*G + 1.50*SC + 0.90*NV") comb= combs.newLoadCombination("ELU017","1.35*G + 1.50*SC + 0.90*VT") comb= combs.newLoadCombination("ELU018","1.35*G + 1.50*SC + 0.90*VT + 0.90*NV") comb= combs.newLoadCombination("ELU019","1.35*G + 1.50*VT") comb= combs.newLoadCombination("ELU020","1.35*G + 1.50*VT + 0.90*NV") comb= combs.newLoadCombination("ELU021","1.35*G + 1.05*SC + 1.50*VT") comb= combs.newLoadCombination("ELU022","1.35*G + 1.05*SC + 1.50*VT + 0.90*NV") comb= combs.newLoadCombination("ELU023","1.35*G + 1.50*NV") comb= combs.newLoadCombination("ELU024","1.35*G + 0.90*VT + 1.50*NV") comb= combs.newLoadCombination("ELU025","1.35*G + 1.05*SC + 1.50*NV") comb= combs.newLoadCombination("ELU026","1.35*G + 1.05*SC + 0.90*VT + 1.50*NV") printFlag= 0 analysis= predefined_solutions.penalty_newton_raphson(feProblem) from solution import database_helper def resuelveCombEstatLin(preprocessor, comb,tagSaveFase0,dbHelp): preprocessor.resetLoadCase() db.restore(tagSaveFase0) dbHelp.helpSolve(comb) ''' print "nombrePrevia= ",nombrePrevia print "tag= ",tagComb print "tagPrevia= ",tagPrevia print "descomp previa= ",getDescompCombPrevia