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

Refactored 'random_stencil()'.

parent 12a0f85d
No related branches found
No related tags found
No related merge requests found
...@@ -118,8 +118,9 @@ class Mesh: ...@@ -118,8 +118,9 @@ class Mesh:
# Adjust grid spacing to be within interval if necessary # Adjust grid spacing to be within interval if necessary
grid_spacing = self.cell_len grid_spacing = self.cell_len
while point - stencil_length/2 * grid_spacing < self._left_bound \ max_spacing = 2/stencil_length*min(point-self._left_bound,
or point + stencil_length/2 * grid_spacing > self._right_bound: self._right_bound-point)
while grid_spacing > max_spacing:
grid_spacing /= 2 grid_spacing /= 2
# Return new mesh instance # Return new mesh instance
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment