你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Improved readability when handling --geometry-only versus full simulation decision.
这个提交包含在:
@@ -227,9 +227,12 @@ def run_model(args, currentmodelrun, numbermodelruns, inputfile, usernamespace):
|
|||||||
geometryobject.write_hdf5(G, pbar)
|
geometryobject.write_hdf5(G, pbar)
|
||||||
pbar.close()
|
pbar.close()
|
||||||
|
|
||||||
# Run simulation (if not only looking ar geometry information)
|
# If only writing geometry information
|
||||||
if not args.geometry_only:
|
if args.geometry_only:
|
||||||
|
tsolve = 0
|
||||||
|
|
||||||
|
# Run simulation
|
||||||
|
else:
|
||||||
# Prepare any snapshot files
|
# Prepare any snapshot files
|
||||||
for snapshot in G.snapshots:
|
for snapshot in G.snapshots:
|
||||||
snapshot.prepare_vtk_imagedata(currentmodelrun, numbermodelruns, G)
|
snapshot.prepare_vtk_imagedata(currentmodelrun, numbermodelruns, G)
|
||||||
@@ -252,11 +255,11 @@ def run_model(args, currentmodelrun, numbermodelruns, inputfile, usernamespace):
|
|||||||
print('Memory (RAM) used: ~{}'.format(human_size(p.memory_info().rss)))
|
print('Memory (RAM) used: ~{}'.format(human_size(p.memory_info().rss)))
|
||||||
print('Solving time [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=tsolve)))
|
print('Solving time [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=tsolve)))
|
||||||
|
|
||||||
return tsolve
|
# If geometry information to be reused between model runs then FDTDGrid class instance must be global so that it persists
|
||||||
|
if not args.geometry_fixed:
|
||||||
|
del G
|
||||||
|
|
||||||
# If geometry information to be reused between model runs then FDTDGrid class instance must be global so that it persists
|
return tsolve
|
||||||
if not args.geometry_fixed:
|
|
||||||
del G
|
|
||||||
|
|
||||||
|
|
||||||
def solve_cpu(currentmodelrun, numbermodelruns, G):
|
def solve_cpu(currentmodelrun, numbermodelruns, G):
|
||||||
|
在新工单中引用
屏蔽一个用户