From 819f31bb723674989eb26ee8eb2d1057285bcb04 Mon Sep 17 00:00:00 2001 From: Ethan Lame Date: Thu, 19 Dec 2024 11:08:04 -0700 Subject: [PATCH] removing unnecessary imports --- .../fixed_source/sphere_in_cube/process.py | 9 +++-- mcdc/kernel.py | 2 - mcdc/main.py | 37 +------------------ 3 files changed, 7 insertions(+), 41 deletions(-) diff --git a/examples/fixed_source/sphere_in_cube/process.py b/examples/fixed_source/sphere_in_cube/process.py index d7896a54..c77451d0 100644 --- a/examples/fixed_source/sphere_in_cube/process.py +++ b/examples/fixed_source/sphere_in_cube/process.py @@ -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 diff --git a/mcdc/kernel.py b/mcdc/kernel.py index 83530bf6..c93c9310 100644 --- a/mcdc/kernel.py +++ b/mcdc/kernel.py @@ -32,8 +32,6 @@ def round(float_val): # return np.uint64(int_val).view(np.float64) -from shapely.geometry import LineString, box - # ============================================================================= # Domain Decomposition # ============================================================================= diff --git a/mcdc/main.py b/mcdc/main.py index bdc5a274..42204839 100644 --- a/mcdc/main.py +++ b/mcdc/main.py @@ -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 ( @@ -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]