Source code for pyro.advection_fv4.problems.tophat
"""Initialize a tophat profile---the value inside a small circularregions is set to 1.0 and is zero otherwise. This will exercise thelimiters significantly."""frompyro.utilimportmsgDEFAULT_INPUTS="inputs.tophat"PROBLEM_PARAMS={}
[docs]definit_data(myd,rp):""" initialize the tophat advection problem """ifrp.get_param("driver.verbose"):msg.bold("initializing the tophat advection problem...")dens=myd.get_var("density")xmin=myd.grid.xminxmax=myd.grid.xmaxymin=myd.grid.yminymax=myd.grid.ymaxxctr=0.5*(xmin+xmax)yctr=0.5*(ymin+ymax)dens[:,:]=0.0R=0.1inside=(myd.grid.x2d-xctr)**2+(myd.grid.y2d-yctr)**2<R**2dens[inside]=1.0
[docs]deffinalize():""" print out any information to the user at the end of the run """