你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 12:36:51 +08:00
Updated txstep variables to use srcstep name.
这个提交包含在:
@@ -38,7 +38,7 @@ def prepare_output_file(outputfile, G):
|
||||
f.attrs['Iterations'] = G.iterations
|
||||
f.attrs['dx, dy, dz'] = (G.dx, G.dy, G.dz)
|
||||
f.attrs['dt'] = G.dt
|
||||
f.attrs['txsteps'] = (G.txstepx, G.txstepy, G.txstepz)
|
||||
f.attrs['srcsteps'] = (G.srcstepx, G.srcstepy, G.srcstepz)
|
||||
f.attrs['rxsteps'] = (G.rxstepx, G.rxstepy, G.rxstepz)
|
||||
f.attrs['ntx'] = len(G.voltagesources) + len(G.hertziandipoles) + len(G.magneticdipoles)
|
||||
f.attrs['nrx'] = len(G.rxs)
|
||||
|
@@ -287,11 +287,11 @@ def run_model(args, modelrun, numbermodelruns, inputfile, inputdirectory):
|
||||
f = prepare_output_file(outputfile, G)
|
||||
|
||||
# Adjust position of sources and receivers if required
|
||||
if G.txstepx > 0 or G.txstepy > 0 or G.txstepz > 0:
|
||||
if G.srcstepx > 0 or G.srcstepy > 0 or G.srcstepz > 0:
|
||||
for source in itertools.chain(G.hertziandipoles, G.magneticdipoles, G.voltagesources):
|
||||
source.positionx += (modelrun - 1) * G.txstepx
|
||||
source.positiony += (modelrun - 1) * G.txstepy
|
||||
source.positionz += (modelrun - 1) * G.txstepz
|
||||
source.positionx += (modelrun - 1) * G.srcstepx
|
||||
source.positiony += (modelrun - 1) * G.srcstepy
|
||||
source.positionz += (modelrun - 1) * G.srcstepz
|
||||
if G.rxstepx > 0 or G.rxstepy > 0 or G.rxstepz > 0:
|
||||
for receiver in G.rxs:
|
||||
receiver.positionx += (modelrun - 1) * G.rxstepx
|
||||
|
@@ -52,9 +52,9 @@ class FDTDGrid():
|
||||
self.hertziandipoles = []
|
||||
self.magneticdipoles = []
|
||||
self.txs = [] # Only used for converting old output files to HDF5 format
|
||||
self.txstepx = 0
|
||||
self.txstepy = 0
|
||||
self.txstepz = 0
|
||||
self.srcstepx = 0
|
||||
self.srcstepy = 0
|
||||
self.srcstepz = 0
|
||||
self.rxstepx = 0
|
||||
self.rxstepy = 0
|
||||
self.rxstepz = 0
|
||||
|
@@ -205,11 +205,11 @@ def process_singlecmds(singlecmds, multicmds, G):
|
||||
tmp = singlecmds[cmd].split()
|
||||
if len(tmp) != 3:
|
||||
raise CmdInputError(cmd + ' requires exactly three parameters')
|
||||
G.txstepx = rvalue(float(tmp[0])/G.dx)
|
||||
G.txstepy = rvalue(float(tmp[1])/G.dy)
|
||||
G.txstepz = rvalue(float(tmp[2])/G.dz)
|
||||
G.srcstepx = rvalue(float(tmp[0])/G.dx)
|
||||
G.srcstepy = rvalue(float(tmp[1])/G.dy)
|
||||
G.srcstepz = rvalue(float(tmp[2])/G.dz)
|
||||
if G.messages:
|
||||
print('All sources will step {:.3f}m, {:.3f}m, {:.3f}m for each model run.'.format(G.txstepx * G.dx, G.txstepy * G.dy, G.txstepz * G.dz))
|
||||
print('All sources will step {:.3f}m, {:.3f}m, {:.3f}m for each model run.'.format(G.srcstepx * G.dx, G.srcstepy * G.dy, G.srcstepz * G.dz))
|
||||
|
||||
|
||||
# rx_steps
|
||||
|
@@ -56,9 +56,9 @@ with open(outputfile, 'rb') as f:
|
||||
G.dz, = struct.unpack('f', f.read(4))
|
||||
G.dt, = struct.unpack('f', f.read(4))
|
||||
nsteps, = struct.unpack('h', f.read(2))
|
||||
G.txstepx, = struct.unpack('h', f.read(2))
|
||||
G.txstepy, = struct.unpack('h', f.read(2))
|
||||
G.txstepz, = struct.unpack('h', f.read(2))
|
||||
G.srcstepx, = struct.unpack('h', f.read(2))
|
||||
G.srcstepy, = struct.unpack('h', f.read(2))
|
||||
G.srcstepz, = struct.unpack('h', f.read(2))
|
||||
G.rxstepx, = struct.unpack('h', f.read(2))
|
||||
G.rxstepy, = struct.unpack('h', f.read(2))
|
||||
G.rxstepz, = struct.unpack('h', f.read(2))
|
||||
|
在新工单中引用
屏蔽一个用户