Skip to content

Commit

Permalink
fixing other v_inner/outer to the active ones
Browse files Browse the repository at this point in the history
  • Loading branch information
DeerWhale committed Feb 6, 2024
1 parent 998c849 commit 22d2da1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions tardis/montecarlo/montecarlo_numba/formal_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def numba_formal_integral(
# global read-only values
size_line, size_shell = tau_sobolev.shape
size_tau = size_line * size_shell
R_ph = geometry.r_inner[0] # make sure these are cgs
R_max = geometry.r_outer[size_shell - 1]
R_ph = geometry.r_inner_active[0] # make sure these are cgs
R_max = geometry.r_outer_active[size_shell - 1]
pp = np.zeros(N, dtype=np.float64) # check
exp_tau = np.zeros(size_tau, dtype=np.float64)
exp_tau = np.exp(-tau_sobolev.T.ravel()) # maybe make this 2D?
Expand Down Expand Up @@ -660,13 +660,13 @@ def populate_z(geometry, model, p, oz, oshell_id):
:oshell_id: (int64) will be set with the corresponding shell_ids
"""
# abbreviations
r = geometry.r_outer
N = len(geometry.r_inner) # check
r = geometry.r_outer_active
N = len(geometry.r_inner_active) # check
inv_t = 1 / model.time_explosion
z = 0
offset = N

if p <= geometry.r_inner[0]:
if p <= geometry.r_inner_active[0]:
# intersect the photosphere
for i in range(N):
oz[i] = 1 - calculate_z(r[i], p, inv_t)
Expand Down
10 changes: 5 additions & 5 deletions tardis/montecarlo/montecarlo_numba/formal_integral_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def cuda_formal_integral(
Parameters
----------
r_inner : array(float64, 1d, C)
self.geometry.r_inner
self.geometry.r_inner_active
r_outer : array(float64, 1d, C)
self.geometry.r_outer
self.geometry.r_outer_active
time_explosion: float64
self.geometry.time_explosion
line_list_nu : array(float64, 1d, A)
Expand Down Expand Up @@ -246,7 +246,7 @@ def formal_integral(
exp_tau = np.zeros(size_tau, dtype=np.float64) # array(float64, 1d, C)
exp_tau = np.exp(-tau_sobolev.T.ravel()) # array(float64, 1d, C)
pp[::] = calculate_p_values(
self.geometry.r_outer[size_shell - 1], N
self.geometry.r_outer_active[size_shell - 1], N
) # array(float64, 1d, C)

I_nu = np.zeros(
Expand All @@ -262,8 +262,8 @@ def formal_integral(
blocks_per_grid = (inu_size // THREADS_PER_BLOCK) + 1

cuda_formal_integral[blocks_per_grid, THREADS_PER_BLOCK](
self.geometry.r_inner,
self.geometry.r_outer,
self.geometry.r_inner_active,
self.geometry.r_outer_active,
self.model.time_explosion,
self.plasma.line_list_nu,
iT.value,
Expand Down
2 changes: 1 addition & 1 deletion tardis/montecarlo/montecarlo_numba/tests/test_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_calculate_distance_boundary(packet_params, expected_params, geometry):
r = packet_params["r"]

d_boundary = calculate_distances.calculate_distance_boundary(
r, mu, geometry.r_inner[0], geometry.r_outer[0]
r, mu, geometry.r_inner_active[0], geometry.r_outer_active[0]
)

# Accuracy to within 0.1cm
Expand Down
2 changes: 1 addition & 1 deletion tardis/visualization/tools/sdec_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def from_simulation(cls, sim, packets_mode):
"line_id"
)
transport_state = sim.transport.transport_state
r_inner = sim.simulation_state.geometry.r_inner
r_inner = sim.simulation_state.geometry.r_inner_active
t_inner = sim.simulation_state.packet_source.temperature
time_of_simulation = (
transport_state.packet_collection.time_of_simulation * u.s
Expand Down

0 comments on commit 22d2da1

Please sign in to comment.