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

Changed code to create data dict for basis separately.

parent 73abd042
Branches
No related tags found
No related merge requests found
...@@ -44,6 +44,8 @@ class Basis(ABC): ...@@ -44,6 +44,8 @@ class Basis(ABC):
------- -------
calculate_cell_average(projection, stencil_length, add_reconstructions) calculate_cell_average(projection, stencil_length, add_reconstructions)
Calculate cell averages for a given projection. 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): ...@@ -207,6 +209,10 @@ class Basis(ABC):
self.basis) self.basis)
return left_reconstructions, right_reconstructions 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 Legendre(Basis):
"""Class for Legendre basis.""" """Class for Legendre basis."""
......
...@@ -27,6 +27,8 @@ class TroubledCellDetector(ABC): ...@@ -27,6 +27,8 @@ class TroubledCellDetector(ABC):
Returns string of class name. Returns string of class name.
get_cells(projection) get_cells(projection)
Calculates troubled cells in a given 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, def __init__(self, config, init_cond, quadrature, basis, mesh,
...@@ -91,7 +93,7 @@ class TroubledCellDetector(ABC): ...@@ -91,7 +93,7 @@ class TroubledCellDetector(ABC):
"""Return dictionary with data necessary to plot troubled cells.""" """Return dictionary with data necessary to plot troubled cells."""
return {'projection': projection, 'wave_speed': self._wave_speed, return {'projection': projection, 'wave_speed': self._wave_speed,
'final_time': self._final_time, 'final_time': self._final_time,
'basis': {'polynomial_degree': self._basis.polynomial_degree}, 'basis': self._basis.create_data_dict(),
'mesh': self._mesh.create_data_dict() 'mesh': self._mesh.create_data_dict()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment