你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 04:26:52 +08:00
autopep8 code cleanups.
这个提交包含在:
@@ -41,9 +41,9 @@ ccomplextype = 'pycuda::complex<float>'
|
||||
|
||||
# Double precision
|
||||
# For numpy arrays
|
||||
#floattype = np.float64
|
||||
#complextype = np.complex128
|
||||
# floattype = np.float64
|
||||
# complextype = np.complex128
|
||||
|
||||
# For C (CUDA) arrays
|
||||
#cfloattype = 'double'
|
||||
#ccomplextype = 'pycuda::complex<double>'
|
||||
# cfloattype = 'double'
|
||||
# ccomplextype = 'pycuda::complex<double>'
|
||||
|
@@ -269,7 +269,7 @@ def process_multicmds(multicmds, G):
|
||||
m.start = 0
|
||||
m.stop = G.timewindow
|
||||
startstop = ' '
|
||||
|
||||
|
||||
m.calculate_waveform_values(G)
|
||||
|
||||
if G.messages:
|
||||
@@ -334,7 +334,7 @@ def process_multicmds(multicmds, G):
|
||||
t.start = 0
|
||||
t.stop = G.timewindow
|
||||
startstop = ' '
|
||||
|
||||
|
||||
t.calculate_waveform_values(G)
|
||||
t.calculate_incident_V_I(G)
|
||||
|
||||
|
@@ -284,7 +284,7 @@ def solve_cpu(currentmodelrun, numbermodelruns, G):
|
||||
pbar = tqdm(total=snapiters, leave=False, unit='byte', unit_scale=True, desc=' Writing snapshot file {} of {}, {}'.format(i + 1, len(G.snapshots), os.path.split(snap.filename)[1]), ncols=get_terminal_width() - 1, file=sys.stdout, disable=G.tqdmdisable)
|
||||
snap.write_vtk_imagedata(G.Ex, G.Ey, G.Ez, G.Hx, G.Hy, G.Hz, G, pbar)
|
||||
pbar.close()
|
||||
|
||||
|
||||
# Update magnetic field components
|
||||
update_magnetic(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsH, G.ID, G.Ex, G.Ey, G.Ez, G.Hx, G.Hy, G.Hz)
|
||||
|
||||
|
@@ -85,11 +85,11 @@ def open_path_file(path_or_file):
|
||||
|
||||
Args:
|
||||
path_or_file: path as a string or a file object.
|
||||
|
||||
|
||||
Returns:
|
||||
f (object): File object.
|
||||
"""
|
||||
|
||||
|
||||
if isinstance(path_or_file, str):
|
||||
f = file_to_close = open(path_or_file, 'r')
|
||||
else:
|
||||
@@ -212,21 +212,21 @@ def memory_usage(G):
|
||||
|
||||
Args:
|
||||
G (class): Grid class instance - holds essential parameters describing the model.
|
||||
|
||||
|
||||
Returns:
|
||||
memestimate (int): Estimate of required memory in bytes
|
||||
"""
|
||||
|
||||
stdoverhead = 50e6
|
||||
|
||||
|
||||
# 6 x field arrays + 6 x ID arrays
|
||||
fieldarrays = (6 + 6) * (G.nx + 1) * (G.ny + 1) * (G.nz + 1) * np.dtype(floattype).itemsize
|
||||
|
||||
|
||||
solidarray = G.nx * G.ny * G.nz * np.dtype(np.uint32).itemsize
|
||||
|
||||
|
||||
# 12 x rigidE array components + 6 x rigidH array components
|
||||
rigidarrays = (12 + 6) * G.nx * G.ny * G.nz * np.dtype(np.int8).itemsize
|
||||
|
||||
|
||||
pmlarrays = 0
|
||||
for (k, v) in G.pmlthickness.items():
|
||||
if v > 0:
|
||||
|
在新工单中引用
屏蔽一个用户