示例#1
0
文件: quick_graphics.py 项目: lcpt/xc
 def solve(self,loadCaseName,loadCaseExpr=''):
     self.loadCaseName=loadCaseName
     self.loadCaseExpr=loadCaseExpr
     preprocessor= self.feProblem.getPreprocessor
     combs=preprocessor.getLoadHandler.getLoadCombinations
     lCase=combs.newLoadCombination(self.loadCaseName,self.loadCaseExpr)
     preprocessor.resetLoadCase()
     combs.addToDomain(self.loadCaseName)
     #Solution
     analysis= predefined_solutions.simple_static_linear(self.feProblem)
     result= analysis.analyze(1)
     combs.removeFromDomain(self.loadCaseName)
示例#2
0
文件: test_davit_02.py 项目: lcpt/xc
def resuelveCombEstatLin(comb):
  preprocessor.resetLoadCase()
  previa= comb.getCombPrevia()
  if(previa!=None):
    nombrePrevia= previa.getName
    tagPrevia= previa.tag
    ''' 
    print "nombrePrevia= ",nombrePrevia
    print "tag= ",comb.tag
    print "tagPrevia= ",tagPrevia
    print "descomp previa= ",getDescompCombPrevia
    print "resto sobre previa= ",getDescompRestoSobrePrevia
    '''
    tagSave= tagPrevia*100
    if(tagPrevia>0):
      db.restore(tagSave)

    comb.addToDomain()
    analisis= predefined_solutions.simple_static_linear(feProblem)
    result= analisis.analyze(1)
    comb.removeFromDomain()
示例#3
0
lPatterns= loadHandler.getLoadPatterns

#Load modulation.
ts= lPatterns.newTimeSeries("constant_ts","ts")
lPatterns.currentTimeSeries= "ts"
#Load case definition
lp0= lPatterns.newLoadPattern("default","0")
lp0.newNodalLoad(2,xc.Vector([0,0,F,0,0,0]))
lp0.newNodalLoad(3,xc.Vector([0,0,F,0,0,0]))
#We add the load case to domain.
lPatterns.addToDomain("0")



# Solution
analisis= predefined_solutions.simple_static_linear(feProblem)
result= analisis.analyze(1)


q13MedioElem= 0.0
q23MedioElem= 0.0
elem.getResistingForce()
mats= elem.getPhysicalProperties.getVectorMaterials #Materials at gauss points.
#Gauss points iterator
for m in mats:
  q13MedioElem= q13MedioElem+m.getStressResultantComponent("q13")
  q23MedioElem= q23MedioElem+m.getStressResultantComponent("q23")

q13MedioElem= q13MedioElem/4
q23MedioElem= q23MedioElem/4
示例#4
0
elementos= prep.getElementHandler
        \for_each

            .vector3dEdgeLoadGlobal(xc.ID(3,2),xc.Vector(0,p,0))
            .vector3dEdgeLoadGlobal(xc.ID(4,1),xc.Vector(0,p,0))


cargas= prep.getLoadHandler

casos= cargas.getLoadPatterns{#We add the load case to domain.
casos.addToDomain("0")


#Solución
analisis= predefined_solutions.simple_static_linear(prueba)
result= analisis.analyze(1)


        nodos.calculateNodalReactions(True)
nodos= prep.getNodeHandler

 RNX1= .getReaction[0] RNY1= nodos.getNode(1).getReaction[1] RNZ1= .getReaction[2] \expr{MX1= .getReaction[3] 
 RNX2= .getReaction[0] RNY2= nodos.getNode(2).getReaction[1] RNZ2= .getReaction[2] \expr{MX2= .getReaction[3] 




RTeor= -p*L

ratio1= (abs((RNX1+RNX2)/RTeor))
示例#5
0
def defaultAnalysis(feProb,steps= 1):
    '''Default analysis procedure for saveAll method.'''
    analysis= predefined_solutions.simple_static_linear(feProb)
    result= analysis.analyze(steps) #Same with the number of steps.
    return result
'''
# Loads definition
cargas= prep.getLoadHandler
casos= cargas.getLoadPatterns
#Load modulation.
ts= casos.newTimeSeries("constant_ts","ts")
casos.currentTimeSeries= "ts"
#Load case definition
lp0= casos.newLoadPattern("default","0")
casos.currentLoadPattern='0'
#We add the load case to domain.
casos.addToDomain('0')

# Phase 1: prestressing of tendon
# Solution procedure
analisis= predefined_solutions.simple_static_linear(FEcase)
analOk= analisis.analyze(1)
uz_ph1=msNod.getDisp[2]

# Phase 2: self weight
loadVector=xc.Vector([0,0,-Wsw])
for e in beamSet.getElements:
    e.vector3dUniformLoadGlobal(loadVector)
analOk= analisis.analyze(1)
uz_ph2=msNod.getDisp[2]

# Phase 3: prestress loss in service
for e in tendonSet.getElements:
    tendonMat= e.getMaterial()
    tendonMat.prestress= fps
    e.update() #Update element state according with the new prestress
示例#7
0
#Load modulation.
ts= casos.newTimeSeries("constant_ts","ts")
casos.currentTimeSeries= "ts"
#Load case definition
lp0= casos.newLoadPattern("default","0")
#casos.currentLoadPattern= "0"
loadMz= 1e3
lp0.newNodalLoad(2,xc.Vector([0,0,0,0,0,loadMz]))

#We add the load case to domain.
casos.addToDomain("0")


# Solution
analisis= predefined_solutions.simple_static_linear(prueba)
result= analisis.analyze(1)

nodes= preprocessor.getNodeLoader
nodes.calculateNodalReactions(True)
nodes= preprocessor.getNodeLoader

RM= nodes.getNode(1).getReaction[5] 

elementos= preprocessor.getElementLoader
ele1= elementos.getElement(1)
ele1.getResistingForce()
scc0= ele1.getSection()

esfMz= scc0.getStressResultantComponent("Mz")
示例#8
0
#We add the load case to domain.
lPatterns.addToDomain(lp0.name)

import os

os.system("rm -r -f /tmp/test14.db")
db = feProblem.newDatabase("BerkeleyDB", "/tmp/test14.db")
db.save(100)
feProblem.clearAll()
feProblem.setVerbosityLevel(0)  #Dont print warning messages
#about pointers to material.
db.restore(100)
feProblem.setVerbosityLevel(1)  #Print warnings again

# Solution
analisis = predefined_solutions.simple_static_linear(feProblem)
result = analisis.analyze(1)

nodes.calculateNodalReactions(True, 1e-7)
nod1 = nodes.getNode(1)
deltax1 = nod1.getDisp[0]
deltay1 = nod1.getDisp[1]
nod2 = nodes.getNode(2)
deltax2 = nod2.getDisp[0]
deltay2 = nod2.getDisp[1]
R1 = nod1.getReaction[0]
R2 = nod2.getReaction[0]

setTotal = preprocessor.getSets.getSet("total")
setTotal.aliveElements()
mesh = preprocessor.getDomain.getMesh
示例#9
0
modelSpace.fixNode00F(p0.getNode().tag)
modelSpace.fixNodeF0F(p1.getNode().tag)

# Actions
loadCaseManager= load_cases.LoadCaseManager(preprocessor)
loadCaseNames= ['deadLoad']
loadCaseManager.defineSimpleLoadCases(loadCaseNames)

## Dead load.
cLC= loadCaseManager.setCurrentLoadCase('deadLoad')
gravityVector= xc.Vector([0.0,9.81])
modelSpace.createSelfWeightLoad(xcTotalSet,gravityVector)

# Solution
## Linear static analysis.
modelSpace.analysis= predefined_solutions.simple_static_linear(steelBeam)

## Deflection linit
preprocessor.getLoadHandler.addToDomain('deadLoad')
result= modelSpace.analyze(calculateNodalReactions= True)

R0= p0.getNode().getReaction[1]
R1= p1.getNode().getReaction[1]
ratio0= abs(R0-totalWeight/2.0)/(totalWeight/2.0)
ratio1= abs(R1-totalWeight/2.0)/(totalWeight/2.0)

'''
print('R0= ',R0)
print('ratio0= ', ratio0)
print('R1= ',R1)
print('ratio1= ', ratio1)
示例#10
0
#Loads definition
cargas = prep.getLoadHandler
casos = cargas.getLoadPatterns
#Load modulation.
ts = casos.newTimeSeries("constant_ts", "ts")
casos.currentTimeSeries = "ts"
lPattern = "0"
lp0 = casos.newLoadPattern("default", lPattern)
casos.currentLoadPattern = lPattern
lp0.newNodalLoad(5, xc.Vector([0, 0, -10, 0, 0, 0]))
casos.addToDomain(lPattern)

from solution import predefined_solutions
# Static solution
analysis = predefined_solutions.simple_static_linear(test)
result = analysis.analyze(1)

# for e in diagSet.elements:
#     print e.tag
#     e.getMaterial().prestress=sigmaPrestrDiagCable

# for e in saddSet.elements:
#     print e.tag
#     e.getMaterial().prestress=sigmaPrestrSaddCable

# analysis= predefined_solutions.simple_static_linear(test)
# result= analysis.analyze(1)

#Newton Raphson
# analysis= predefined_solutions.plain_newton_raphson(test)
示例#11
0
def customAnalysis(feProb, steps=1):
    '''Default analysis procedure for saveAll method.'''
    #analysis= solution.penaltyNewtonRaphson(feProb)
    analysis = predefined_solutions.simple_static_linear(feProb)
    result = analysis.analyze(steps)  #Same with the number of steps.
    return result
示例#12
0
def defaultAnalysis(feProb, steps=1):
    '''Default analysis procedure for saveAll method.'''
    analysis = predefined_solutions.simple_static_linear(feProb)
    result = analysis.analyze(steps)  #Same with the number of steps.
    return result
示例#13
0
load = bendingStrengthLoad
loadCaseManager = lcm.LoadCaseManager(preprocessor)
loadCaseNames = ['load']
loadCaseManager.defineSimpleLoadCases(loadCaseNames)

# load.
cLC = loadCaseManager.setCurrentLoadCase('load')
for e in infSet.getElements:
    e.vector2dUniformLoadGlobal(xc.Vector([0.0, -load]))

#We add the load case to domain.
preprocessor.getLoadHandler.addToDomain("load")

# Solution
# Linear static analysis.
analysis = predefined_solutions.simple_static_linear(sheathingBeam)
result = analysis.analyze(1)

uYMax = -1e6
for n in infSet.getNodes:
    uY = -n.getDisp[1]
    uYMax = max(uY, uYMax)

uYMax *= bendingStiffnessLoad / bendingStrengthLoad
r = span / uYMax

DeltaLL = 12 * bendingStiffnessLoad * span**4 / 1743.0 / section.sectionProperties.EI(
)
r = span / DeltaLL
ratio1 = abs(uYMax - DeltaLL) / DeltaLL