#NEWLINE# def _read_plot3d_qvars( zone , stream , planes , logger ) : #NEWLINE# #INDENT# " Reads 'density', 'momentum' and 'energy_stagnation_density'. " #NEWLINE# if planes : #NEWLINE# #INDENT# raise NotImplementedError ( 'planar format not supported yet' ) #NEWLINE# #UNINDENT# shape = zone . shape #NEWLINE# dim = len ( shape ) #NEWLINE# if kmax . unformatted : #NEWLINE# #INDENT# if ( dim > 2 ) : #NEWLINE# #INDENT# ( imax , jmax , kmax ) = shape #NEWLINE# total = ( ( ( 5 * imax ) * jmax ) * kmax ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( imax , jmax ) = shape #NEWLINE# total = ( ( 4 * imax ) * jmax ) #NEWLINE# #UNINDENT# reclen = stream . read_recordmark ( ) #NEWLINE# expected = stream . reclen_floats ( total ) #NEWLINE# if ( reclen != expected ) : #NEWLINE# #INDENT# logger . warning ( 'unexpected Q variables recordlength %d vs. %d' , reclen , expected ) #NEWLINE# #UNINDENT# #UNINDENT# name = 'density' #NEWLINE# arr = stream . read_floats ( shape , order = 'Fortran' ) #NEWLINE# logger . debug ( '    %s min %g, max %g' , name , arr . min ( ) , arr . max ( ) ) #NEWLINE# zone . flow_solution . add_array ( name , arr ) #NEWLINE# vec = Vector ( ) #NEWLINE# vec . x = stream . read_floats ( shape , order = 'Fortran' ) #NEWLINE# logger . debug ( '    momentum.x min %g, max %g' , vec . x . min ( ) , vec . x . max ( ) ) #NEWLINE# vec . y = stream . read_floats ( shape , order = 'Fortran' ) #NEWLINE# logger . debug ( '    momentum.y min %g, max %g' , vec . y . min ( ) , vec . y . max ( ) ) #NEWLINE# if ( dim > 2 ) : #NEWLINE# #INDENT# vec . z = stream . read_floats ( shape , order = 'Fortran' ) #NEWLINE# logger . debug ( '    momentum.z min %g, max %g' , vec . z . min ( ) , vec . z . max ( ) ) #NEWLINE# #UNINDENT# zone . flow_solution . add_vector ( 'momentum' , vec ) #NEWLINE# name = 'energy_stagnation_density' #NEWLINE# arr = stream . read_floats ( shape , order = 'Fortran' ) #NEWLINE# logger . debug ( '    %s min %g, max %g' , name , arr . min ( ) , arr . max ( ) ) #NEWLINE# zone . flow_solution . add_array ( name , arr ) #NEWLINE# if stream . unformatted : #NEWLINE# #INDENT# reclen2 = stream . read_recordmark ( ) #NEWLINE# if ( reclen2 != reclen ) : #NEWLINE# #INDENT# logger . warning ( 'mismatched Q variables recordlength %d vs. %d' , reclen2 , reclen )