[docs]definit_data(myd,rp):"""initialize the acoustic_pulse problem. This comes from McCourquodale & Coella 2011"""ifrp.get_param("driver.verbose"):msg.bold("initializing the acoustic pulse problem...")# get the height, momenta as separate variablesh=myd.get_var("height")xmom=myd.get_var("x-momentum")ymom=myd.get_var("y-momentum")X=myd.get_var("fuel")# initialize the componentsxmom[:,:]=0.0ymom[:,:]=0.0h0=rp.get_param("acoustic_pulse.h0")dh0=rp.get_param("acoustic_pulse.dh0")xmin=rp.get_param("mesh.xmin")xmax=rp.get_param("mesh.xmax")ymin=rp.get_param("mesh.ymin")ymax=rp.get_param("mesh.ymax")xctr=0.5*(xmin+xmax)yctr=0.5*(ymin+ymax)dist=np.sqrt((myd.grid.x2d-xctr)**2+(myd.grid.y2d-yctr)**2)h[:,:]=h0idx=dist<=0.5h[idx]=h0+dh0*np.exp(-16*dist[idx]**2)*np.cos(np.pi*dist[idx])**6X[:,:]=h[:,:]**2/np.max(h)
[docs]deffinalize():""" print out any information to the user at the end of the run """