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

Vectorized '_update_right_hand_side()' for SSPRK3.

parent d8a414fc
Branches
No related tags found
No related merge requests found
...@@ -21,13 +21,24 @@ TODO: Discuss descriptions (matrices, cfl number, right-hand side, ...@@ -21,13 +21,24 @@ TODO: Discuss descriptions (matrices, cfl number, right-hand side,
TODO: Discuss referencing info on SSPRK3 TODO: Discuss referencing info on SSPRK3
TODO: Discuss name for quadrature mesh (now: grid) TODO: Discuss name for quadrature mesh (now: grid)
TODO: Contemplate using lambdify for basis TODO: Contemplate using lambdify for basis
TODO: Ask why MinMod slope is only calculated from degree 1, not 0 TODO: Ask why MinMod slope is only calculated from degree 1, not 0
-> Done (degree 0 is avg, not included in slope)
TODO: Ask whether cell indexing for limiter is correct as was or is now
-> Done (old was wrong)
Urgent: Urgent:
TODO: Vectorize '_determine_modification()' in ModifiedMinMod TODO: Rework ModifiedMinMod limiter for efficiency -> Done
TODO: Vectorize '_set_cell_slope()' in MinMod TODO: Vectorize '_set_cell_slope()' in MinMod -> Done
TODO: Vectorize '_determine_modification()' in MinMod TODO: Vectorize '_determine_modification()' in MinMod -> Done
TODO: Vectorize 'apply()' in MinMod TODO: Rework limit masking to apply over array instead of cell -> Done
TODO: Vectorize 'apply()' in MinMod -> Done
TODO: Vectorize 'get_cells()' in ANN detector -> Done
TODO: Vectorize '_calculate_wavelet_coeffs()' for wavelet detectors -> Done
TODO: Vectorize '_calculate_coarse_projection()' for wavelet detectors -> Done
TODO: Vectorize '_update_right_hand_side()' for SSPRK3 -> Done
TODO: Vectorize '_reset()' for update scheme
TODO: Vectorize 'plot_details()'
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
...@@ -39,6 +50,8 @@ TODO: Investigate g-mesh(?) ...@@ -39,6 +50,8 @@ TODO: Investigate g-mesh(?)
TODO: Create g-mesh with Mesh class TODO: Create g-mesh with Mesh class
TODO: Combine ANN workflows if feasible TODO: Combine ANN workflows if feasible
TODO: Investigate profiling for speed up TODO: Investigate profiling for speed up
TODO: Make sure that the cell indices are the same over all TCDs
TODO: Make sure TCs are reported as ndarray
Critical, but not urgent: Critical, but not urgent:
TODO: Check whether all ValueError are set (correctly) TODO: Check whether all ValueError are set (correctly)
......
...@@ -318,23 +318,18 @@ class SSPRK3(UpdateScheme): ...@@ -318,23 +318,18 @@ class SSPRK3(UpdateScheme):
Matrix of right-hand side. Matrix of right-hand side.
""" """
# Initialize vector and set first entry to accommodate for ghost cell right_hand_side = np.zeros_like(current_projection)
right_hand_side = [0]
for j in range(self._num_cells):
if self._wave_speed > 0: if self._wave_speed > 0:
right_hand_side.append(2*(self._stiffness_matrix right_hand_side[:, 1:-1] = 2 * (
@ current_projection[:, j+1] self._boundary_matrix @ current_projection[:, :-2] +
+ self._boundary_matrix self._stiffness_matrix @ current_projection[:, 1:-1])
@ current_projection[:, j]))
else: else:
right_hand_side.append(2*(self._stiffness_matrix right_hand_side[:, 1:-1] = 2 * (
@ current_projection[:, j+1] self._boundary_matrix @ current_projection[:, 2:] +
+ self._boundary_matrix self._stiffness_matrix @ current_projection[:, 1:-1])
@ current_projection[:, j+2]))
# Set ghost cells to respective value # Set ghost cells to respective value
right_hand_side[0] = right_hand_side[self._num_cells] right_hand_side[:, 0] = right_hand_side[:, -2]
right_hand_side.append(right_hand_side[1]) right_hand_side[:, -1] = right_hand_side[:, 1]
return np.transpose(right_hand_side) return right_hand_side
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment