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

Set methods to static if possible.

parent af5c6294
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,8 @@ class TroubledCellDetector(object):
return max_error
def _plot_solution_and_approx(self, grid, exact, approx, color_exact, color_approx):
@staticmethod
def _plot_solution_and_approx(grid, exact, approx, color_exact, color_approx):
print(color_exact, color_approx)
plt.figure(1)
plt.plot(grid[0], exact[0], color_exact)
......@@ -95,14 +96,16 @@ class TroubledCellDetector(object):
plt.ylabel('u(x,t)')
plt.title('Solution and Approximation')
def _plot_semilog_error(self, grid, pointwise_error):
@staticmethod
def _plot_semilog_error(grid, pointwise_error):
plt.figure(2)
plt.semilogy(grid[0], pointwise_error[0])
plt.xlabel('x')
plt.ylabel('|u(x,t)-uh(x,t)|')
plt.title('Semilog Error plotted at Evaluation points')
def _plot_error(self, grid, exact, approx):
@staticmethod
def _plot_error(grid, exact, approx):
plt.figure(3)
plt.plot(grid[0], exact[0]-approx[0])
plt.xlabel('X')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment