original_docstring: 
          This method gets and plots flow, pressure and WSS for specific entity.
          
docstring: This method gets and plots flow, pressure and WSS for specific entity.
docstring_tokens: This method gets and plots flow pressure and WSS for specific entity .
code: def GetSolution(self, entity):
          '''
          This method gets and plots flow, pressure and WSS for specific entity.
          '''
          try:
              from matplotlib.pyplot import plot, xlabel, ylabel, title, legend, savefig, close
          except ImportError:
              MatPlotLibError()
          Flow = 0
          WSS = 0
          WSSW = 0
          PressureIN = 0
          PressureOUT = 0
          num_el = 0
          
          for ent, el in self.NetworkMesh.Entities.iteritems():
              if ent.Id is not None and ent.Id.find(entity) != -1:
                  for element in el:
                      num_el+=1
                      dofs = element.GetPoiseuilleDofs()
                      Flow += (self.Solutions[(self.DofMap.DofMap[element.Id, dofs[0]]),self.CardiacFreq*(self.Cycles-1):] - self.Solutions[(self.DofMap.DofMap[element.Id, dofs[1]]),self.CardiacFreq*(self.Cycles-1):])/element.R
                      WSS += ((4.0*element.eta)/pi) * (Flow/pow(mean(element.Radius), 3))
                      WSSW += self.GetWSSSignal(element)
                      PressureIN += (self.Solutions[(self.DofMap.DofMap[element.Id, 0]),self.CardiacFreq*(self.Cycles-1):])   
                      PressureOUT += (self.Solutions[(self.DofMap.DofMap[element.Id, 2]),self.CardiacFreq*(self.Cycles-1):])
                  
          PressureIN = ((PressureIN)/num_el)/133.3223684211
          PressureOUT = ((PressureOUT)/num_el)/133.3223684211           
          print entity, " PressureIN = ", mean(PressureIN), "mmHg"
          print entity, " PressureOUT = ", mean(PressureOUT), "mmHg"          
          plot(self.t, PressureIN, 'b-', linewidth = 3, label = 'Pressure IN')   #blue line            
          plot(self.t, PressureOUT, 'r-', linewidth = 3, label = 'Pressure OUT')   #red line   
          xlabel('Time ($s$)')
          ylabel('Pressure ($mmHg$)')
          title (entity + ' Pressure Signal')    
          legend()
          savefig(self.images+entity+'_pressure.png')
          close() 
                     
          Flow = (Flow*6e7)/num_el
          print entity, " Flow = ", mean(Flow), "mL/min"
          plot(self.t, Flow, 'r-', linewidth = 3, label = entity)   #red line
          xlabel('Time ($s$)')
          ylabel('Flow ($mL/min$)')
          title (entity + ' Flow Output')    
          legend()
          savefig(self.images+entity+'_flow.png')
          close()
          
          WSS = WSS/num_el
          WSSW = WSSW/num_el
          print entity, "Wss(mean) = ", mean(WSS), " Pa", " Wss(peak) = ", max(WSSW)
          plot(self.t, WSS, 'g-', linewidth = 3, label = entity)   #green line
          xlabel('Time ($s$)')
          ylabel('Wall Shear Stress ($Pa$)')
          title (entity + ' WSS Output')    
          legend()
          savefig(self.images+entity+'_wss.png')
          close()
code_tokens: def GetSolution ( self , entity ) : try : from matplotlib . pyplot import plot , xlabel , ylabel , title , legend , savefig , close except ImportError : MatPlotLibError ( ) Flow = 0 WSS = 0 WSSW = 0 PressureIN = 0 PressureOUT = 0 num_el = 0 for ent , el in self . NetworkMesh . Entities . iteritems ( ) : if ent . Id is not None and ent . Id . find ( entity ) != - 1 : for element in el : num_el += 1 dofs = element . GetPoiseuilleDofs ( ) Flow += ( self . Solutions [ ( self . DofMap . DofMap [ element . Id , dofs [ 0 ] ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] - self . Solutions [ ( self . DofMap . DofMap [ element . Id , dofs [ 1 ] ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] ) / element . R WSS += ( ( 4.0 * element . eta ) / pi ) * ( Flow / pow ( mean ( element . Radius ) , 3 ) ) WSSW += self . GetWSSSignal ( element ) PressureIN += ( self . Solutions [ ( self . DofMap . DofMap [ element . Id , 0 ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] ) PressureOUT += ( self . Solutions [ ( self . DofMap . DofMap [ element . Id , 2 ] ) , self . CardiacFreq * ( self . Cycles - 1 ) : ] ) PressureIN = ( ( PressureIN ) / num_el ) / 133.3223684211 PressureOUT = ( ( PressureOUT ) / num_el ) / 133.3223684211 print entity , " PressureIN = " , mean ( PressureIN ) , "mmHg" print entity , " PressureOUT = " , mean ( PressureOUT ) , "mmHg" plot ( self . t , PressureIN , 'b-' , linewidth = 3 , label = 'Pressure IN' ) plot ( self . t , PressureOUT , 'r-' , linewidth = 3 , label = 'Pressure OUT' ) xlabel ( 'Time ($s$)' ) ylabel ( 'Pressure ($mmHg$)' ) title ( entity + ' Pressure Signal' ) legend ( ) savefig ( self . images + entity + '_pressure.png' ) close ( ) Flow = ( Flow * 6e7 ) / num_el print entity , " Flow = " , mean ( Flow ) , "mL/min" plot ( self . t , Flow , 'r-' , linewidth = 3 , label = entity ) xlabel ( 'Time ($s$)' ) ylabel ( 'Flow ($mL/min$)' ) title ( entity + ' Flow Output' ) legend ( ) savefig ( self . images + entity + '_flow.png' ) close ( ) WSS = WSS / num_el WSSW = WSSW / num_el print entity , "Wss(mean) = " , mean ( WSS ) , " Pa" , " Wss(peak) = " , max ( WSSW ) plot ( self . t , WSS , 'g-' , linewidth = 3 , label = entity ) xlabel ( 'Time ($s$)' ) ylabel ( 'Wall Shear Stress ($Pa$)' ) title ( entity + ' WSS Output' ) legend ( ) savefig ( self . images + entity + '_wss.png' ) close ( )
short_docstring: This method gets and plots flow, pressure and WSS for specific entity.
short_docstring_tokens: This method gets and plots flow pressure and WSS for specific entity .
comment: '''
          This method gets and plots flow, pressure and WSS for specific entity.
          '''$SEP$#blue line            $SEP$#red line   $SEP$#red line$SEP$#green line