Skip to content

Commit 1ed100e

Browse files
committed
remove redundant get analytic temp function
1 parent 8d957d1 commit 1ed100e

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

Exec/unit_tests/diffusion_test/analysis/profiles.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,6 @@
1515
from yt.frontends.boxlib.api import CastroDataset
1616

1717

18-
## Define RGBA to HEX
19-
def rgba_to_hex(rgba):
20-
r = int(rgba[0]*255.0)
21-
g = int(rgba[1]*255.0)
22-
b = int(rgba[2]*255.0)
23-
return '#{:02X}{:02X}{:02X}'.format(r, g, b)
24-
25-
def get_analytic_profile(x_coord, time, problo, probhi,
26-
geometry, dimension):
27-
28-
if geometry == "spherical":
29-
exponent = 1.5
30-
center = 0.0
31-
elif dimension == 2 and geometry == "cylindrical":
32-
exponent = 1.5
33-
center = 0.5 * (problo[1] + probhi[1])
34-
else:
35-
exponent = dimension / 2.0
36-
center = 0.5 * (problo[0] + probhi[0])
37-
38-
dist2 = (x_coord - float(center))**2
39-
T1 = 1.0
40-
T2 = 2.0
41-
t_0 = 0.001
42-
diff_coeff = 1.0
43-
temp = T1 + (T2 - T1) * (t_0 / (time + t_0))**exponent * \
44-
np.exp(-0.25 * dist2 / (diff_coeff * (time + t_0)))
45-
46-
return temp
47-
48-
4918
def get_T_profile(plotfile):
5019

5120
ds = CastroDataset(plotfile)
@@ -69,8 +38,7 @@ def get_T_profile(plotfile):
6938
srt = np.argsort(ad[coord])
7039
x_coord = np.array(ad[coord][srt])
7140
temp = np.array(ad['Temp'][srt])
72-
analytic_temp = get_analytic_profile(x_coord, time, problo, probhi,
73-
ds.geometry, dimension)
41+
analytic_temp = np.array(ad['analytic'][srt])
7442

7543
return time, x_coord, temp, analytic_temp
7644

0 commit comments

Comments
 (0)