mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-10 12:37:30 +08:00
Use meshTensor to create the time mesh in a TD problem.
This commit is contained in:
+1
-13
@@ -437,19 +437,7 @@ class BaseTimeProblem(BaseProblem):
|
|||||||
del self.timeMesh
|
del self.timeMesh
|
||||||
return
|
return
|
||||||
|
|
||||||
if type(value) is not list:
|
self._timeSteps = Utils.meshTensor(value)
|
||||||
raise Exception('timeSteps must be a np.ndarray or a list of scalars and tuples.')
|
|
||||||
|
|
||||||
proposed = []
|
|
||||||
for v in value:
|
|
||||||
if Utils.isScalar(v):
|
|
||||||
proposed += [float(v)]
|
|
||||||
elif type(v) is tuple and len(v) == 2:
|
|
||||||
proposed += [float(v[0])]*int(v[1])
|
|
||||||
else:
|
|
||||||
raise Exception('timeSteps list must contain only scalars and len(2) tuples.')
|
|
||||||
|
|
||||||
self._timeSteps = np.array(proposed)
|
|
||||||
del self.timeMesh
|
del self.timeMesh
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user