diff --git a/Basis_Function.py b/Basis_Function.py index 32af0aa25177b9a86af6da0ee7dcd0887ff51a2f..35faf2dad867f06e4966242c5383074a624ce4d4 100644 --- a/Basis_Function.py +++ b/Basis_Function.py @@ -44,6 +44,8 @@ class Basis(ABC): ------- calculate_cell_average(projection, stencil_length, add_reconstructions) Calculate cell averages for a given projection. + create_data_dict() + Return dictionary with data necessary to construct basis. """ @@ -207,6 +209,10 @@ class Basis(ABC): self.basis) return left_reconstructions, right_reconstructions + def create_data_dict(self): + """Return dictionary with data necessary to construct basis.""" + return {'polynomial_degree': self.polynomial_degree} + class Legendre(Basis): """Class for Legendre basis.""" diff --git a/Troubled_Cell_Detector.py b/Troubled_Cell_Detector.py index 532ed294ccdb571bd1471dee286defa7f3eafbd9..8ac1646cc580ea998852a19626488021031acf6f 100644 --- a/Troubled_Cell_Detector.py +++ b/Troubled_Cell_Detector.py @@ -27,6 +27,8 @@ class TroubledCellDetector(ABC): Returns string of class name. get_cells(projection) Calculates troubled cells in a given projection. + create_data_dict(projection) + Return dictionary with data necessary to plot troubled cells. """ def __init__(self, config, init_cond, quadrature, basis, mesh, @@ -91,7 +93,7 @@ class TroubledCellDetector(ABC): """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}, + 'basis': self._basis.create_data_dict(), 'mesh': self._mesh.create_data_dict() }