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

Added 'is_smooth()' to 'DiscontiuousConstant' class.

parent 0ecbed3b
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
""" """
@author: Laura C. Kühle @author: Laura C. Kühle
TODO: Add is_smooth() to DiscontinuousConstant class TODO: Add is_smooth() to DiscontinuousConstant class -> Done
""" """
import numpy as np import numpy as np
...@@ -195,6 +195,10 @@ class Box(InitialCondition): ...@@ -195,6 +195,10 @@ class Box(InitialCondition):
Returns flag whether function is smooth. Returns flag whether function is smooth.
""" """
def is_smooth(self):
"""Returns flag that function is not smooth."""
return False
def _get_point(self, x): def _get_point(self, x):
"""Evaluates function at given x-value. """Evaluates function at given x-value.
...@@ -218,10 +222,6 @@ class Box(InitialCondition): ...@@ -218,10 +222,6 @@ class Box(InitialCondition):
else: else:
return 0 return 0
def is_smooth(self):
"""Returns flag that function is not smooth."""
return False
class FourPeakWave(InitialCondition): class FourPeakWave(InitialCondition):
"""Class for a function with four peaks. """Class for a function with four peaks.
...@@ -352,15 +352,6 @@ class Linear(InitialCondition): ...@@ -352,15 +352,6 @@ class Linear(InitialCondition):
def _reset(self, config): def _reset(self, config):
"""Resets instance variables. """Resets instance variables.
Parameters
----------
config : dict
Additional parameters for initial condition.
"""
def _reset(self, config):
"""Resets instance variables.
Parameters Parameters
---------- ----------
config : dict config : dict
...@@ -500,6 +491,10 @@ class DiscontinuousConstant(InitialCondition): ...@@ -500,6 +491,10 @@ class DiscontinuousConstant(InitialCondition):
self._left_factor = config.pop('left_factor', 1) self._left_factor = config.pop('left_factor', 1)
self._right_factor = config.pop('right_factor', 0.5) self._right_factor = config.pop('right_factor', 0.5)
def is_smooth(self):
"""Returns flag that function is not smooth."""
return False
def _get_point(self, x): def _get_point(self, x):
"""Evaluates function at given x-value. """Evaluates function at given x-value.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment