#NEWLINE# def promote( self ) : #NEWLINE# #INDENT# ' Promote from N-dimensional to N+1 dimensional index space. ' #NEWLINE# shape = self . real_shape #NEWLINE# if ( len ( shape ) > 2 ) : #NEWLINE# #INDENT# raise RuntimeError ( 'FlowSolution is 3D' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( shape ) > 1 ) : #NEWLINE# #INDENT# ( imax , jmax ) = shape #NEWLINE# for ( i , arr ) in enumerate ( self . _arrays ) : #NEWLINE# #INDENT# name = self . name_of_obj ( arr ) #NEWLINE# new_arr = numpy . zeros ( ( imax , jmax , 1 ) ) #NEWLINE# new_arr [ : , : , 0 ] = arr [ : , : ] #NEWLINE# setattr ( self , name , new_arr ) #NEWLINE# self . _arrays [ i ] = new_arr #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( vector ) > 0 ) : #NEWLINE# #INDENT# imax = shape [ 0 ] #NEWLINE# for ( i , arr ) in enumerate ( self . _arrays ) : #NEWLINE# #INDENT# name = self . name_of_obj ( arr ) #NEWLINE# new_arr = numpy . zeros ( ( imax , 1 ) ) #NEWLINE# new_arr [ : , 0 ] = arr [ : ] #NEWLINE# setattr ( self , name , new_arr ) #NEWLINE# self . _arrays [ i ] = new_arr #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( 'FlowSolution is empty!' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for vector in self . _vectors : #NEWLINE# #INDENT# vector . promote ( )