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

Checked instance variables in all files.

parent 4c9c2c93
No related branches found
No related tags found
No related merge requests found
...@@ -91,15 +91,15 @@ class DGScheme(object): ...@@ -91,15 +91,15 @@ class DGScheme(object):
# Replace the string names with the actual class instances # Replace the string names with the actual class instances
# (and add the instance variables for the quadrature) # (and add the instance variables for the quadrature)
self._init_cond = getattr(Initial_Condition, self._init_cond)(self._left_bound, self._right_bound, self._init_config) self._init_cond = getattr(Initial_Condition, self._init_cond)(self._left_bound, self._right_bound,
self._init_config)
self._limiter = getattr(Limiter, self._limiter)(self._limiter_config) self._limiter = getattr(Limiter, self._limiter)(self._limiter_config)
self._quadrature = getattr(Quadrature, self._quadrature)(self._quadrature_config) self._quadrature = getattr(Quadrature, self._quadrature)(self._quadrature_config)
self._detector = getattr(Troubled_Cell_Detector, self._detector)( self._detector = getattr(Troubled_Cell_Detector, self._detector)(
self._detector_config, self._mesh, self._wave_speed, self._polynom_degree, self._num_grid_cells, self._detector_config, self._mesh, self._wave_speed, self._polynom_degree, self._num_grid_cells,
self._final_time, self._left_bound, self._right_bound, self._basis, self._init_cond, self._quadrature) self._final_time, self._left_bound, self._right_bound, self._basis, self._init_cond, self._quadrature)
self._update_scheme = getattr(Update_Scheme, self._update_scheme)( self._update_scheme = getattr(Update_Scheme, self._update_scheme)(self._polynom_degree, self._num_grid_cells,
self._detector, self._limiter, self._init_cond, self._mesh, self._wave_speed, self._polynom_degree, self._detector, self._limiter)
self._num_grid_cells, self._final_time, self._history_threshold, self._left_bound, self._right_bound)
# print(self._detector.get_name()) # print(self._detector.get_name())
# print(self._detector.__class__.__name__) # print(self._detector.__class__.__name__)
......
...@@ -78,8 +78,6 @@ class ModifiedMinMod(MinMod): ...@@ -78,8 +78,6 @@ class ModifiedMinMod(MinMod):
# Set name of function # Set name of function
self.function_name = 'ModifiedMinMod' + str(self._erase_degree) self.function_name = 'ModifiedMinMod' + str(self._erase_degree)
self._cell = 0
def _determine_modification(self, projection, cell, cell_slope): def _determine_modification(self, projection, cell, cell_slope):
if abs(cell_slope) <= self._mod_factor*self._cell_len**2: if abs(cell_slope) <= self._mod_factor*self._cell_len**2:
return True return True
......
...@@ -17,20 +17,12 @@ import timeit ...@@ -17,20 +17,12 @@ import timeit
class UpdateScheme(object): class UpdateScheme(object):
def __init__(self, detector, limiter, init_cond, mesh, wave_speed, polynom_degree, num_grid_cells, final_time, def __init__(self, polynom_degree, num_grid_cells, detector, limiter):
history_threshold, left_bound, right_bound):
# Unpack positional arguments # Unpack positional arguments
self._detector = detector
self._limiter = limiter
self._init_cond = init_cond
self._mesh = mesh
self._wave_speed = wave_speed
self._polynom_degree = polynom_degree self._polynom_degree = polynom_degree
self._num_grid_cells = num_grid_cells self._num_grid_cells = num_grid_cells
self._final_time = final_time self._detector = detector
self._history_threshold = history_threshold self._limiter = limiter
self._left_bound = left_bound
self._right_bound = right_bound
self._reset() self._reset()
...@@ -48,8 +40,6 @@ class UpdateScheme(object): ...@@ -48,8 +40,6 @@ class UpdateScheme(object):
def _reset(self): def _reset(self):
# Set additional necessary fixed instance variables # Set additional necessary fixed instance variables
self.name = 'None' self.name = 'None'
self._interval_len = self._right_bound-self._left_bound
self._cell_len = self._interval_len / self._num_grid_cells
# Set matrix A # Set matrix A
matrix = [] matrix = []
...@@ -89,10 +79,8 @@ class UpdateScheme(object): ...@@ -89,10 +79,8 @@ class UpdateScheme(object):
class SSPRK3(UpdateScheme): class SSPRK3(UpdateScheme):
def __init__(self, detector, limiter, init_cond, mesh, wave_speed, polynom_degree, num_grid_cells, final_time, def __init__(self, polynom_degree, num_grid_cells, detector, limiter):
history_threshold, left_bound, right_bound): super().__init__(polynom_degree, num_grid_cells, detector, limiter)
super().__init__(detector, limiter, init_cond, mesh, wave_speed, polynom_degree, num_grid_cells, final_time,
history_threshold, left_bound, right_bound)
# Set name of update scheme # Set name of update scheme
self.name = 'SSPRK3' self.name = 'SSPRK3'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment