mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-01 22:40:32 +08:00
updates to survey and mkvc
This commit is contained in:
+8
-1
@@ -25,6 +25,13 @@ class BaseSurvey(object):
|
||||
"""
|
||||
return getattr(self, '_prob', None)
|
||||
|
||||
@property
|
||||
def mesh(self):
|
||||
"""Mesh of the paired problem."""
|
||||
if self.ispaired:
|
||||
return self.prob.mesh
|
||||
raise Exception('Pair survey to a problem to access the problems mesh.')
|
||||
|
||||
def pair(self, p):
|
||||
"""Bind a problem to this survey instance using pointers"""
|
||||
assert hasattr(p, 'surveyPair'), "Problem must have an attribute 'surveyPair'."
|
||||
@@ -71,7 +78,7 @@ class BaseSurvey(object):
|
||||
|
||||
d_\\text{pred} = \mathbf{P} u(m)
|
||||
"""
|
||||
return u
|
||||
raise NotImplemented('projectFields is not yet implemented.')
|
||||
|
||||
@Utils.count
|
||||
def projectFieldsDeriv(self, u):
|
||||
|
||||
@@ -30,6 +30,9 @@ def mkvc(x, numDims=1):
|
||||
if type(x) == np.matrix:
|
||||
x = np.array(x)
|
||||
|
||||
if hasattr(x, 'tovec'):
|
||||
x = x.tovec()
|
||||
|
||||
assert type(x) == np.ndarray, "Vector must be a numpy array"
|
||||
|
||||
if numDims == 1:
|
||||
|
||||
Reference in New Issue
Block a user