Skip to content
Snippets Groups Projects
Commit 44c1b800 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Removed unnecessary dimension during cell average calculation.

parent 254ef283
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ TODO: Discuss how wavelet details should be plotted ...@@ -25,6 +25,7 @@ TODO: Discuss how wavelet details should be plotted
Urgent: Urgent:
TODO: Vectorize 'plot_details()' -> Done TODO: Vectorize 'plot_details()' -> Done
TODO: Remove unnecessary dimension during cell average calculation -> Done
TODO: Replace loops/list comprehension with vectorization if feasible TODO: Replace loops/list comprehension with vectorization if feasible
TODO: Replace loops with list comprehension if feasible TODO: Replace loops with list comprehension if feasible
TODO: Rework ICs to allow vector input TODO: Rework ICs to allow vector input
......
...@@ -500,7 +500,7 @@ class OrthonormalLegendre(Legendre): ...@@ -500,7 +500,7 @@ class OrthonormalLegendre(Legendre):
projection. projection.
""" """
cell_averages = np.array([projection[0] / np.sqrt(2)]) cell_averages = projection[0] / np.sqrt(2)
if add_reconstructions: if add_reconstructions:
middle_idx = stencil_len // 2 middle_idx = stencil_len // 2
...@@ -508,11 +508,11 @@ class OrthonormalLegendre(Legendre): ...@@ -508,11 +508,11 @@ class OrthonormalLegendre(Legendre):
self._calculate_reconstructions( self._calculate_reconstructions(
projection[:, middle_idx:middle_idx+1]) projection[:, middle_idx:middle_idx+1])
return np.array(list(map( return np.array(list(map(
np.float64, zip(cell_averages[:, :middle_idx], np.float64, zip(cell_averages[:middle_idx],
left_reconstructions, left_reconstructions,
cell_averages[:, middle_idx], cell_averages[middle_idx:middle_idx+1],
right_reconstructions, right_reconstructions,
cell_averages[:, middle_idx+1:])))) cell_averages[middle_idx+1:]))))
return np.array(list(map(np.float64, cell_averages))) return np.array(list(map(np.float64, cell_averages)))
def _calculate_reconstructions(self, projection: ndarray) \ def _calculate_reconstructions(self, projection: ndarray) \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment