你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Various style cleanups.
这个提交包含在:
@@ -153,7 +153,7 @@ class GeometryView(object):
|
|||||||
vtk_numpoints = (self.nx + 1) * (self.ny + 1) * (self.nz + 1)
|
vtk_numpoints = (self.nx + 1) * (self.ny + 1) * (self.nz + 1)
|
||||||
vtk_numpoint_components = 3
|
vtk_numpoint_components = 3
|
||||||
vtk_numlines = 2 * self.nx * self.ny + 2 * self.ny * self.nz + 2 * self.nx * self.nz + 3 * self.nx * self.ny * self.nz + self.nx + self.ny + self.nz
|
vtk_numlines = 2 * self.nx * self.ny + 2 * self.ny * self.nz + 2 * self.nx * self.nz + 3 * self.nx * self.ny * self.nz + self.nx + self.ny + self.nz
|
||||||
vtk_numline_components = 2;
|
vtk_numline_components = 2
|
||||||
|
|
||||||
vtk_connectivity_offset = round_value((vtk_numpoints * vtk_numpoint_components * np.dtype(np.float32).itemsize) + np.dtype(np.uint32).itemsize)
|
vtk_connectivity_offset = round_value((vtk_numpoints * vtk_numpoint_components * np.dtype(np.float32).itemsize) + np.dtype(np.uint32).itemsize)
|
||||||
vtk_offsets_offset = round_value(vtk_connectivity_offset + (vtk_numlines * vtk_numline_components * np.dtype(np.uint32).itemsize) + np.dtype(np.uint32).itemsize)
|
vtk_offsets_offset = round_value(vtk_connectivity_offset + (vtk_numlines * vtk_numline_components * np.dtype(np.uint32).itemsize) + np.dtype(np.uint32).itemsize)
|
||||||
|
@@ -61,7 +61,8 @@ def command(cmd, *parameters):
|
|||||||
s = '#{}: {}'.format(cmd, " ".join(filtered_list))
|
s = '#{}: {}'.format(cmd, " ".join(filtered_list))
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
# append info about cmd and parameters to the exception:
|
# append info about cmd and parameters to the exception:
|
||||||
if not e.args: e.args=('', )
|
if not e.args:
|
||||||
|
e.args=('', )
|
||||||
additional_info = "Creating cmd = #{} with parameters {} -> {} failed".format(cmd, parameters, filtered_list)
|
additional_info = "Creating cmd = #{} with parameters {} -> {} failed".format(cmd, parameters, filtered_list)
|
||||||
e.args = e.args + (additional_info,)
|
e.args = e.args + (additional_info,)
|
||||||
raise e
|
raise e
|
||||||
@@ -163,7 +164,7 @@ def snapshot(xs, ys, zs, xf, yf, zf, dx, dy, dz, time, filename):
|
|||||||
f = Coordinate(xf, yf, zf)
|
f = Coordinate(xf, yf, zf)
|
||||||
d = Coordinate(dx, dy, dz)
|
d = Coordinate(dx, dy, dz)
|
||||||
|
|
||||||
if '.' in str(time) or 'e' in str(time):
|
if '.' in str(time) or 'e' in str(time):
|
||||||
time = '{:g}'.format(float(time))
|
time = '{:g}'.format(float(time))
|
||||||
else:
|
else:
|
||||||
time = '{:d}'.format(int(time))
|
time = '{:d}'.format(int(time))
|
||||||
|
@@ -609,7 +609,7 @@ def process_multicmds(multicmds, G):
|
|||||||
material.average = False
|
material.average = False
|
||||||
for pole in range(1, 2 * poles, 2):
|
for pole in range(1, 2 * poles, 2):
|
||||||
if float(tmp[pole]) > 0 and float(tmp[pole + 1]) > G.dt:
|
if float(tmp[pole]) > 0 and float(tmp[pole + 1]) > G.dt:
|
||||||
material.tau.append(float(tmp[pole ]))
|
material.tau.append(float(tmp[pole]))
|
||||||
material.alpha.append(float(tmp[pole + 1]))
|
material.alpha.append(float(tmp[pole + 1]))
|
||||||
else:
|
else:
|
||||||
raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires positive values for the frequencies, and associated times that are greater than the time step for the model.')
|
raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires positive values for the frequencies, and associated times that are greater than the time step for the model.')
|
||||||
|
@@ -73,7 +73,7 @@ def update_progress(progress):
|
|||||||
# Modify this to change the length of the progress bar
|
# Modify this to change the length of the progress bar
|
||||||
barLength = 50
|
barLength = 50
|
||||||
block = round_value(barLength * progress)
|
block = round_value(barLength * progress)
|
||||||
text = '\r|{}| {:2.1f}%'.format( '#' * block + '-' * (barLength - block), progress * 100)
|
text = '\r|{}| {:2.1f}%'.format('#' * block + '-' * (barLength - block), progress * 100)
|
||||||
sys.stdout.write(text)
|
sys.stdout.write(text)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
@@ -367,6 +367,6 @@ def create_xdmf_markup(options):
|
|||||||
|
|
||||||
# Serialize elements
|
# Serialize elements
|
||||||
xml_doc = etree.tostring(xdmf_el, xml_declaration=True,
|
xml_doc = etree.tostring(xdmf_el, xml_declaration=True,
|
||||||
encoding="utf-8", doctype=doc_type, pretty_print=True)
|
encoding="utf-8", doctype=doc_type, pretty_print=True)
|
||||||
|
|
||||||
return xml_doc
|
return xml_doc
|
||||||
|
在新工单中引用
屏蔽一个用户