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

Vectorized '_calculate_coarse_projection()' for wavelet detectors.

parent cfdc28d4
No related branches found
No related tags found
No related merge requests found
......@@ -287,15 +287,8 @@ class WaveletDetector(TroubledCellDetector):
projection = projection[:, 1:-1]
# Calculate projection on coarse mesh
output_matrix = []
for i in range(self._mesh.num_cells//2):
new_entry = 0.5 * (
projection[:, 2 * i] @ basis_projection_left
+ projection[:, 2 * i + 1] @ basis_projection_right)
output_matrix.append(new_entry)
coarse_projection = np.transpose(np.array(output_matrix))
return coarse_projection
return 0.5 * (basis_projection_left.T @ projection[:, ::2] +
basis_projection_right.T @ projection[:, 1::2])
def create_data_dict(self, projection):
"""Return dictionary with data necessary to plot troubled cells."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment