你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Ran pre-commit run --all-files to modify all the files correctly.
这个提交包含在:
@@ -24,6 +24,7 @@ import numpy as np
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def diff_output_files(filename1, filename2):
|
||||
"""Calculates differences between two output files.
|
||||
|
||||
@@ -56,7 +57,7 @@ def diff_output_files(filename1, filename2):
|
||||
f"Type of floating point number in test model ({file1[path + outputs1[0]].dtype}) "
|
||||
f"does not match type in reference solution ({file2[path + outputs2[0]].dtype})\n"
|
||||
)
|
||||
|
||||
|
||||
# Arrays for storing time
|
||||
time1 = np.zeros((file1.attrs["Iterations"]), dtype=floattype1)
|
||||
time1 = np.linspace(0, (file1.attrs["Iterations"] - 1), num=file1.attrs["Iterations"])
|
||||
|
@@ -50,8 +50,9 @@ fig, ax = plt.subplots(
|
||||
)
|
||||
|
||||
for x, model in enumerate(testmodels):
|
||||
time, datadiffs = diff_output_files(fn.parent.joinpath(basename + "_ref.h5"),
|
||||
fn.parent.joinpath(basename + str(x + 1) + ".h5"))
|
||||
time, datadiffs = diff_output_files(
|
||||
fn.parent.joinpath(basename + "_ref.h5"), fn.parent.joinpath(basename + str(x + 1) + ".h5")
|
||||
)
|
||||
|
||||
# Print maximum error value
|
||||
start = 210
|
||||
|
@@ -56,7 +56,7 @@ for x, PMLID in enumerate(PMLIDs):
|
||||
fig, ax = plt.subplots(figsize=(20, 10), facecolor="w", edgecolor="w")
|
||||
ax.remove()
|
||||
fig.suptitle(f"{PMLID}")
|
||||
|
||||
|
||||
outputs = ["Ex", "Ey", "Ez", "Hx", "Hy", "Hz"]
|
||||
for i, output in enumerate(outputs):
|
||||
if i < 3:
|
||||
@@ -74,9 +74,7 @@ for x, PMLID in enumerate(PMLIDs):
|
||||
ax.set_ylabel(f"{output} error [dB]")
|
||||
|
||||
# Save a PDF/PNG of the figure
|
||||
fig.savefig(basename + "_diffs_" + PMLID + ".pdf", dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)
|
||||
fig.savefig(basename + "_diffs_" + PMLID + ".pdf", dpi=None, format="pdf", bbox_inches="tight", pad_inches=0.1)
|
||||
# fig.savefig(basename + "_diffs_" + PMLID + ".png", dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)
|
||||
|
||||
plt.show()
|
||||
|
||||
|
||||
|
@@ -138,7 +138,7 @@ for i, model in enumerate(testmodels):
|
||||
f"({float_or_doubletest}) does not "
|
||||
f"match type in reference solution ({float_or_doubleref})\n"
|
||||
)
|
||||
|
||||
|
||||
# Arrays for storing time
|
||||
timeref = np.zeros((fileref.attrs["Iterations"]), dtype=float_or_doubleref)
|
||||
timeref = (
|
||||
|
在新工单中引用
屏蔽一个用户