original_docstring: 
          This method plots mean flow for a single mesh
          
docstring: This method plots mean flow for a single mesh
docstring_tokens: This method plots mean flow for a single mesh
code: def PlotVelocity(self, meshid):
          '''
          This method plots mean flow for a single mesh
          '''
          try:
              from matplotlib.pyplot import plot, xlabel, ylabel, title, legend, savefig, close
          except ImportError:
              MatPlotLibError()
          meshid = str(meshid)
          for element in self.NetworkMesh.Elements:
              if element.Id == meshid:
                  name = self.NetworkGraph.Edges[self.NetworkMesh.MeshToGraph[meshid]].Name
                  dofs = element.GetPoiseuilleDofs()
                  
                  p1 = self.Solutions[(self.DofMap.DofMap[meshid, dofs[0]]),self.CardiacFreq*(self.Cycles-1):]
                  p2 = self.Solutions[(self.DofMap.DofMap[meshid, dofs[1]]),self.CardiacFreq*(self.Cycles-1):]
                  
                  if mean(p1)>=mean(p2):
                      flowDirection = self.flowDirection['(+)']
                      Flow = (p1-p2)/element.R
                  else:
                      flowDirection = self.flowDirection['(-)']
                      Flow = (p2-p1)/element.R
                  
                  Radius = mean(element.Radius)
                  print element.Name, Radius
                  Velocity = Flow/(pi*Radius**2)
                  
          if flowDirection == self.flowDirection['(+)']:
              plot(self.t, Velocity, 'r-',linewidth = 3, label = 'Velocity (+)')   #red line
          if flowDirection == self.flowDirection['(-)']:
              plot(self.t, Velocity, 'r-',linewidth = 3, label = 'Velocity (-)')   #red line
          xlabel('Time ($s$)')
          ylabel('Velocity ($m^3/s$)')
          title ('Velocity')    
          legend()
          savefig(self.images + meshid + '_' + name +'_vel.png')
          close()
code_tokens: def PlotVelocity ( self , meshid ) : try : from matplotlib . pyplot import plot , xlabel , ylabel , title , legend , savefig , close except ImportError : MatPlotLibError ( ) meshid = str ( meshid ) for element in self . NetworkMesh . Elements : if element . Id == meshid : name = self . NetworkGraph . Edges [ self . NetworkMesh . MeshToGraph [ meshid ] ] . Name dofs = element . GetPoiseuilleDofs ( ) p1 = self . Solutions [ ( self . DofMap . DofMap [ meshid , dofs [ 0 ] ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] p2 = self . Solutions [ ( self . DofMap . DofMap [ meshid , dofs [ 1 ] ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] if mean ( p1 ) >= mean ( p2 ) : flowDirection = self . flowDirection [ '(+)' ] Flow = ( p1 - p2 ) / element . R else : flowDirection = self . flowDirection [ '(-)' ] Flow = ( p2 - p1 ) / element . R Radius = mean ( element . Radius ) print element . Name , Radius Velocity = Flow / ( pi * Radius ** 2 ) if flowDirection == self . flowDirection [ '(+)' ] : plot ( self . t , Velocity , 'r-' , linewidth = 3 , label = 'Velocity (+)' ) if flowDirection == self . flowDirection [ '(-)' ] : plot ( self . t , Velocity , 'r-' , linewidth = 3 , label = 'Velocity (-)' ) xlabel ( 'Time ($s$)' ) ylabel ( 'Velocity ($m^3/s$)' ) title ( 'Velocity' ) legend ( ) savefig ( self . images + meshid + '_' + name + '_vel.png' ) close ( )
short_docstring: This method plots mean flow for a single mesh
short_docstring_tokens: This method plots mean flow for a single mesh
comment: '''
          This method plots mean flow for a single mesh
          '''$SEP$#red line$SEP$#red line