你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Improved syntax
这个提交包含在:
@@ -75,7 +75,7 @@ for i, model in enumerate(testmodels):
|
|||||||
|
|
||||||
# Run model
|
# Run model
|
||||||
file = basepath / model / model
|
file = basepath / model / model
|
||||||
gprMax.run(inputfile=file.with_suffix(".in"), gpu=None)
|
gprMax.run(inputfile=file.with_suffix(".in"), gpu=None, opencl=None)
|
||||||
|
|
||||||
# Special case for analytical comparison
|
# Special case for analytical comparison
|
||||||
if model == "hertzian_dipole_fs_analytical":
|
if model == "hertzian_dipole_fs_analytical":
|
||||||
@@ -111,6 +111,7 @@ for i, model in enumerate(testmodels):
|
|||||||
dataref = hertzian_dipole_fs(
|
dataref = hertzian_dipole_fs(
|
||||||
filetest.attrs["Iterations"], filetest.attrs["dt"], filetest.attrs["dx_dy_dz"], rxposrelative
|
filetest.attrs["Iterations"], filetest.attrs["dt"], filetest.attrs["dx_dy_dz"], rxposrelative
|
||||||
)
|
)
|
||||||
|
filetest.close()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Get output for model and reference files
|
# Get output for model and reference files
|
||||||
@@ -129,14 +130,14 @@ for i, model in enumerate(testmodels):
|
|||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
# Check that type of float used to store fields matches
|
# Check that type of float used to store fields matches
|
||||||
if filetest[path + outputstest[0]].dtype != fileref[path + outputsref[0]].dtype:
|
|
||||||
logger.warning(
|
|
||||||
f"Type of floating point number in test model "
|
|
||||||
f"({filetest[path + outputstest[0]].dtype}) does not "
|
|
||||||
f"match type in reference solution ({fileref[path + outputsref[0]].dtype})\n"
|
|
||||||
)
|
|
||||||
float_or_doubleref = fileref[path + outputsref[0]].dtype
|
float_or_doubleref = fileref[path + outputsref[0]].dtype
|
||||||
float_or_doubletest = filetest[path + outputstest[0]].dtype
|
float_or_doubletest = filetest[path + outputstest[0]].dtype
|
||||||
|
if float_or_doubleref != float_or_doubletest:
|
||||||
|
logger.warning(
|
||||||
|
f"Type of floating point number in test model "
|
||||||
|
f"({float_or_doubletest}) does not "
|
||||||
|
f"match type in reference solution ({float_or_doubleref})\n"
|
||||||
|
)
|
||||||
|
|
||||||
# Arrays for storing time
|
# Arrays for storing time
|
||||||
timeref = np.zeros((fileref.attrs["Iterations"]), dtype=float_or_doubleref)
|
timeref = np.zeros((fileref.attrs["Iterations"]), dtype=float_or_doubleref)
|
||||||
@@ -161,7 +162,7 @@ for i, model in enumerate(testmodels):
|
|||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
fileref.close()
|
fileref.close()
|
||||||
filetest.close()
|
filetest.close()
|
||||||
|
|
||||||
# Diffs
|
# Diffs
|
||||||
datadiffs = np.zeros(datatest.shape, dtype=np.float64)
|
datadiffs = np.zeros(datatest.shape, dtype=np.float64)
|
||||||
|
在新工单中引用
屏蔽一个用户