diff --git a/SimPEG/Survey.py b/SimPEG/Survey.py index c640d865..e754476e 100644 --- a/SimPEG/Survey.py +++ b/SimPEG/Survey.py @@ -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): diff --git a/SimPEG/Utils/matutils.py b/SimPEG/Utils/matutils.py index f1ea7ec7..ac6c391d 100644 --- a/SimPEG/Utils/matutils.py +++ b/SimPEG/Utils/matutils.py @@ -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: