コード例 #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)
コード例 #2
0
ファイル: SrcFDEM.py プロジェクト: simpeg/simpeg
    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)
コード例 #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()
コード例 #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')
コード例 #5
0
ファイル: run.py プロジェクト: fwkoch/casingSimulations
    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
コード例 #6
0
ファイル: GlobalEM1D.py プロジェクト: ligang0309/simpegEM1D
 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 !")
コード例 #7
0
ファイル: Inversion.py プロジェクト: LongyanU/simpeg
    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)
コード例 #8
0
ファイル: Inversion.py プロジェクト: gitter-badger/simpeg
    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)
コード例 #9
0
ファイル: GlobalEM1D.py プロジェクト: simpeg/simpegEM1D
 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
コード例 #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
コード例 #11
0
ファイル: Empirical.py プロジェクト: dakentod/simpeg
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _haverkamp_theta(mesh),
                            _haverkamp_k(mesh))
     Utils.setKwargs(self, **kwargs)
コード例 #12
0
ファイル: ProblemNSEM.py プロジェクト: simpeg/simpeg
 def __init__(self, mesh, **kwargs):
     BaseFDEMProblem.__init__(self, mesh, **kwargs)
     Utils.setKwargs(self, **kwargs)
コード例 #13
0
 def __init__(self, **kwargs):
     Utils.setKwargs(self, **kwargs)
コード例 #14
0
 def __init__(self, mesh, **kwargs):
     BaseFDEMProblem.__init__(self, mesh, **kwargs)
     Utils.setKwargs(self, **kwargs)
コード例 #15
0
ファイル: model.py プロジェクト: WIEQLI/casingSimulations
 def __init__(self, filename=None, **kwargs):
     Utils.setKwargs(self, **kwargs)
コード例 #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)
コード例 #17
0
ファイル: SrcTDEM.py プロジェクト: jsc1129/simpeg
 def __init__(self, **kwargs):
     Utils.setKwargs(self, **kwargs)
コード例 #18
0
ファイル: Empirical.py プロジェクト: dakentod/simpeg
 def __init__(self, mesh, **kwargs):
     NonLinearMap.__init__(self, mesh)
     Utils.setKwargs(self, **kwargs)
コード例 #19
0
 def __init__(self, offTime=0., hasInitialFields=False, **kwargs):
     Utils.setKwargs(self, **kwargs)
     self.offTime = offTime
     self.hasInitialFields = hasInitialFields
コード例 #20
0
 def __init__(self, **kwargs):
     super(Forward, self).__init__()
     Utils.setKwargs(self, **kwargs)
コード例 #21
0
ファイル: Gravity.py プロジェクト: simpeg/simpeg
 def __init__(self, **kwargs):
     super(Forward, self).__init__()
     Utils.setKwargs(self, **kwargs)
コード例 #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'
     )
コード例 #23
0
 def __init__(self, time, locs, **kwargs):
     self.time = time
     self.locs = np.atleast_2d(locs)
     Utils.setKwargs(self, **kwargs)
コード例 #24
0
ファイル: Empirical.py プロジェクト: dakentod/simpeg
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _vangenuchten_theta(mesh),
                            _vangenuchten_k(mesh))
     Utils.setKwargs(self, **kwargs)
コード例 #25
0
ファイル: DataMisfit.py プロジェクト: westamine/simpeg
 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)
コード例 #26
0
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _haverkamp_theta(mesh),
                            _haverkamp_k(mesh))
     Utils.setKwargs(self, **kwargs)
コード例 #27
0
 def __init__(self, mesh, **kwargs):
     RichardsMap.__init__(self, mesh,
                            _vangenuchten_theta(mesh),
                            _vangenuchten_k(mesh))
     Utils.setKwargs(self, **kwargs)
コード例 #28
0
ファイル: SrcTDEM.py プロジェクト: sdevriese/simpeg
 def __init__(self, offTime=0., hasInitialFields=False, **kwargs):
     Utils.setKwargs(self, **kwargs)
     self.offTime = offTime
     self.hasInitialFields = hasInitialFields
コード例 #29
0
 def __init__(self, mesh, **kwargs):
     NonLinearMap.__init__(self, mesh)
     Utils.setKwargs(self, **kwargs)