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

Vectorized '_set_cell_slope()' in MinMod.

parent 9325ca8d
No related branches found
No related tags found
No related merge requests found
...@@ -191,24 +191,11 @@ class MinMod(Limiter): ...@@ -191,24 +191,11 @@ class MinMod(Limiter):
Slope of the given cell. Slope of the given cell.
""" """
slope = [] root_vector = np.array([np.sqrt(degree+0.5)
for current_cell in range(len(projection[0])): for degree in range(len(projection))])
new_entry = sum( slope = root_vector[1:] @ projection[1:]
projection[degree][current_cell] * (degree+0.5)**0.5
for degree in range(1, len(projection)))
slope.append(new_entry)
return slope[cell] return slope[cell]
# # print(np.array(slope).shape)
# # print(slope)
# root_vector = np.array([np.sqrt(degree+0.5)
# for degree in range(len(projection))])
# test = root_vector[1:] @ projection[1:]
# # print(test.shape)
# # print(np.isclose(test, slope, rtol=1e-16))
#
# return test[cell]
class ModifiedMinMod(MinMod): class ModifiedMinMod(MinMod):
"""Class for modified minmod limiting function. """Class for modified minmod limiting function.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment