break out WennerArray into a few pieces

This commit is contained in:
rowanc1
2014-07-12 12:57:18 -05:00
parent 1af495b910
commit f23eb17d78
+23 -11
View File
@@ -3,18 +3,10 @@ import simpegDC as DC
import matplotlib.pyplot as plt
def example(cs=2.5, nElecs=10, plotIt=False):
mesh = Mesh.TensorMesh([
[(cs,10, -1.3),(cs,200/cs),(cs,10, 1.3)],
[(cs,3, -1.3),(cs,3,1.3)],
# [(cs,5, -1.3),(cs,10)]
],'CN')
if plotIt:
mesh.plotGrid(showIt=True)
def getTxList(nElecs, aSpacing, in2D=False, plotIt=False):
elocs = np.arange(0,aSpacing*nElecs,aSpacing)
space = 1
elocs = np.linspace(-100, 100, nElecs)
WENNER = np.zeros((0,),dtype=int)
for ii in range(nElecs):
for jj in range(nElecs):
@@ -33,14 +25,34 @@ def example(cs=2.5, nElecs=10, plotIt=False):
# Create transmitters and receivers
i = 0
getLoc = lambda ii, abmn: np.r_[elocs[WENNER[ii,abmn]],0]
if in2D:
getLoc = lambda ii, abmn: np.r_[elocs[WENNER[ii,abmn]],0]
else:
getLoc = lambda ii, abmn: np.r_[elocs[WENNER[ii,abmn]],0, 0]
txList = []
for i in range(WENNER.shape[0]):
rx = DC.DipoleRx(getLoc(i,1),getLoc(i,2))
tx = DC.DipoleTx(getLoc(i,0),getLoc(i,3), [rx])
txList += [tx]
return txList
def example(aSpacing=2.5, nElecs=10, plotIt=False):
surveySize = nElecs*aSpacing - aSpacing
cs = surveySize/nElecs/4
mesh = Mesh.TensorMesh([
[(cs,10, -1.3),(cs,surveySize/cs),(cs,10, 1.3)],
[(cs,3, -1.3),(cs,3,1.3)],
# [(cs,5, -1.3),(cs,10)]
],'CN')
if plotIt:
mesh.plotGrid(showIt=True)
txList = getTxList(nElecs, aSpacing, in2D=True)
survey = DC.SurveyDC(txList)
problem = DC.ProblemDC(mesh)
problem.pair(survey)