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

Improved comments.

parent 88873b0c
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ TODO: Change order of methods -> Done ...@@ -10,6 +10,7 @@ TODO: Change order of methods -> Done
TODO: Fix bug in initialization of input matrix -> Done TODO: Fix bug in initialization of input matrix -> Done
TODO: Improve function selection (more even distribution) -> Done TODO: Improve function selection (more even distribution) -> Done
TODO: Add documentation -> Done TODO: Add documentation -> Done
TODO: Improve comments -> Done
""" """
...@@ -240,18 +241,18 @@ class TrainingDataGenerator(object): ...@@ -240,18 +241,18 @@ class TrainingDataGenerator(object):
# Calculating Corresponding Legendre Basis Coefficients for given polynomial_degree # Calculating Corresponding Legendre Basis Coefficients for given polynomial_degree
# Create stencil and basis_coefficients for smooth_function mapped onto stencil # Create stencil and basis_coefficients for smooth_function mapped onto stencil
# Determining grid_spacing # Select random cell length
grid_spacing = 2 / (2 ** np.random.randint(3, high=9, size=1)) grid_spacing = 2 / (2 ** np.random.randint(3, high=9, size=1))
# Pick a Random point between the left and right bound # Pick random point between left and right bound
point = np.random.random(1) * (self._right_bound-self._left_bound) + self._left_bound point = np.random.random(1) * (self._right_bound-self._left_bound) + self._left_bound
# Ensure Bounds of x-point stencil are within the left and right bound # Adjust grid spacing if necessary for stencil creation
while point - self._stencil_length/2 * grid_spacing < self._left_bound\ while point - self._stencil_length/2 * grid_spacing < self._left_bound\
or point + self._stencil_length/2 * grid_spacing > self._right_bound: or point + self._stencil_length/2 * grid_spacing > self._right_bound:
grid_spacing = grid_spacing / 2 grid_spacing = grid_spacing / 2
# x-point stencil # Build x-point stencil
interval = np.array([point - self._stencil_length/2 * grid_spacing, interval = np.array([point - self._stencil_length/2 * grid_spacing,
point + self._stencil_length/2 * grid_spacing]) point + self._stencil_length/2 * grid_spacing])
stencil = np.array([point + factor * grid_spacing stencil = np.array([point + factor * grid_spacing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment