-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bbd7e4
commit 41f807a
Showing
5 changed files
with
160 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import numpy as np | ||
|
||
from numpy.testing import TestCase, assert_array_almost_equal | ||
from scipy.sparse import bsr_matrix, diags, coo_matrix | ||
from pyamg.classical.air import air_solver | ||
from pyamg.gallery import poisson | ||
|
||
n = 100 | ||
A = diags([np.ones((n,)), -1*np.ones((n-1,))], [0, -1]).tocsr() | ||
f_relax = ('fc_jacobi', {'iterations': 1, 'f_iterations': 1, | ||
'c_iterations': 0}) | ||
ml = air_solver(A, postsmoother=f_relax, max_levels=2) | ||
# print(ml.levels[1].A) | ||
|
||
ra_coords = np.loadtxt('/home/andrew/src/raptor/build/raptor/ruge_stuben/tests/coarse') | ||
I = np.array(ra_coords[:,0], dtype=int) | ||
J = np.array(ra_coords[:,1], dtype=int) | ||
# Jinds = np.unique(J) | ||
# jmap = {} | ||
# for i in range(Jinds.shape[0]): | ||
# jmap[Jinds[i]] = i | ||
|
||
# for i in range(J.shape[0]): | ||
# J[i] = jmap[J[i]] | ||
|
||
ra = coo_matrix((ra_coords[:,2], (I, J))) | ||
|
||
# print(np.max(ra - ml.levels[1].A)) |