Source code for pyro.burgers_viscous.problems.tophat
"""Initialize a circular "tophat" region that will drive a shock."""frompyro.utilimportmsgDEFAULT_INPUTS="inputs.tophat"
[docs]definit_data(myd,rp):""" initialize the tophat burgers problem """ifrp.get_param("driver.verbose"):msg.bold("initializing the tophat burgers problem...")u=myd.get_var("x-velocity")v=myd.get_var("y-velocity")xmin=myd.grid.xminxmax=myd.grid.xmaxymin=myd.grid.yminymax=myd.grid.ymaxxctr=0.5*(xmin+xmax)yctr=0.5*(ymin+ymax)u[:,:]=0.0v[:,:]=0.0R=0.1inside=(myd.grid.x2d-xctr)**2+(myd.grid.y2d-yctr)**2<R**2u[inside]=1.0v[inside]=1.0
[docs]deffinalize():""" print out any information to the user at the end of the run """