Commit 8776aab5 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Modified Sod Shock ICs to use a box of size 2 x 0.5 x 0.5.


Former-commit-id: 71f45d81f3063026d46cda1ba9adaa2d13531cdf
parent 1979d2d1
......@@ -37,24 +37,22 @@ fileName = "sodShock.hdf5"
#---------------------------------------------------
#Read in high density glass
# glass1 = h5py.File("../Glass/glass_200000.hdf5")
glass1 = h5py.File("glass_001.hdf5")
glass1 = h5py.File("../Glass/glass_200000.hdf5")
pos1 = glass1["/PartType0/Coordinates"][:,:]
pos1 = pos1 / 2. # Particles are in [0:0.5, 0:0.5, 0:0.5]
#Read in high density glass
# glass2 = h5py.File("../Glass/glass_50000.hdf5")
glass2 = h5py.File("glass_002.hdf5")
glass2 = h5py.File("../Glass/glass_50000.hdf5")
pos2 = glass2["/PartType0/Coordinates"][:,:]
pos2 = pos2 / 2. # Particles are in [0:0.5, 0:0.5, 0:0.5]
#Generate high density region
rho1 = 1.
coord1 = append(pos1, pos1 + [0, 0.5, 0], 0)
coord1 = append(coord1, pos1 + [0, 0, 0.5], 0)
coord1 = append(coord1, pos1 + [0, 0.5, 0.5], 0)
coord1 = append(pos1, pos1 + [0.5, 0., 0], 0)
#coord1 = append(coord1, pos1 + [0, 0, 0.5], 0)
#coord1 = append(coord1, pos1 + [0, 0.5, 0.5], 0)
N1 = size(coord1)/3
v1 = zeros((N1, 3))
h1 = ones((N1, 1)) * 2.251 * 0.5 / (size(pos1)/3)**(1./3.)
......@@ -63,9 +61,9 @@ m1 = ones((N1, 1)) * 0.5 * rho1 / N1
#Generate low density region
rho2 = 0.25
coord2 = append(pos2, pos2 + [0, 0.5, 0], 0)
coord2 = append(coord2, pos2 + [0, 0, 0.5], 0)
coord2 = append(coord2, pos2 + [0, 0.5, 0.5], 0)
coord2 = append(pos2, pos2 + [0.5, 0, 0], 0)
#coord2 = append(coord2, pos2 + [0, 0, 0.5], 0)
#coord2 = append(coord2, pos2 + [0, 0.5, 0.5], 0)
N2 = size(coord2)/3
v2 = zeros((N2, 3))
h2 = ones((N2, 1)) * 2.251 * 0.5 / (size(pos2)/3)**(1./3.)
......@@ -74,7 +72,7 @@ m2 = ones((N2, 1)) * 0.5 * rho2 / N2
#Merge arrays
numPart = N1 + N2
coords = append(coord1, coord2+[0.5, 0., 0.], 0)
coords = append(coord1, coord2+[1, 0., 0.], 0)
v = append(v1, v2,0)
h = append(h1, h2,0)
u = append(u1, u2,0)
......@@ -88,7 +86,7 @@ file = h5py.File(fileName, 'w')
# Header
grp = file.create_group("/Header")
grp.attrs["BoxSize"] = boxSize
grp.attrs["BoxSize"] = [2,0.5,0.5]
grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0]
grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0]
grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment