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

Changed code to create data dict for mesh separately.

parent df58c32b
No related branches found
No related tags found
No related merge requests found
......@@ -88,13 +88,11 @@ class TroubledCellDetector(ABC):
pass
def create_data_dict(self, projection):
"""Return dictionary with data necessary to plot troubled cells."""
return {'projection': projection, 'wave_speed': self._wave_speed,
'final_time': self._final_time,
'basis': {'polynomial_degree': self._basis.polynomial_degree},
'mesh': {'num_grid_cells': self._mesh.num_grid_cells,
'left_bound': self._mesh.bounds[0],
'right_bound': self._mesh.bounds[1],
'num_ghost_cells': 2}
'mesh': self._mesh.create_data_dict()
}
......@@ -324,6 +322,7 @@ class WaveletDetector(TroubledCellDetector):
return coarse_projection
def create_data_dict(self, projection):
"""Return dictionary with data necessary to plot troubled cells."""
# Create general directory
data_dict = super().create_data_dict(projection)
......
......@@ -93,6 +93,13 @@ class Mesh:
"""Return the cell centers of the mesh (excluding ghost cells)."""
return self.cells[self._num_ghost_cells:-self._num_ghost_cells]
def create_data_dict(self):
"""Return dictionary with data necessary to construct mesh."""
return {'num_grid_cells': self._num_grid_cells,
'left_bound': self._left_bound,
'right_bound': self._right_bound,
'num_ghost_cells': self._num_ghost_cells}
def calculate_approximate_solution(
projection: ndarray, points: ndarray, polynomial_degree: int,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment