original_docstring: 
          This method computes Pulse Wave Velocity.(m/s)
          If SuperEdge2 is specified, PWV is computed between first and second superedge,
          otherwise PWV is computed over a single superedge.
          
docstring: This method computes Pulse Wave Velocity.(m/s)
  If SuperEdge2 is specified, PWV is computed between first and second superedge,
  otherwise PWV is computed over a single superedge.
docstring_tokens: This method computes Pulse Wave Velocity . ( m / s ) If SuperEdge2 is specified PWV is computed between first and second superedge otherwise PWV is computed over a single superedge .
code: def PulseWaveVelocity(self, superEdge, superEdge2 = None):
          '''
          This method computes Pulse Wave Velocity.(m/s)
          If SuperEdge2 is specified, PWV is computed between first and second superedge,
          otherwise PWV is computed over a single superedge.
          '''
          distance = 0 
          startSE = str(superEdge)
          if superEdge2 == None:
              endSE = str(superEdge)
          else:
              endSE = str(superEdge2)
          if startSE == endSE:
              for se in self.NetworkGraph.SuperEdges.itervalues():
                  if se.Name == startSE:
                      if len(se.Edges) == 1:
                          startE = se.Edges.values()[0]
                          endE = startE
                          nodoStart = startE.NodeIds[0]
                          nodoEnd = startE.NodeIds[1]
                          distance = startE.Length['value']
                      else:
                          for ed in se.Edges.itervalues():
                              node0 = ed.NodeIds[0]
                              for ed in se.Edges.itervalues():
                                  wrong = 0
                                  if ed.NodeIds[1] == node0:
                                      wrong = 1
                                      break
                              if wrong == 0:
                                  nodoStart = node0
                          for ed in se.Edges.itervalues():
                              distance+=ed.Length['value']
                              if nodoStart == ed.NodeIds[0]:
                                  startE = ed                
                          for ed in se.Edges.itervalues():
                              node1 = ed.NodeIds[1]
                              for ed in se.Edges.itervalues():
                                  wrong = 0
                                  if ed.NodeIds[0] == node1:
                                      wrong = 1
                                      break
                              if wrong == 0:
                                  nodoEnd = node1
                          for ed in se.Edges.itervalues():
                              if nodoEnd == ed.NodeIds[1]:
                                  endE = ed    
          else: 
              for se in self.NetworkGraph.SuperEdges.itervalues():
                  if se.Name == startSE:
                      if len(se.Edges) == 1:
                          startE = se.Edges.values()[0]
                          nodoStart = startE.NodeIds[0]
                          distance+=startE.Length['value']
                      else:
                          for ed in se.Edges.itervalues():
                              node0 = ed.NodeIds[0]
                              for ed in se.Edges.itervalues():
                                  wrong = 0
                                  if ed.NodeIds[1] == node0:
                                      wrong = 1
                                      break
                              if wrong == 0:
                                  nodoStart = node0
                          for ed in se.Edges.itervalues():
                              distance+=ed.Length['value']
                              if nodoStart == ed.NodeIds[0]:
                                  startE = ed                             
                  if se.Name == endSE:
                      if len(se.Edges) == 1:
                          endE = se.Edges.values()[0]
                          nodoEnd = endE.NodeIds[1]
                          distance+=endE.Length['value']
                      else:
                          for ed in se.Edges.itervalues():
                              node1 = ed.NodeIds[1]
                              for ed in se.Edges.itervalues():
                                  wrong = 0
                                  if ed.NodeIds[0] == node1:
                                      wrong = 1
                                      break
                              if wrong == 0:
                                  nodoEnd = node1
                          for ed in se.Edges.itervalues():
                              distance+=ed.Length['value']
                              if nodoEnd == ed.NodeIds[1]:
                                  endE = ed        
          #mesh
          meshNodeStart = self.NetworkMesh.meshToEdges[nodoStart]
          meshNodeEnd = self.NetworkMesh.meshToEdges[nodoEnd]
          for el in self.NetworkMesh.Elements:
              if el.NodeIds[0] == meshNodeStart:
                  meshStart = el
              if el.NodeIds[1] == meshNodeEnd:
                  meshEnd = el
          #finding peak pressure and corresponding time.
          PeakStartAll = (self.Solutions[(self.DofMap.DofMap[meshStart.Id, 0]),self.CardiacFreq*(self.Cycles-1):])
          PeakStart = max(PeakStartAll)   
          step1 = 0
          for p1 in PeakStartAll:
              if p1 == PeakStart:
                  t1 = self.t[step1]
                  break
              step1+=1        
          PeakEndAll = (self.Solutions[(self.DofMap.DofMap[meshEnd.Id, 1]),self.CardiacFreq*(self.Cycles-1):])
          PeakEnd = max(PeakEndAll)      
          step2 = 0
          for p2 in PeakEndAll:
              if p2 == PeakEnd:
                  t2 = self.t[step2]
                  break
              step2+=1        
          deltat = abs(t1-t2)        
          PWV = float(distance)/deltat       
          print PWV, 'm/s'
          return PWV
code_tokens: def PulseWaveVelocity ( self , superEdge , superEdge2 = None ) : distance = 0 startSE = str ( superEdge ) if superEdge2 == None : endSE = str ( superEdge ) else : endSE = str ( superEdge2 ) if startSE == endSE : for se in self . NetworkGraph . SuperEdges . itervalues ( ) : if se . Name == startSE : if len ( se . Edges ) == 1 : startE = se . Edges . values ( ) [ 0 ] endE = startE nodoStart = startE . NodeIds [ 0 ] nodoEnd = startE . NodeIds [ 1 ] distance = startE . Length [ 'value' ] else : for ed in se . Edges . itervalues ( ) : node0 = ed . NodeIds [ 0 ] for ed in se . Edges . itervalues ( ) : wrong = 0 if ed . NodeIds [ 1 ] == node0 : wrong = 1 break if wrong == 0 : nodoStart = node0 for ed in se . Edges . itervalues ( ) : distance += ed . Length [ 'value' ] if nodoStart == ed . NodeIds [ 0 ] : startE = ed for ed in se . Edges . itervalues ( ) : node1 = ed . NodeIds [ 1 ] for ed in se . Edges . itervalues ( ) : wrong = 0 if ed . NodeIds [ 0 ] == node1 : wrong = 1 break if wrong == 0 : nodoEnd = node1 for ed in se . Edges . itervalues ( ) : if nodoEnd == ed . NodeIds [ 1 ] : endE = ed else : for se in self . NetworkGraph . SuperEdges . itervalues ( ) : if se . Name == startSE : if len ( se . Edges ) == 1 : startE = se . Edges . values ( ) [ 0 ] nodoStart = startE . NodeIds [ 0 ] distance += startE . Length [ 'value' ] else : for ed in se . Edges . itervalues ( ) : node0 = ed . NodeIds [ 0 ] for ed in se . Edges . itervalues ( ) : wrong = 0 if ed . NodeIds [ 1 ] == node0 : wrong = 1 break if wrong == 0 : nodoStart = node0 for ed in se . Edges . itervalues ( ) : distance += ed . Length [ 'value' ] if nodoStart == ed . NodeIds [ 0 ] : startE = ed if se . Name == endSE : if len ( se . Edges ) == 1 : endE = se . Edges . values ( ) [ 0 ] nodoEnd = endE . NodeIds [ 1 ] distance += endE . Length [ 'value' ] else : for ed in se . Edges . itervalues ( ) : node1 = ed . NodeIds [ 1 ] for ed in se . Edges . itervalues ( ) : wrong = 0 if ed . NodeIds [ 0 ] == node1 : wrong = 1 break if wrong == 0 : nodoEnd = node1 for ed in se . Edges . itervalues ( ) : distance += ed . Length [ 'value' ] if nodoEnd == ed . NodeIds [ 1 ] : endE = ed meshNodeStart = self . NetworkMesh . meshToEdges [ nodoStart ] meshNodeEnd = self . NetworkMesh . meshToEdges [ nodoEnd ] for el in self . NetworkMesh . Elements : if el . NodeIds [ 0 ] == meshNodeStart : meshStart = el if el . NodeIds [ 1 ] == meshNodeEnd : meshEnd = el PeakStartAll = ( self . Solutions [ ( self . DofMap . DofMap [ meshStart . Id , 0 ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] ) PeakStart = max ( PeakStartAll ) step1 = 0 for p1 in PeakStartAll : if p1 == PeakStart : t1 = self . t [ step1 ] break step1 += 1 PeakEndAll = ( self . Solutions [ ( self . DofMap . DofMap [ meshEnd . Id , 1 ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] ) PeakEnd = max ( PeakEndAll ) step2 = 0 for p2 in PeakEndAll : if p2 == PeakEnd : t2 = self . t [ step2 ] break step2 += 1 deltat = abs ( t1 - t2 ) PWV = float ( distance ) / deltat print PWV , 'm/s' return PWV
short_docstring: This method computes Pulse Wave Velocity.
short_docstring_tokens: This method computes Pulse Wave Velocity .
comment: '''
          This method computes Pulse Wave Velocity.(m/s)
          If SuperEdge2 is specified, PWV is computed between first and second superedge,
          otherwise PWV is computed over a single superedge.
          '''$SEP$#mesh$SEP$#finding peak pressure and corresponding time.