Skip to content

Commit

Permalink
removing unnecessary imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-lame committed Dec 19, 2024
1 parent e0d4e87 commit 819f31b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
9 changes: 5 additions & 4 deletions examples/fixed_source/sphere_in_cube/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

cs_results = f["tallies"]["cs_tally_0"]["fission"]["mean"][:]

# mesh_results = f["tallies"]["mesh_tally_0"]["fission"]["mean"][:]
# plt.imshow(mesh_results)
# plt.title("mesh results")
# plt.show()
mesh_results = f["tallies"]["mesh_tally_0"]["fission"]["mean"][:]
plt.imshow(mesh_results)
plt.title("mesh results")
plt.colorbar()
plt.show()

Nx = 40
Ny = 40
Expand Down
2 changes: 0 additions & 2 deletions mcdc/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def round(float_val):
# return np.uint64(int_val).view(np.float64)


from shapely.geometry import LineString, box

# =============================================================================
# Domain Decomposition
# =============================================================================
Expand Down
37 changes: 2 additions & 35 deletions mcdc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
import mcdc.config as config
import matplotlib.pyplot as plt
import numba as nb
from scipy.stats.qmc import Halton
import cvxpy as cp

import matplotlib.pyplot as plt
from matplotlib import colors as mpl_colors
from matplotlib.patches import Rectangle
from shapely.geometry import Polygon, box
import scipy.fft as spfft

import numba as nb

from scipy.stats.qmc import Halton
import cvxpy as cp

from mcdc.card import UniverseCard
from mcdc.print_ import (
Expand Down Expand Up @@ -111,32 +104,6 @@ def run():
closeout(mcdc)


def calculate_cs_overlap(corners, grid):
quadrilateral = Polygon(corners)

# Get the dimensions of the grid
grid_height, grid_width = grid.shape

# Create an array to hold the overlap values
overlap = np.zeros_like(grid, dtype=float)

# Loop over each grid cell
for i in range(grid_height):
for j in range(grid_width):
# Define the current grid cell as a shapely box
cell = box(j - 0.5, i - 0.5, j + 0.5, i + 0.5)

# Calculate the intersection area between the cell and the quadrilateral
intersection = cell.intersection(quadrilateral).area

# Normalize by the cell area (which is 1 in this case)
overlap[i, j] = intersection

overlap_1d = overlap.flatten()

return overlap_1d


def calculate_cs_A(data, mcdc):
x_grid = mcdc["mesh_tallies"]["filter"]["x"][0]
y_grid = mcdc["mesh_tallies"]["filter"]["y"][0]
Expand Down

0 comments on commit 819f31b

Please sign in to comment.