In [ ]:
import pyamg
import numpy as np
from scipy.io import loadmat
import matplotlib.pyplot as plt
%matplotlib inline
In [ ]:
n=25
sten = pyamg.gallery.diffusion.diffusion_stencil_2d(epsilon=0.0001, theta=np.pi/4, type='FE')
A = pyamg.gallery.stencil_grid(sten, (n,n), format='csr')
In [ ]:
x1d = np.linspace(0, 1, n)
X, Y = np.meshgrid(x1d, x1d)
In [ ]:
#S = pyamg.strength.classical_strength_of_connection(A)
S = pyamg.strength.evolution_strength_of_connection(A)
splitting = pyamg.classical.split.RS(S)
plt.figure(figsize=(10,10))
plt.scatter(X.ravel(), Y.ravel(), c=splitting, s=100, marker='s')
In [ ]: