*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 722e9038 authored by Carl-Martin Pfeiler's avatar Carl-Martin Pfeiler
Browse files

removed commented old version of stationary pre

parent e99ecc55
No related branches found
No related tags found
No related merge requests found
......@@ -193,48 +193,6 @@ class TPSPreconditioner(_preconditionerInterface._PreconditionerInterface):
(A.shape[0]*2, A.shape[0]*2), matvec=Pre)
# Ainv = np.zeros(A.shape, dtype=float)
#
# e = np.zeros(A.shape[0], dtype=float)
# e[0] = 1.0
#
# print("Inverting matrix for stationary preconditioner")
# sol, succ = scipy.sparse.linalg.cg(A, e \
# , tol=self._solvetol, maxiter=4000)
# idx = (abs(sol) > self._solvetol)
# Ainv[idx,0] = sol[idx]
# for j in range(1, A.shape[0]):
# e[j-1] = 0.0
# e[j] = 1.0
# sol, succ = scipy.sparse.linalg.cg(A, e, tol=self._solvetol, maxiter=4000)
# idx = (abs(sol) > self._solvetol)
# Ainv[idx, j] = sol[idx]
# if (j % 100 == 0):
# print("Finished ", j, "out of ", A.shape[0] \
# , "cols of stationary preconditioner")
#
# N = A.shape[0]
#
# csrAinv = sp.csr_matrix(Ainv)
## cooAinv = sp.coo_matrix(Ainv)
## self._preStationary = sp.csr_matrix(( \
## np.append(cooAinv.data, cooAinv.data), ( \
## np.append(2*cooAinv.row, 2*cooAinv.row+1), \
## np.append(2*cooAinv.col, 2*cooAinv.col+1) )))
#
## self._preStationary.eliminate_zeros()
#
### stationary = lambda x: np.concatenate(( \
### csrAinv.dot(x[:x.size//2]), csrAinv.dot(x[x.size//2:])))
# # TODO THIS solves the above problem, saves memory also. TODO adapt to solving stuff
# stationary = lambda x: np.vstack((csrAinv.dot(x[0::2]),csrAinv.dot(x[1::2]))).reshape((-1,),order='F')
## stationary = lambda x: self._preStationary.dot(x)
#
# self._preconditioner = scipy.sparse.linalg.LinearOperator( \
# (2*csrAinv.shape[0], 2*csrAinv.shape[1]), matvec=stationary)
## self._preStationary.shape, matvec=stationary)
#------------------------------------------------------------------------------#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment