[docs]definit_data(my_data,rp):""" initialize the sedov problem """ifrp.get_param("driver.verbose"):msg.bold("initializing the logo problem...")# create the logomyg=my_data.gridfig=plt.figure(2,(0.64,0.64),dpi=100*myg.nx/64)fig.add_subplot(111)fig.text(0.5,0.5,"pyro",transform=fig.transFigure,fontsize="16",horizontalalignment="center",verticalalignment="center")plt.axis("off")fig.canvas.draw()data=np.fromstring(fig.canvas.tostring_rgb(),dtype=np.uint8,sep='')data=data.reshape(fig.canvas.get_width_height()[::-1]+(3,))logo=np.rot90(np.rot90(np.rot90((256-data[:,:,1])/255.0)))# get the height, momenta as separate variablesh=my_data.get_var("height")xmom=my_data.get_var("x-momentum")ymom=my_data.get_var("y-momentum")X=my_data.get_var("fuel")myg=my_data.grid# initialize the componentsh[:,:]=1.0xmom[:,:]=0.0ymom[:,:]=0.0# set the height in the logo zones to be really largelogo_h=2h.v()[:,:]=logo[:,:]*logo_hX.v()[:,:]=logo[:,:]corner_height=2# explosionh[myg.ilo,myg.jlo]=corner_heighth[myg.ilo,myg.jhi]=corner_heighth[myg.ihi,myg.jlo]=corner_heighth[myg.ihi,myg.jhi]=corner_heightv=1xmom[myg.ilo,myg.jlo]=vxmom[myg.ilo,myg.jhi]=vxmom[myg.ihi,myg.jlo]=-vxmom[myg.ihi,myg.jhi]=-vymom[myg.ilo,myg.jlo]=vymom[myg.ilo,myg.jhi]=-vymom[myg.ihi,myg.jlo]=vymom[myg.ihi,myg.jhi]=-vX[:,:]*=h
[docs]deffinalize():""" print out any information to the user at the end of the run """