Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Oct 14, 2024
1 parent 3577b58 commit d68885a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Exec/science/xrb_spherical/analysis/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yt
import numpy as np
import matplotlib.pyplot as plt
from yt.units import cm
from yt.frontends.boxlib.api import CastroDataset

"""
Given a plot file and field name, it gives slice plots at the top,
Expand All @@ -23,7 +23,7 @@ def slice(fname:str, field:str, loc:str="top") -> None:
loc: location on the domain. {top, mid, bot}
"""

ds = yt.load(fname, hint="castro")
ds = CastroDataset(fname)
currentTime = ds.current_time.in_units("s")
print(f"Current time of this plot file is {currentTime} s")

Expand All @@ -39,7 +39,7 @@ def slice(fname:str, field:str, loc:str="top") -> None:
theta_center = 0.5 * (thetar + thetal)

# Domain width of the slice plot
width = (2.0*dr, 2.0*dr)
width = (3.0*dr, 3.0*dr)

loc = loc.lower()
loc_options = ["top", "mid", "bot"]
Expand All @@ -48,9 +48,9 @@ def slice(fname:str, field:str, loc:str="top") -> None:
raise Exception("loc parameter must be top, mid or bot")

# Centers for the Top, Mid and Bot panels
centers = {"top":(r_center*np.sin(thetal)+0.8*dr, r_center*np.cos(thetal)),
centers = {"top":(r_center*np.sin(thetal)+1.48*dr, r_center*np.cos(thetal)),
"mid":(r_center*np.sin(theta_center), r_center*np.cos(theta_center)),
"bot":(r_center*np.sin(thetar)+0.8*dr, r_center*np.cos(thetar))}
"bot":(r_center*np.sin(thetar)+1.48*dr, r_center*np.cos(thetar))}

sp = yt.SlicePlot(ds, 'phi', field, width=width)

Expand Down
4 changes: 2 additions & 2 deletions Exec/science/xrb_spherical/inputs.He.1000Hz
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ stop_time = 3.0
# PROBLEM SIZE & GEOMETRY
geometry.is_periodic = 0 0
geometry.coord_sys = 2 # 0 => cart, 1 => RZ 2=>spherical
geometry.prob_lo = 1.1e6 0.392699 #0.0
geometry.prob_hi = 1.13072e6 2.748893 #3.14159
geometry.prob_lo = 1.1e6 0
geometry.prob_hi = 1.13072e6 3.1415926
amr.n_cell = 192 1152

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
Expand Down

0 comments on commit d68885a

Please sign in to comment.