original_docstring: 
          If adaptation algorithm is active, this method 
          will write a json file for each mesh including
          information about vessel adaptation.
          
docstring: If adaptation algorithm is active, this method
  will write a json file for each mesh including
  information about vessel adaptation.
docstring_tokens: If adaptation algorithm is active this method will write a json file for each mesh including information about vessel adaptation .
code: def WriteJsonAdapt(self, adaptation, PatientId):
          '''
          If adaptation algorithm is active, this method 
          will write a json file for each mesh including
          information about vessel adaptation.
          '''
              
          meshInfo = {}
          
          for element in self.NetworkMesh.Elements:
              if element.Type == 'WavePropagation':
                  elName = element.Name
                  meshInfo['meshId']=str(element.Id)
                  meshInfo['name']=str(elName)
                  meshInfo['items'] = []
                  timeValues = {}
                  timeValues['flow'] = []
                  timeValues['pressure'] = []
                  timeValues['wssP'] = []
                  timeValues['diameter'] = []
                  
                  for day,sol in adaptation.solutions.iteritems():
                      if day == -1:
                          try:
                              timeValues['flow'].append([day,sol.dayFlow[element.Name]])
                              timeValues['pressure'].append([day,sol.dayPressure[element.Name]])
                              timeValues['wssP'].append([day,sol.dayWssP[element.Name]])
                              timeValues['diameter'].append([day,sol.dayDiameter[element.Name]])
                          except KeyError:
                              pass
                      if day != -1:
                          timeValues['flow'].append([day*10,sol.dayFlow[element.Name]])
                          timeValues['pressure'].append([day*10,sol.dayPressure[element.Name]])
                          timeValues['wssP'].append([day*10,sol.dayWssP[element.Name]])
                          timeValues['diameter'].append([day*10,sol.dayDiameter[element.Name]])
                     
                  timeValues['flow'].sort()
                  min_q = 0
                  for q in timeValues['flow']:
                      if q[1] < min_q:
                          min_q = q[1]
                  meshInfo['min_q'] = str(min_q)
                  timeValues['pressure'].sort()
                  timeValues['wssP'].sort()
                  timeValues['diameter'].sort()
                  meshInfo['items'].append(timeValues)
                  path = 'Results/' + PatientId + '/json/adapt_'+str(elName)+'.json'
                  f = open(path,'w')
                  dump(meshInfo, f)
                  f.close()
code_tokens: def WriteJsonAdapt ( self , adaptation , PatientId ) : meshInfo = { } for element in self . NetworkMesh . Elements : if element . Type == 'WavePropagation' : elName = element . Name meshInfo [ 'meshId' ] = str ( element . Id ) meshInfo [ 'name' ] = str ( elName ) meshInfo [ 'items' ] = [ ] timeValues = { } timeValues [ 'flow' ] = [ ] timeValues [ 'pressure' ] = [ ] timeValues [ 'wssP' ] = [ ] timeValues [ 'diameter' ] = [ ] for day , sol in adaptation . solutions . iteritems ( ) : if day == - 1 : try : timeValues [ 'flow' ] . append ( [ day , sol . dayFlow [ element . Name ] ] ) timeValues [ 'pressure' ] . append ( [ day , sol . dayPressure [ element . Name ] ] ) timeValues [ 'wssP' ] . append ( [ day , sol . dayWssP [ element . Name ] ] ) timeValues [ 'diameter' ] . append ( [ day , sol . dayDiameter [ element . Name ] ] ) except KeyError : pass if day != - 1 : timeValues [ 'flow' ] . append ( [ day * 10 , sol . dayFlow [ element . Name ] ] ) timeValues [ 'pressure' ] . append ( [ day * 10 , sol . dayPressure [ element . Name ] ] ) timeValues [ 'wssP' ] . append ( [ day * 10 , sol . dayWssP [ element . Name ] ] ) timeValues [ 'diameter' ] . append ( [ day * 10 , sol . dayDiameter [ element . Name ] ] ) timeValues [ 'flow' ] . sort ( ) min_q = 0 for q in timeValues [ 'flow' ] : if q [ 1 ] < min_q : min_q = q [ 1 ] meshInfo [ 'min_q' ] = str ( min_q ) timeValues [ 'pressure' ] . sort ( ) timeValues [ 'wssP' ] . sort ( ) timeValues [ 'diameter' ] . sort ( ) meshInfo [ 'items' ] . append ( timeValues ) path = 'Results/' + PatientId + '/json/adapt_' + str ( elName ) + '.json' f = open ( path , 'w' ) dump ( meshInfo , f ) f . close ( )
short_docstring: If adaptation algorithm is active, this method
  will write a json file for each mesh including
  information about vessel adaptation.
short_docstring_tokens: If adaptation algorithm is active this method will write a json file for each mesh including information about vessel adaptation .
comment: '''
          If adaptation algorithm is active, this method 
          will write a json file for each mesh including
          information about vessel adaptation.
          '''