curModel in problem and combo maps no longer takes a mesh.

This commit is contained in:
rowanc1
2014-05-18 16:09:47 -07:00
parent 907e0eed47
commit be0be1e986
3 changed files with 23 additions and 4 deletions
+18 -1
View File
@@ -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."""