mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-10 08:52:39 +08:00
curModel in problem and combo maps no longer takes a mesh.
This commit is contained in:
+18
-1
@@ -1,4 +1,4 @@
|
||||
import Utils, Survey, numpy as np, scipy.sparse as sp
|
||||
import Utils, Survey, Models, numpy as np, scipy.sparse as sp
|
||||
import Maps, Mesh
|
||||
|
||||
class BaseProblem(object):
|
||||
@@ -44,6 +44,23 @@ class BaseProblem(object):
|
||||
self.survey._prob = None
|
||||
self._survey = None
|
||||
|
||||
deleteTheseOnModelUpdate = [] # List of strings, e.g. ['_MeSigma', '_MeSigmaI']
|
||||
|
||||
@property
|
||||
def curModel(self):
|
||||
"""
|
||||
Sets the current model, and removes dependent mass matrices.
|
||||
"""
|
||||
return getattr(self, '_curModel', None)
|
||||
@curModel.setter
|
||||
def curModel(self, value):
|
||||
if value is self.curModel:
|
||||
return # it is the same!
|
||||
self._curModel = Models.Model(value, self.mapping)
|
||||
for prop in self.deleteTheseOnModelUpdate:
|
||||
if hasattr(self, prop):
|
||||
delattr(self, prop)
|
||||
|
||||
@property
|
||||
def ispaired(self):
|
||||
"""True if the problem is paired to a survey."""
|
||||
|
||||
Reference in New Issue
Block a user