Exemplo n.º 1
0
    def __init__(self,
                 rxList,
                 freq,
                 loc,
                 orientation='Z',
                 moment=1.,
                 mu=mu_0,
                 **kwargs):
        self.freq = float(freq)
        self.loc = loc
        if isinstance(orientation, str):
            assert orientation.upper() in [
                'X', 'Y', 'Z'
            ], ("orientation must "
                "be in 'X', 'Y', "
                "'Z' not {}".format(orientation))
            orientation = orientationDict[orientation.upper()]
        elif (np.linalg.norm(orientation - np.r_[1., 0., 0.]) > 1e-6
              or np.linalg.norm(orientation - np.r_[0., 1., 0.]) > 1e-6
              or np.linalg.norm(orientation - np.r_[0., 0., 1.]) > 1e-6):
            warnings.warn('Using orientations that are not in aligned with'
                          ' the mesh axes is not thoroughly tested. PR on '
                          'a test??')

        assert np.linalg.norm(orientation) == 1., (
            'Orientation must have unit'
            ' length, not {}'.format(np.linalg.norm(orientation)))

        self.orientation = orientation
        self.moment = moment
        self.mu = mu
        Utils.setKwargs(self, **kwargs)
        BaseSrc.__init__(self, rxList)
Exemplo n.º 2
0
    def __init__(self, rxList, freq, loc, orientation="Z", moment=1.0, mu=mu_0, **kwargs):
        self.freq = float(freq)
        self.loc = loc
        if isinstance(orientation, str):
            assert orientation.upper() in ["X", "Y", "Z"], (
                "orientation must " "be in 'X', 'Y', " "'Z' not {}".format(orientation)
            )
            orientation = orientationDict[orientation.upper()]
        elif (
            np.linalg.norm(orientation - np.r_[1.0, 0.0, 0.0]) > 1e-6
            or np.linalg.norm(orientation - np.r_[0.0, 1.0, 0.0]) > 1e-6
            or np.linalg.norm(orientation - np.r_[0.0, 0.0, 1.0]) > 1e-6
        ):
            warnings.warn(
                "Using orientations that are not in aligned with"
                " the mesh axes is not thoroughly tested. PR on "
                "a test??"
            )

        assert np.linalg.norm(orientation) == 1.0, "Orientation must have unit" " length, not {}".format(
            np.linalg.norm(orientation)
        )

        self.orientation = orientation
        self.moment = moment
        self.mu = mu
        Utils.setKwargs(self, **kwargs)
        BaseSrc.__init__(self, rxList)
Exemplo n.º 3
0
 def __init__(self, **kwargs):
     super(PlotTDEM, self).__init__()
     Utils.setKwargs(self, **kwargs)
     self.xmin, self.xmax = self.mesh.vectorCCx.min(
     ), self.mesh.vectorCCx.max()
     self.ymin, self.ymax = self.mesh.vectorCCy.min(
     ), self.mesh.vectorCCy.max()
     self.zmin, self.zmax = self.mesh.vectorCCz.min(
     ), self.mesh.vectorCCz.max()
Exemplo n.º 4
0
    def __init__(self, **kwargs):
        Utils.setKwargs(self, **kwargs)

        if self.src_a is None:
            self.src_a = self.modelParameters.src_a

        if self.src_b is None:
            self.src_b = self.modelParameters.src_b

        assert self.src_a[1] == self.src_b[1], (
            'non y-axis aligned sources have not been implemented')
Exemplo n.º 5
0
    def __init__(self, **kwargs):
        # set keyword arguments
        Utils.setKwargs(self, **kwargs)

        # if the working directory does not exsist, create it
        if not os.path.isdir(self.directory):
            os.mkdir(self.directory)

        # hook up the properties classes
        self.meshGenerator.cp = self.cp

        if getattr(self, 'src', None) is not None:
            self.src.cp = self.cp
            self.src.meshGenerator = self.meshGenerator
Exemplo n.º 6
0
 def __init__(self, mesh, **kwargs):
     Utils.setKwargs(self, **kwargs)
     self.mesh = mesh
     if PARALLEL:
         if self.parallel:
             print(">> Use multiprocessing for parallelization")
             if self.n_cpu is None:
                 self.n_cpu = multiprocessing.cpu_count()
             print((">> n_cpu: %i") % (self.n_cpu))
         else:
             print(">> Serial version is used")
     else:
         print(">> Serial version is used")
     if self.hz is None:
         raise Exception("Input vertical thickness hz !")
Exemplo n.º 7
0
    def __init__(self, invProb, directiveList=[], **kwargs):
        self.directiveList = directiveList
        Utils.setKwargs(self, **kwargs)

        self.invProb = invProb

        self.opt = invProb.opt
        self.opt.callback = self._optCallback

        self.stoppers = [StoppingCriteria.iteration]

        # Check if we have inserted printers into the optimization
        if IterationPrinters.phi_d not in self.opt.printers:
            self.opt.printers.insert(1, IterationPrinters.beta)
            self.opt.printers.insert(2, IterationPrinters.phi_d)
            self.opt.printers.insert(3, IterationPrinters.phi_m)
Exemplo n.º 8
0
    def __init__(self, invProb, directiveList=[], **kwargs):
        self.directiveList = directiveList
        Utils.setKwargs(self, **kwargs)

        self.invProb = invProb

        self.opt = invProb.opt
        self.opt.callback = self._optCallback

        self.stoppers = [StoppingCriteria.iteration]

        # Check if we have inserted printers into the optimization
        if IterationPrinters.phi_d not in self.opt.printers:
            self.opt.printers.insert(1, IterationPrinters.beta)
            self.opt.printers.insert(2, IterationPrinters.phi_d)
            self.opt.printers.insert(3, IterationPrinters.phi_m)
Exemplo n.º 9
0
 def __init__(self, mesh, **kwargs):
     Utils.setKwargs(self, **kwargs)
     self.mesh = mesh
     if PARALLEL:
         if self.parallel:
             print(">> Use multiprocessing for parallelization")
             if self.n_cpu is None:
                 self.n_cpu = multiprocessing.cpu_count()
             print((">> n_cpu: %i") % (self.n_cpu))
         else:
             print(">> Serial version is used")
     else:
         print(">> Serial version is used")
     if self.hz is None:
         raise Exception("Input vertical thickness hz !")
     if self.hMap is None:
         self.invert_height = False
     else:
         self.invert_height = True
Exemplo n.º 10
0
    def __init__(self, **kwargs):
        # set keyword arguments
        Utils.setKwargs(self, **kwargs)

        # if the working directory does not exsist, create it
        if not os.path.isdir(self.directory):
            os.mkdir(self.directory)

        # hook up the properties classes
        if getattr(self.meshGenerator, 'modelParameters', None) is None:
            self.meshGenerator.modelParameters = self.modelParameters

        if getattr(self, 'src', None) is not None and self.srcList is None:
            self.src.modelParameters = self.modelParameters
            self.src.meshGenerator = self.meshGenerator

        if getattr(self, 'src', None) is not None:
            self.src.physics = self.physics
        elif getattr(self, 'srcList', None) is not None:
            for src in self.srcList.sources:
                src.physics = self.physics
Exemplo n.º 11
0
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _haverkamp_theta(mesh),
                            _haverkamp_k(mesh))
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 12
0
 def __init__(self, mesh, **kwargs):
     BaseFDEMProblem.__init__(self, mesh, **kwargs)
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 13
0
 def __init__(self, **kwargs):
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 14
0
 def __init__(self, mesh, **kwargs):
     BaseFDEMProblem.__init__(self, mesh, **kwargs)
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 15
0
 def __init__(self, filename=None, **kwargs):
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 16
0
 def __init__(self, survey, **kwargs):
     assert survey.ispaired, 'The survey must be paired to a problem.'
     if isinstance(survey, Survey.BaseSurvey):
         self.survey = survey
         self.prob   = survey.prob
     Utils.setKwargs(self,**kwargs)
Exemplo n.º 17
0
 def __init__(self, **kwargs):
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 18
0
 def __init__(self, mesh, **kwargs):
     NonLinearMap.__init__(self, mesh)
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 19
0
 def __init__(self, offTime=0., hasInitialFields=False, **kwargs):
     Utils.setKwargs(self, **kwargs)
     self.offTime = offTime
     self.hasInitialFields = hasInitialFields
Exemplo n.º 20
0
 def __init__(self, **kwargs):
     super(Forward, self).__init__()
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 21
0
 def __init__(self, **kwargs):
     super(Forward, self).__init__()
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 22
0
 def __init__(self, **kwargs):
     Utils.setKwargs(self, **kwargs)
     assert self.cp.src_a[1] == self.cp.src_b[1], (
         'non y-axis aligned sources have not been implemented'
     )
Exemplo n.º 23
0
 def __init__(self, time, locs, **kwargs):
     self.time = time
     self.locs = np.atleast_2d(locs)
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 24
0
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _vangenuchten_theta(mesh),
                            _vangenuchten_k(mesh))
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 25
0
 def __init__(self, survey, **kwargs):
     assert survey.ispaired, 'The survey must be paired to a problem.'
     if isinstance(survey, Survey.BaseSurvey):
         self.survey = survey
         self.prob = survey.prob
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 26
0
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _haverkamp_theta(mesh),
                            _haverkamp_k(mesh))
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 27
0
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _vangenuchten_theta(mesh),
                            _vangenuchten_k(mesh))
     Utils.setKwargs(self, **kwargs)
Exemplo n.º 28
0
 def __init__(self, offTime=0., hasInitialFields=False, **kwargs):
     Utils.setKwargs(self, **kwargs)
     self.offTime = offTime
     self.hasInitialFields = hasInitialFields
Exemplo n.º 29
0
 def __init__(self, mesh, **kwargs):
     NonLinearMap.__init__(self, mesh)
     Utils.setKwargs(self, **kwargs)