Skip to content

Commit abb46fb

Browse files
committed
add test validation in spherical geometry
1 parent 19b904f commit abb46fb

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/HD/SedovBlastWave/python/testidefix.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,23 @@
3434
p = R.data['PRS'][:,0,0]
3535
x= R.r
3636

37-
[x3D, y3D, z3D]= np.meshgrid(V.x,V.y,V.z,indexing='ij')
37+
if V.geometry=="cartesian":
38+
[x3D, y3D, z3D]= np.meshgrid(V.x,V.y,V.z,indexing='ij')
39+
40+
elif V.geometry=="spherical":
41+
[r, theta, phi] = np.meshgrid(V.r,V.theta,V.phi,indexing='ij')
42+
x0=0.1
43+
y0=0
44+
z0=1.0
45+
46+
x3D=r*np.sin(theta)*np.cos(phi)-x0
47+
y3D=r*np.sin(theta)*np.sin(phi)-y0
48+
z3D=r*np.cos(theta)-z0
49+
50+
else:
51+
print("Unknown geometry "+V.geometry)
52+
sys.exit(1)
53+
3854
r3D=np.sqrt(x3D**2+y3D**2+z3D**2).flatten()
3955
p3D=V.data['PRS'].flatten()
4056

0 commit comments

Comments
 (0)