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

Reworked ModifiedMinMod limiter for efficiency.

parent 204ea3d3
No related branches found
No related tags found
No related merge requests found
......@@ -218,11 +218,8 @@ class ModifiedMinMod(MinMod):
Attributes
----------
cell_len : float
Length of a cell in mesh.
mod_factor : float
Factor determining whether cell slope is significantly high enough for
modification.
threshold : float
Threshold up to which a cell slope does not require limiting.
Methods
-------
......@@ -247,11 +244,9 @@ class ModifiedMinMod(MinMod):
super()._reset(config)
# Unpack necessary configurations
# cell_len = config.pop('cell_len')
# mod_factor = config.pop('mod_factor', 0)
# self._threshold = mod_factor * cell_len**2
self._cell_len = config.pop('cell_len')
self._mod_factor = config.pop('mod_factor', 0)
cell_len = config.pop('cell_len')
mod_factor = config.pop('mod_factor', 0)
self._threshold = mod_factor * cell_len**2
def get_name(self):
"""Returns string of class name concatenated with the erase-degree."""
......@@ -275,8 +270,7 @@ class ModifiedMinMod(MinMod):
Flag whether cell should be adjusted.
"""
# if abs(cell_slope) <= self._threshold:
if abs(cell_slope) <= self._mod_factor*self._cell_len**2:
if abs(cell_slope) <= self._threshold:
return True
return super()._determine_modification(projection, cell, cell_slope)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment