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

Renamed boundary matrix to flux matrix.

parent 4e671346
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ TODO: Discuss how wavelet details should be plotted
Urgent:
TODO: Rename stiffness matrix to volume integral matrix -> Done
TODO: Rename boundary matrix to flux matrix
TODO: Rename boundary matrix to flux matrix -> Done
TODO: Change num_ghost_cells to be 1 for calc and 0 for other
TODO: Move boundary condition to Mesh class
TODO: Ensure exact solution is calculated in Equation class
......
......@@ -181,8 +181,8 @@ class LinearAdvection(Equation):
----------
volume_integral_matrix : ndarray
Volume integral matrix.
boundary_matrix : ndarray
Boundary matrix.
flux_matrix : ndarray
Flux matrix.
Methods
-------
......@@ -216,11 +216,11 @@ class LinearAdvection(Equation):
lambda i, j: (j > i) & ((i+j) % 2 == 1), matrix_shape)] = -1.0
self._volume_integral_matrix = matrix * degree_matrix
# Set boundary matrix
# Set flux matrix
matrix = np.fromfunction(lambda i, j: (-1.0)**i, matrix_shape) \
if self._wave_speed > 0 \
else np.fromfunction(lambda i, j: (-1.0)**j, matrix_shape)
self._boundary_matrix = matrix * degree_matrix
self._flux_matrix = matrix * degree_matrix
def _initialize_projection(self) -> ndarray:
"""Initialize projection."""
......@@ -323,7 +323,7 @@ class LinearAdvection(Equation):
if self._wave_speed > 0:
right_hand_side[:, self._mesh.num_ghost_cells:
-self._mesh.num_ghost_cells] = \
2 * (self._boundary_matrix @
2 * (self._flux_matrix @
projection[:, self._mesh.num_ghost_cells-1:
-self._mesh.num_ghost_cells-1] +
self._volume_integral_matrix @
......@@ -332,7 +332,7 @@ class LinearAdvection(Equation):
else:
right_hand_side[:, self._mesh.num_ghost_cells:
-self._mesh.num_ghost_cells] = \
2 * (self._boundary_matrix @
2 * (self._flux_matrix @
projection[:, self._mesh.num_ghost_cells+1:] +
self._volume_integral_matrix @
projection[:, self._mesh.num_ghost_cells:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment