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

Made sure 'self.cfl_number' is not changed. Removed unnecessary comments.

parent 03b05725
Branches
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ TODO: Double-check everything!
TODO: Replace loops with list comprehension if feasible
TODO: Combine initial projection and approx solution somehow
-> Done (decided against it because they are in different files now)
TODO: Investigate why there are no weights in approx calc
TODO: Investigate why there are no weights in approx calc -> Ask
TODO: Change order of methods
TODO: Change code to not include self. but global variables; NO, do private \
or better protected instance variables instead
......@@ -25,6 +25,7 @@ TODO: Check instance variables in DG_Approximation -> Done
TODO: Improve saving of plots
TODO: Extend color options
TODO: Implement type check for all kwargs and configs
TODO: Make sure that self.cfl_number is not changed -> Done
"""
import numpy as np
......@@ -122,12 +123,13 @@ class DGScheme(object):
time_history = []
while current_time < self.final_time:
# Adjust for last cell
cfl_number = self.cfl_number
if current_time+time_step > self.final_time:
time_step = self.final_time-current_time
self.cfl_number = self.wave_speed * time_step / self.num_grid_cells
cfl_number = self.wave_speed * time_step / self.num_grid_cells
# Update projection
projection, troubled_cells = self.update_scheme.step(projection, self.cfl_number, current_time)
projection, troubled_cells = self.update_scheme.step(projection, cfl_number, current_time)
iteration += 1
......@@ -143,17 +145,6 @@ class DGScheme(object):
if self.verbose:
plt.show()
# What is that??? What is it for?
# troubled_cells = self.update_scheme.get_troubled_cell_history()
# wavelet = self.update_scheme.get_wavelet_coeffs(
# self.projection[:, 1: -1])
#
# return approx
#
# return self.projection[:, 1:-1], self.mesh[2:-2], troubled_cells, \
# wavelet
def save_plots(self):
name = self.init_cond.get_name() + '__' + self.detector.get_name() + '__' + self.limiter.get_name() \
+ '__' + self.update_scheme.get_name() + '__' + self.quadrature.get_name() + '__final_time_' \
......@@ -237,7 +228,6 @@ class DGScheme(object):
for cell in range(self.num_grid_cells):
new_row = []
eval_point = self.left_bound + (cell+0.5)*self.cell_len
# former to line above: currentX
for degree in range(self.polynom_degree + 1):
new_entry = sum(self.init_cond.calculate(eval_point
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment