mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-09 17:31:42 +08:00
- added capability for adding a mu model
- added variable mu in the FDEM testing - also added capability to add a small random vector to sigma and mu for testing
This commit is contained in:
@@ -2,9 +2,12 @@ import unittest
|
||||
from SimPEG import *
|
||||
import simpegEM as EM
|
||||
import sys
|
||||
from scipy.constants import mu_0
|
||||
|
||||
TOL = 1e-4
|
||||
CONDUCTIVITY = 1e3
|
||||
MU = mu_0
|
||||
addrandoms = True
|
||||
|
||||
def getProblem(fdemType, comp):
|
||||
cs = 5.
|
||||
@@ -44,7 +47,14 @@ def adjointTest(fdemType, comp):
|
||||
prb = getProblem(fdemType, comp)
|
||||
print 'Adjoint %s formulation - %s' % (fdemType, comp)
|
||||
|
||||
m = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
|
||||
m = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
|
||||
mu = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
|
||||
|
||||
if addrandoms is True:
|
||||
m = m + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
|
||||
mu = mu + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
|
||||
|
||||
prb.mu = mu
|
||||
survey = prb.survey
|
||||
|
||||
v = np.random.rand(survey.nD)
|
||||
@@ -61,6 +71,11 @@ def derivTest(fdemType, comp):
|
||||
prb = getProblem(fdemType, comp)
|
||||
print '%s formulation - %s' % (fdemType, comp)
|
||||
x0 = np.log(np.ones(prb.mesh.nC)*CONDUCTIVITY)
|
||||
|
||||
if addrandoms is True:
|
||||
x0 = x0 + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
|
||||
mu = mu + np.random.randn(prb.mesh.nC)*CONDUCTIVITY*1e-3
|
||||
|
||||
survey = prb.survey
|
||||
def fun(x):
|
||||
return survey.dpred(x), lambda x: prb.Jvec(x0, x)
|
||||
|
||||
Reference in New Issue
Block a user