#NEWLINE# def init_data( my_data , rp ) : #NEWLINE# #INDENT# ' initialize the smooth advection problem ' #NEWLINE# msg . bold ( 'initializing the smooth advection problem...' ) #NEWLINE# if ( not isinstance ( my_data , patch . CellCenterData2d ) ) : #NEWLINE# #INDENT# print ( 'ERROR: patch invalid in smooth.py' ) #NEWLINE# print ( my_data . __class__ ) #NEWLINE# sys . exit ( ) #NEWLINE# #UNINDENT# dens = my_data . get_var ( 'density' ) #NEWLINE# xmin = my_data . grid . xmin #NEWLINE# xmax = my_data . grid . xmax #NEWLINE# ymin = my_data . grid . ymin #NEWLINE# ymax = my_data . grid . ymax #NEWLINE# xctr = ( 0.5 * ( xmin + xmax ) ) #NEWLINE# yctr = ( 0.5 * ( ymin + ymax ) ) #NEWLINE# dens . d [ : , : ] = ( 1.0 + numpy . exp ( ( ( - 60.0 ) * ( ( ( my_data . grid . x2d - xctr ) ** 2 ) + ( ( my_data . grid . y2d - yctr ) ** 2 ) ) ) ) )