Source code for pyro.advection_fv4.problems.smooth
"""Initialize a Gaussian profile (shifted so the minimum value is 1.0). Thisis smooth and the limiters should not kick in too much, so this can be usedfor testing convergence."""importnumpyfrompyro.utilimportmsgDEFAULT_INPUTS="inputs.smooth"PROBLEM_PARAMS={}
[docs]definit_data(my_data,rp):""" initialize the smooth advection problem """ifrp.get_param("driver.verbose"):msg.bold("initializing the smooth advection problem...")dens=my_data.get_var("density")xmin=my_data.grid.xminxmax=my_data.grid.xmaxymin=my_data.grid.yminymax=my_data.grid.ymaxxctr=0.5*(xmin+xmax)yctr=0.5*(ymin+ymax)dens[:,:]=1.0+numpy.exp(-60.0*((my_data.grid.x2d-xctr)**2+(my_data.grid.y2d-yctr)**2))
[docs]deffinalize():""" print out any information to the user at the end of the run """