Ejemplo n.º 1
0
    def setUpClass(self):

        print('\n------- Testing Primary Secondary Source HJ -> EB --------\n')
        # receivers
        self.rxlist = []
        for rxtype in ['b', 'e']:
            rx = getattr(FDEM.Rx, 'Point_{}'.format(rxtype))
            for orientation in ['x', 'y', 'z']:
                for comp in ['real', 'imag']:
                    self.rxlist.append(rx(rx_locs, component=comp,
                                       orientation=orientation))

        # primary
        self.primaryProblem = FDEM.Problem3D_j(meshp, sigmaMap=primaryMapping)
        self.primaryProblem.solver = Solver
        s_e = np.zeros(meshp.nF)
        inds = meshp.nFx + Utils.closestPoints(meshp, src_loc, gridLoc='Fz')
        s_e[inds] = 1./csz
        primarySrc = FDEM.Src.RawVec_e(
            self.rxlist, freq=freq, s_e=s_e/meshp.area
        )
        self.primarySurvey = FDEM.Survey([primarySrc])

        # Secondary Problem
        self.secondaryProblem = FDEM.Problem3D_e(meshs, sigmaMap=mapping)
        self.secondaryProblem.Solver = Solver
        self.secondarySrc = FDEM.Src.PrimSecMappedSigma(
                self.rxlist, freq, self.primaryProblem,
                self.primarySurvey, primaryMap2Meshs
        )
        self.secondarySurvey = FDEM.Survey([self.secondarySrc])
        self.secondaryProblem.pair(self.secondarySurvey)

        # Full 3D problem to compare with
        self.problem3D = FDEM.Problem3D_e(meshs, sigmaMap=mapping)
        self.problem3D.Solver = Solver
        s_e3D = np.zeros(meshs.nE)
        inds = (meshs.nEx + meshs.nEy +
                Utils.closestPoints(meshs, src_loc, gridLoc='Ez'))
        s_e3D[inds] = [1./(len(inds))] * len(inds)
        self.problem3D.model = model
        src3D = FDEM.Src.RawVec_e(self.rxlist, freq=freq, s_e=s_e3D)
        self.survey3D = FDEM.Survey([src3D])
        self.problem3D.pair(self.survey3D)

        # solve and store fields
        print('   solving primary - secondary')
        self.fields_primsec = self.secondaryProblem.fields(model)
        print('     ... done')

        self.fields_primsec = self.secondaryProblem.fields(model)
        print('   solving 3D')
        self.fields_3D = self.problem3D.fields(model)
        print('     ... done')

        return None
Ejemplo n.º 2
0
    def setUp(self):
        cs = 10.
        ncx, ncy, ncz = 30., 30., 30.
        npad = 10.
        hx = [(cs, npad, -1.5), (cs, ncx), (cs, npad, 1.5)]
        hy = [(cs, npad, -1.5), (cs, ncy), (cs, npad, 1.5)]
        hz = [(cs, npad, -1.5), (cs, ncz), (cs, npad, 1.5)]
        self.mesh = Mesh.TensorMesh([hx, hy, hz], 'CCC')
        mapping = Maps.ExpMap(self.mesh)

        self.freq = 1.

        self.prob_e = FDEM.Problem3D_e(self.mesh, mapping=mapping)
        self.prob_b = FDEM.Problem3D_b(self.mesh, mapping=mapping)
        self.prob_h = FDEM.Problem3D_h(self.mesh, mapping=mapping)
        self.prob_j = FDEM.Problem3D_j(self.mesh, mapping=mapping)

        loc = np.r_[0., 0., 0.]
        self.loc = Utils.mkvc(
            self.mesh.gridCC[Utils.closestPoints(self.mesh, loc, 'CC'), :])