Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Luckabarbeau committed Sep 12, 2019
2 parents de683ef + 1e58152 commit 38445d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Labo_1/meshDifference.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
def meshDifference(coarseMesh, fineMesh):
errorMatrix = np.zeros(coarseMesh.shape)
numRows = errorMatrix.shape[0]
numCols = errorMatrix.shape[1]

if coarseMesh.size == 1:
numCols = 1
else:
numCols = errorMatrix.shape[1]

for row in range(numRows):
for col in range(numCols):
fineMeshRows = (2 * row, 2 * row + 1)
Expand Down
7 changes: 3 additions & 4 deletions Labo_1/meshDifference_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
import numpy as np


a = np.array([[4, 5],
[6, 7]])
b = np.array([2])
expectedOutput = 14
a = np.ones((8, 4))
b = np.zeros((4, 2))
expectedOutput = 32

functionOutput = meshDifference(b, a)

Expand Down

0 comments on commit 38445d7

Please sign in to comment.