#NEWLINE# def _read_plot3d_fvars( zone , stream , dim , nvars , varnames , planes , logger ) : #NEWLINE# #INDENT# " Reads 'function' variables. " #NEWLINE# if planes : #NEWLINE# #INDENT# raise NotImplementedError ( 'planar format not supported yet' ) #NEWLINE# #UNINDENT# shape = zone . shape #NEWLINE# dim = len ( shape ) #NEWLINE# if stream . unformatted : #NEWLINE# #INDENT# if ( dim > 2 ) : #NEWLINE# #INDENT# ( imax , jmax , kmax ) = shape #NEWLINE# total = ( ( ( nvars * imax ) * jmax ) * kmax ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( imax , jmax ) = shape #NEWLINE# total = ( ( logger * imax ) * jmax ) #NEWLINE# #UNINDENT# reclen = stream . read_recordmark ( ) #NEWLINE# expected = stream . reclen_floats ( total ) #NEWLINE# if ( reclen != expected ) : #NEWLINE# #INDENT# logger . warning ( 'unexpected F variables recordlength %d vs. %d' , reclen , expected ) #NEWLINE# #UNINDENT# #UNINDENT# for i in range ( nvars ) : #NEWLINE# #INDENT# if ( varnames and ( i < len ( varnames ) ) ) : #NEWLINE# #INDENT# name = varnames [ i ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = ( 'f_%d' % ( i + 1 ) ) #NEWLINE# #UNINDENT# arr = stream . read_floats ( shape , order = 'Fortran' ) #NEWLINE# zone . flow_solution . add_array ( name , arr ) #NEWLINE# logger . debug ( '    %s min %g, max %g' , name , arr . min ( ) , arr . max ( ) ) #NEWLINE# #UNINDENT# if stream . unformatted : #NEWLINE# #INDENT# reclen2 = stream . read_recordmark ( ) #NEWLINE# if ( reclen2 != reclen ) : #NEWLINE# #INDENT# logger . warning ( 'mismatched F variables recordlength %d vs. %d' , reclen2 , reclen )