Add solvers from from simpegEM

This commit is contained in:
rowanc1
2014-05-02 14:05:30 -07:00
parent d8863c7c4c
commit f31caf2d61
2 changed files with 29 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
from mumps import DMumpsContext
class MumpsSolver():
A = None
ctx = None
x = None
def __init__(self, A, **kwagrs):
self.ctx = DMumpsContext(sym=0, par=1)
if self.ctx.myid ==0:
self.A = A
self.ctx.set_icntl(14, 60)
self.ctx.set_centralized_sparse(A)
self.ctx.set_silent()
self.ctx.run(job=4) # Factorization
def solve(self,b):
self.x = b.copy()
self.ctx.set_rhs(self.x)
self.ctx.run(job=3) # Solve
return self.x
def clean(self):
self.ctx.destroy()
+1
View File
@@ -0,0 +1 @@
from Mumps import Mumps