Пример #1
0
sys.stdout.write('Incident field computed in ' + str(deltaT) + ' seconds\n')

# Slicing Ein
figNum = 1
fieldName = 'E^{in}'
SliceX = round(NX / 2.)
SliceY = round(NY / 2.)
SliceZ = round(NZ / 2.)
vis.sliceFieldArr(sci.real(Ein), NX, NY, NZ, SliceX, SliceY, SliceZ, figNum,
                  fieldName)

#******************************************************************************#
# Computing G tensor
#******************************************************************************#
t0 = time.clock()
GF = green.greentensor(Freq, EpsRelB, Cell, NX, NY, NZ)
t1 = time.clock()
# saving GF in a *.mat file
#outFile = myDir+'/Output/GreenTensor' # file name
#scio.savemat(outFile, {'GF':GF})
deltaT = t1 - t0
print('GF tensor computed in', deltaT, 'seconds')

#******************************************************************************#
# Constructing an object
#******************************************************************************#
# setting all permittivity to EpsRelB
EpsArr = sci.ones((NX, NY, NZ), complex)  # array with all elements 1+0j
EpsArr = EpsArr * EpsRelB

# adding a homogeneous brick to the domain (repeat if necessary)
Пример #2
0
deltaT = t1-t0
sys.stdout.write('Incident field computed in '+str(deltaT)+' seconds\n')

# Slicing Ein
figNum = 1
fieldName = 'E^{in}'
SliceX = round(NX/2.)
SliceY = round(NY/2.)
SliceZ = round(NZ/2.)
vis.sliceFieldArr(sci.real(Ein),NX,NY,NZ,SliceX,SliceY,SliceZ,figNum,fieldName)

#******************************************************************************#
# Computing G tensor
#******************************************************************************#
t0 = time.clock()
GF = green.greentensor(Freq,EpsRelB,Cell,NX,NY,NZ)
t1 = time.clock()
# saving GF in a *.mat file
#outFile = myDir+'/Output/GreenTensor' # file name
#scio.savemat(outFile, {'GF':GF})
deltaT = t1-t0
print 'GF tensor computed in',deltaT, 'seconds'

#******************************************************************************#
# Constructing an object
#******************************************************************************#
# setting all permittivity to EpsRelB
EpsArr = sci.ones((NX,NY,NZ),complex) # array with all elements 1+0j
EpsArr = EpsArr*EpsRelB

# adding a homogeneous brick to the domain (repeat if necessary)