-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
134 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 12 additions & 9 deletions
21
test/verification/analytic/azurv1_gaussianIC/makereference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import numpy as np | ||
import h5py | ||
import scipy | ||
x = np.linspace(-20.5,20.5,202) | ||
t = np.linspace(.5,19.5,20) | ||
phi = np.empty((10001,201)) | ||
tavg = np.linspace(0,20,10001) | ||
with h5py.File("../benchmarks.hdf5",'r') as f: | ||
|
||
x = np.linspace(-20.5, 20.5, 202) | ||
t = np.linspace(0.5, 19.5, 20) | ||
phi = np.empty((10001, 201)) | ||
tavg = np.linspace(0, 20, 10001) | ||
with h5py.File("../benchmarks.hdf5", "r") as f: | ||
for i in range(10001): | ||
key = 'gaussian_IC/t = '+str(tavg[i])+'x0=0.5' | ||
phi[i,:] = f[key][1,:] | ||
phiavg = np.empty((20,201)) | ||
key = "gaussian_IC/t = " + str(tavg[i]) + "x0=0.5" | ||
phi[i, :] = f[key][1, :] | ||
phiavg = np.empty((20, 201)) | ||
for i in range(20): | ||
for j in range(201): | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(500*i):(500*i+500),j],x = tavg[(500*i):(500+500*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(500 * i) : (500 * i + 500), j], x=tavg[(500 * i) : (500 + 500 * i)] | ||
) | ||
np.savez("reference.npz", x=x, t=t, phi=phiavg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 12 additions & 9 deletions
21
test/verification/analytic/azurv1_gaussiansource/makereference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import numpy as np | ||
import h5py | ||
import scipy | ||
x = np.linspace(-20.5,20.5,202) | ||
t = np.linspace(.5,19.5,20) | ||
phi = np.empty((10001,201)) | ||
tavg = np.linspace(0,20,10001) | ||
with h5py.File("../benchmarks.hdf5",'r') as f: | ||
|
||
x = np.linspace(-20.5, 20.5, 202) | ||
t = np.linspace(0.5, 19.5, 20) | ||
phi = np.empty((10001, 201)) | ||
tavg = np.linspace(0, 20, 10001) | ||
with h5py.File("../benchmarks.hdf5", "r") as f: | ||
for i in range(10001): | ||
key = 'gaussian_source/t = '+str(tavg[i])+'x0=0.5' | ||
phi[i,:] = f[key][1,:] | ||
phiavg = np.empty((20,201)) | ||
key = "gaussian_source/t = " + str(tavg[i]) + "x0=0.5" | ||
phi[i, :] = f[key][1, :] | ||
phiavg = np.empty((20, 201)) | ||
for i in range(20): | ||
for j in range(201): | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(500*i):(500*i+500),j],x = tavg[(500*i):(500+500*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(500 * i) : (500 * i + 500), j], x=tavg[(500 * i) : (500 + 500 * i)] | ||
) | ||
np.savez("reference.npz", x=x, t=t, phi=phiavg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 22 additions & 12 deletions
34
test/verification/analytic/azurv1_planeIC/makereference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
import numpy as np | ||
import h5py | ||
import scipy | ||
x = np.linspace(-20.5,20.5,202) | ||
t = np.linspace(.5,19.5,20) | ||
phi = np.empty((100001,201)) | ||
tavg = np.linspace(0,20,100001) | ||
with h5py.File("../benchmarks.hdf5",'r') as f: | ||
|
||
x = np.linspace(-20.5, 20.5, 202) | ||
t = np.linspace(0.5, 19.5, 20) | ||
phi = np.empty((100001, 201)) | ||
tavg = np.linspace(0, 20, 100001) | ||
with h5py.File("../benchmarks.hdf5", "r") as f: | ||
for i in range(100001): | ||
key = 'plane_IC/t = '+str(tavg[i]) | ||
phi[i,:] = f[key][1,:] | ||
phiavg = np.empty((20,201)) | ||
key = "plane_IC/t = " + str(tavg[i]) | ||
phi[i, :] = f[key][1, :] | ||
phiavg = np.empty((20, 201)) | ||
for i in range(20): | ||
for j in range(201): | ||
if i == 0: | ||
if np.fabs(x[j])-.25<0: | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(5000*i+200):(5000*i+5000),j],x = tavg[(5000*i+200):(5000+5000*i)]) | ||
if np.fabs(x[j]) - 0.25 < 0: | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(5000 * i + 200) : (5000 * i + 5000), j], | ||
x=tavg[(5000 * i + 200) : (5000 + 5000 * i)], | ||
) | ||
else: | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(5000*i):(5000*i+5000),j],x = tavg[(5000*i):(5000+5000*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(5000 * i) : (5000 * i + 5000), j], | ||
x=tavg[(5000 * i) : (5000 + 5000 * i)], | ||
) | ||
else: | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(5000*i):(5000*i+5000),j],x = tavg[(5000*i):(5000+5000*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(5000 * i) : (5000 * i + 5000), j], | ||
x=tavg[(5000 * i) : (5000 + 5000 * i)], | ||
) | ||
np.savez("reference.npz", x=x, t=t, phi=phiavg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 22 additions & 12 deletions
34
test/verification/analytic/azurv1_squareIC/makereference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
import numpy as np | ||
import h5py | ||
import scipy | ||
x = np.linspace(-20.5,20.5,202) | ||
t = np.linspace(.5,19.5,20) | ||
phi = np.empty((100001,201)) | ||
tavg = np.linspace(0,20,100001) | ||
with h5py.File("../benchmarks.hdf5",'r') as f: | ||
|
||
x = np.linspace(-20.5, 20.5, 202) | ||
t = np.linspace(0.5, 19.5, 20) | ||
phi = np.empty((100001, 201)) | ||
tavg = np.linspace(0, 20, 100001) | ||
with h5py.File("../benchmarks.hdf5", "r") as f: | ||
for i in range(100001): | ||
key = 'square_IC/t = '+str(tavg[i])+'x0=0.5' | ||
phi[i,:] = f[key][1,:] | ||
phiavg = np.empty((20,201)) | ||
key = "square_IC/t = " + str(tavg[i]) + "x0=0.5" | ||
phi[i, :] = f[key][1, :] | ||
phiavg = np.empty((20, 201)) | ||
for i in range(20): | ||
for j in range(201): | ||
if i == 0: | ||
if np.fabs(x[j])-.25<0: | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(5000*i):(5000*i+5000),j],x = tavg[(5000*i):(5000+5000*i)]) | ||
if np.fabs(x[j]) - 0.25 < 0: | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(5000 * i) : (5000 * i + 5000), j], | ||
x=tavg[(5000 * i) : (5000 + 5000 * i)], | ||
) | ||
else: | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(5000*i):(5000*i+5000),j],x = tavg[(5000*i):(5000+5000*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(5000 * i) : (5000 * i + 5000), j], | ||
x=tavg[(5000 * i) : (5000 + 5000 * i)], | ||
) | ||
else: | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(5000*i):(5000*i+5000),j],x = tavg[(5000*i):(5000+5000*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(5000 * i) : (5000 * i + 5000), j], | ||
x=tavg[(5000 * i) : (5000 + 5000 * i)], | ||
) | ||
np.savez("reference.npz", x=x, t=t, phi=phiavg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 12 additions & 9 deletions
21
test/verification/analytic/azurv1_squaresource/makereference.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import numpy as np | ||
import h5py | ||
import scipy | ||
x = np.linspace(-20.5,20.5,202) | ||
t = np.linspace(.5,19.5,20) | ||
phi = np.empty((10001,201)) | ||
tavg = np.linspace(0,20,10001) | ||
with h5py.File("../benchmarks.hdf5",'r') as f: | ||
|
||
x = np.linspace(-20.5, 20.5, 202) | ||
t = np.linspace(0.5, 19.5, 20) | ||
phi = np.empty((10001, 201)) | ||
tavg = np.linspace(0, 20, 10001) | ||
with h5py.File("../benchmarks.hdf5", "r") as f: | ||
for i in range(10001): | ||
key = 'square_source/t = '+str(tavg[i])+'x0=0.5' | ||
phi[i,:] = f[key][1,:] | ||
phiavg = np.empty((20,201)) | ||
key = "square_source/t = " + str(tavg[i]) + "x0=0.5" | ||
phi[i, :] = f[key][1, :] | ||
phiavg = np.empty((20, 201)) | ||
for i in range(20): | ||
for j in range(201): | ||
phiavg[i,j] = scipy.integrate.simpson(y = phi[(500*i):(500*i+500),j],x = tavg[(500*i):(500+500*i)]) | ||
phiavg[i, j] = scipy.integrate.simpson( | ||
y=phi[(500 * i) : (500 * i + 500), j], x=tavg[(500 * i) : (500 + 500 * i)] | ||
) | ||
np.savez("reference.npz", x=x, t=t, phi=phiavg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters