Beispiel #1
0
    def initControlVars(self,elements):
        ''' Initialize control variables over elements.

          :param elements: elements to define control variables in
        '''
        for e in elements:
          e.setProp(self.limitStateLabel,cv.CrackControlVars(idSection= e.getProp('idSection')))
 def check(self, elements, nmbComb):
     '''Crack control.'''
     for e in elements:
         e.getResistingForce()
         scc = e.getSection()
         idSection = e.getProp("idSection")
         Ntmp = scc.getStressResultantComponent("N")
         MyTmp = scc.getStressResultantComponent("My")
         MzTmp = scc.getStressResultantComponent("Mz")
         datosScc = scc.getProp("datosSecc")
         stressCalc = datosScc.getStressCalculator()
         stressCalc.solve(Ntmp, MyTmp)
         sigma_sPos = stressCalc.sgs
         sigma_sNeg = stressCalc.sgsp
         sigma_c = stressCalc.sgc
         #print("sgc0= ", stressCalc.sgc0)
         # sigma_s= 0.0
         # eNC= datosScc.depth/3
         # exc= 0.0
         # As= max(datosScc.getAsPos(),datosScc.getAsNeg())
         # denom= 0.5*As*0.9*datosScc.depth
         # if(abs(Ntmp)<1e-6):
         #   sigma_s= MyTmp/denom
         # else:
         #   exc= abs(MyTmp/Ntmp)
         #   if(exc<eNC):
         #     sg= Ntmp/datosScc.getAc()
         #     sg+= MyTmp/datosScc.getI()*datosScc.depth/2
         #     sigma_s= 10*sg
         #   else:
         #     sigma_s= MyTmp/denom
         # print("eNC= ", eNC, " exc= ", exc, "sigma_s= ", sigma_s/1e6)
         CFPos = sigma_sPos / self.limitStress  #Positive face capacity factor.
         CFNeg = sigma_sNeg / self.limitStress  #Negative face capacity factor.
         elementControlVars = None
         if (e.hasProp(self.limitStateLabel)):
             elementControlVars = e.getProp(self.limitStateLabel)
         else:
             elementControlVars = cv.CrackControlVars(
                 idSection,
                 cv.CrackControlBaseVars(nmbComb, CFPos, Ntmp, MyTmp, MzTmp,
                                         sigma_sPos),
                 CrackControlBaseVars(nmbComb, CFNeg, Ntmp, MyTmp, MzTmp,
                                      sigma_sNeg))
         if (CFPos > elementControlVars.crackControlVarsPos.CF):
             elementControlVars.crackControlVarsPos = cv.CrackControlBaseVars(
                 nmbComb, CFPos, Ntmp, MyTmp, MzTmp, sigma_sPos)
         if (CFNeg > elementControlVars.crackControlVarsNeg.CF):
             elementControlVars.crackControlVarsNeg = cv.CrackControlBaseVars(
                 nmbComb, CFNeg, Ntmp, MyTmp, MzTmp, sigma_sNeg)
         e.setProp(self.limitStateLabel, elementControlVars)