88import discretize
99from discretize import utils
1010import properties
11- from SimPEG .EM import FDEM , TDEM
12- from SimPEG import Utils , Maps
13- from SimPEG .EM .Static import DC
11+ from SimPEG import maps
12+ from SimPEG .electromagnetics import frequency_domain as fdem
13+ from SimPEG .electromagnetics import time_domain as tdem
14+ from SimPEG .electromagnetics import resistivity as dc
15+ from SimPEG .utils import setKwargs
1416
1517try :
1618 from pymatsolver import Pardiso as Solver
@@ -81,7 +83,7 @@ class BaseSimulation(BaseCasing):
8183
8284 def __init__ (self , ** kwargs ):
8385 # set keyword arguments
84- Utils . setKwargs (self , ** kwargs )
86+ setKwargs (self , ** kwargs )
8587
8688 # if the working directory does not exsist, create it
8789 if not os .path .isdir (self .directory ):
@@ -121,6 +123,11 @@ def prob(self):
121123 def survey (self ):
122124 return self ._survey
123125
126+ @property
127+ def mesh (self ):
128+ return self .meshGenerator .mesh
129+
130+
124131 def write_py (self , includeDC = True , include2D = True ):
125132 """
126133 Write a python script for running the simulation
@@ -222,7 +229,7 @@ class SimulationFDEM(BaseSimulation):
222229 choices = ["e" , "b" , "h" , "j" ]
223230 )
224231
225- physics = "FDEM "
232+ physics = "fdem "
226233
227234 def __init__ (self , ** kwargs ):
228235 super (SimulationFDEM , self ).__init__ (** kwargs )
@@ -231,7 +238,7 @@ def __init__(self, **kwargs):
231238 def prob (self ):
232239 if getattr (self , '_prob' , None ) is None :
233240 self ._prob = getattr (
234- FDEM , 'Problem3D_{}' .format (self .formulation )
241+ fdem , 'Problem3D_{}' .format (self .formulation )
235242 )(
236243 self .meshGenerator .mesh ,
237244 sigmaMap = self .physprops .wires .sigma ,
@@ -241,12 +248,12 @@ def prob(self):
241248 )
242249
243250 if getattr (self , 'srcList' ) is not None :
244- self ._survey = FDEM .Survey (self .srcList .srcList )
251+ self ._survey = fdem .Survey (self .srcList .srcList )
245252 elif getattr (self , 'src' ) is not None :
246- self ._survey = FDEM .Survey (self .src .srcList )
253+ self ._survey = fdem .Survey (self .src .srcList )
247254 else :
248255 raise Exception ("one of src, srcList must be set" )
249- self ._prob .pair ( self ._survey )
256+ self ._prob .survey = self ._survey
250257 return self ._prob
251258
252259 @property
@@ -269,7 +276,7 @@ class SimulationTDEM(BaseSimulation):
269276 choices = ["e" , "b" , "h" , "j" ]
270277 )
271278
272- physics = "TDEM "
279+ physics = "tdem "
273280
274281 def __init__ (self , ** kwargs ):
275282 super (SimulationTDEM , self ).__init__ (** kwargs )
@@ -278,7 +285,7 @@ def __init__(self, **kwargs):
278285 def prob (self ):
279286 if getattr (self , '_prob' , None ) is None :
280287 self ._prob = getattr (
281- TDEM , 'Problem3D_{}' .format (self .formulation )
288+ tdem , 'Problem3D_{}' .format (self .formulation )
282289 )(
283290 self .meshGenerator .mesh ,
284291 timeSteps = self .modelParameters .timeSteps ,
@@ -288,9 +295,9 @@ def prob(self):
288295 verbose = self .verbose
289296 )
290297
291- self ._survey = TDEM .Survey (self .srcList .srcList )
298+ self ._survey = tdem .Survey (self .srcList .srcList )
292299
293- self ._prob .pair ( self ._survey )
300+ self ._prob .survey = self ._survey
294301 return self ._prob
295302
296303 @property
@@ -324,22 +331,22 @@ class SimulationDC(BaseSimulation):
324331 default = "phi"
325332 )
326333
327- physics = "DC "
334+ physics = "dc "
328335
329336 def __init__ (self , ** kwargs ):
330337 super (SimulationDC , self ).__init__ (** kwargs )
331338
332- self ._prob = DC .Problem3D_CC (
339+ self ._prob = dc .Problem3D_CC (
333340 self .meshGenerator .mesh ,
334341 sigmaMap = self .physprops .wires .sigma ,
335342 bc_type = 'Dirichlet' ,
336343 Solver = Solver
337344 )
338345 self ._srcList = [
339- DC . Src .Dipole ([], self .src_a [i , :], self .src_b [i , :])
346+ dc . sources .Dipole ([], self .src_a [i , :], self .src_b [i , :])
340347 for i in range (self .src_a .shape [0 ])
341348 ]
342349 # self._src = DC.Src.Dipole([], self.src_a, self.src_b)
343- self ._survey = DC .Survey (self ._srcList )
350+ self ._survey = dc .Survey (self ._srcList )
344351
345- self ._prob .pair ( self ._survey )
352+ self ._prob .survey = self ._survey
0 commit comments