Skip to content

Commit e9df7b2

Browse files
authored
make the RT problem initial conditions symmetric (#216)
this reduces roundoff
1 parent a8415d3 commit e9df7b2

File tree

1 file changed

+3
-2
lines changed
  • pyro/compressible/problems

1 file changed

+3
-2
lines changed

pyro/compressible/problems/rt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ def init_data(my_data, rp):
5959

6060
j += 1
6161

62-
ymom[:, :] = amp*np.cos(2.0*np.pi*myg.x2d/(myg.xmax-myg.xmin))*np.exp(-(myg.y2d-ycenter)**2/sigma**2)
63-
62+
L = myg.xmax-myg.xmin
63+
ymom[:, :] = amp * 0.5 * (np.cos(2.0*np.pi*myg.x2d/L) +
64+
np.cos(2.0*np.pi*(L - myg.x2d)/L)) * np.exp(-(myg.y2d-ycenter)**2/sigma**2)
6465
ymom *= dens
6566

6667
# set the energy (P = cs2*dens)

0 commit comments

Comments
 (0)