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
Branches
No related tags found
No related merge requests found
......@@ -191,24 +191,11 @@ class MinMod(Limiter):
Slope of the given cell.
"""
slope = []
for current_cell in range(len(projection[0])):
new_entry = sum(
projection[degree][current_cell] * (degree+0.5)**0.5
for degree in range(1, len(projection)))
slope.append(new_entry)
root_vector = np.array([np.sqrt(degree+0.5)
for degree in range(len(projection))])
slope = root_vector[1:] @ projection[1:]
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 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