Merge branch 'devel-reframe' into mpi

这个提交包含在:
Nathan Mannall
2025-03-18 13:31:49 +00:00
当前提交 a32dcb030d
共有 112 个文件被更改,包括 2824 次插入370 次删除

查看文件

@@ -1,4 +1,4 @@
# Copyright (C) 2015-2024: The University of Edinburgh, United Kingdom
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, and John Hartley
#
# This file is part of gprMax.
@@ -164,7 +164,9 @@ def hertzian_dipole_fs(iterations, dt, dxdydz, rx):
tmp = Hy_x / Hy_y
except ZeroDivisionError:
tmp = 0
fields[timestep, 4] = -tmp * (-(Hy_y / (4 * np.pi * Hr_y**3)) * (f_Hy + (tau_Hy * fdot_Hy)))
fields[timestep, 4] = -tmp * (
-(Hy_y / (4 * np.pi * Hr_y**3)) * (f_Hy + (tau_Hy * fdot_Hy))
)
# Hz
fields[timestep, 5] = 0

查看文件

@@ -1,9 +1,8 @@
"""A series of models with different domain sizes used for benchmarking.
The domain is free space with a simple source (Hertzian Dipole) and
receiver at the centre.
The domain is free space with a simple source (Hertzian Dipole) and
receiver at the centre.
"""
import itertools
from pathlib import Path

查看文件

@@ -1,4 +1,4 @@
# Copyright (C) 2015-2024: The University of Edinburgh, United Kingdom
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, and John Hartley
#
# This file is part of gprMax.
@@ -82,7 +82,10 @@ def diff_output_files(filename1, filename2):
for i in range(len(outputs2)):
maxi = np.amax(np.abs(data1[:, i]))
datadiffs[:, i] = np.divide(
np.abs(data2[:, i] - data1[:, i]), maxi, out=np.zeros_like(data1[:, i]), where=maxi != 0
np.abs(data2[:, i] - data1[:, i]),
maxi,
out=np.zeros_like(data1[:, i]),
where=maxi != 0,
) # Replace any division by zero with zero
# Calculate power (ignore warning from taking a log of any zero values)

查看文件

@@ -1,4 +1,4 @@
# Copyright (C) 2015-2024: The University of Edinburgh, United Kingdom
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, and John Hartley
#
# This file is part of gprMax.
@@ -46,12 +46,16 @@ maxerrors = []
testmodels = [basename + "_" + s for s in PMLIDs]
fig, ax = plt.subplots(
subplot_kw=dict(xlabel="Iterations", ylabel="Error [dB]"), figsize=(20, 10), facecolor="w", edgecolor="w"
subplot_kw=dict(xlabel="Iterations", ylabel="Error [dB]"),
figsize=(20, 10),
facecolor="w",
edgecolor="w",
)
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")
fn.parent.joinpath(basename + "_ref.h5"),
fn.parent.joinpath(basename + str(x + 1) + ".h5"),
)
# Print maximum error value
@@ -60,7 +64,14 @@ for x, model in enumerate(testmodels):
logger.info(f"{model}: Max. error {maxerrors[x]}")
# Plot diffs (select column to choose field component, 0-Ex, 1-Ey etc..)
ax.plot(time[start::], datadiffs[start::, 1], color=next(colors), lw=2, ls=next(lines), label=model)
ax.plot(
time[start::],
datadiffs[start::, 1],
color=next(colors),
lw=2,
ls=next(lines),
label=model,
)
ax.set_xticks(np.arange(0, 2200, step=100))
ax.set_xlim([0, 2100])
ax.set_yticks(np.arange(-160, 0, step=20))

查看文件

@@ -22,7 +22,9 @@ time_window = gprMax.TimeWindow(iterations=2100)
tssf = gprMax.TimeStepStabilityFactor(f=0.99)
waveform = gprMax.Waveform(wave_type="gaussiandotnorm", amp=1, freq=9.42e9, id="mypulse")
hertzian_dipole = gprMax.HertzianDipole(polarisation="z", p1=(0.013, 0.013, 0.014), waveform_id="mypulse")
hertzian_dipole = gprMax.HertzianDipole(
polarisation="z", p1=(0.013, 0.013, 0.014), waveform_id="mypulse"
)
rx = gprMax.Rx(p1=(0.038, 0.114, 0.013))
plate = gprMax.Plate(p1=(0.013, 0.013, 0.013), p2=(0.038, 0.113, 0.013), material_id="pec")

查看文件

@@ -22,7 +22,9 @@ time_window = gprMax.TimeWindow(iterations=2100)
tssf = gprMax.TimeStepStabilityFactor(f=0.99)
waveform = gprMax.Waveform(wave_type="gaussiandotnorm", amp=1, freq=9.42e9, id="mypulse")
hertzian_dipole = gprMax.HertzianDipole(polarisation="z", p1=(0.088, 0.088, 0.089), waveform_id="mypulse")
hertzian_dipole = gprMax.HertzianDipole(
polarisation="z", p1=(0.088, 0.088, 0.089), waveform_id="mypulse"
)
rx = gprMax.Rx(p1=(0.113, 0.189, 0.088))
plate = gprMax.Plate(p1=(0.088, 0.088, 0.088), p2=(0.113, 0.188, 0.088), material_id="pec")

查看文件

@@ -1,4 +1,4 @@
# Copyright (C) 2015-2024: The University of Edinburgh, United Kingdom
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, and John Hartley
#
# This file is part of gprMax.
@@ -74,7 +74,13 @@ 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()

查看文件

@@ -18,7 +18,9 @@ dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
time_window = gprMax.TimeWindow(time=3e-9)
waveform = gprMax.Waveform(wave_type="gaussian", amp=1, freq=1e9, id="mypulse")
hertzian_dipole = gprMax.HertzianDipole(polarisation="z", p1=(0.050, 0.050, 0.050), waveform_id="mypulse")
hertzian_dipole = gprMax.HertzianDipole(
polarisation="z", p1=(0.050, 0.050, 0.050), waveform_id="mypulse"
)
rx = gprMax.Rx(p1=(0.070, 0.070, 0.070))
# PML cases

查看文件

@@ -31,7 +31,10 @@ tx_pos = (x / 2, y / 2, z / 2)
# Source excitation and type
wave = gprMax.Waveform(wave_type="gaussian", amp=1, freq=1.5e9, id="mypulse")
tl = gprMax.TransmissionLine(
p1=(tx_pos[0], tx_pos[1], tx_pos[2]), polarisation="x", resistance=50, waveform_id="mypulse"
p1=(tx_pos[0], tx_pos[1], tx_pos[2]),
polarisation="x",
resistance=50,
waveform_id="mypulse",
)
scene.add(wave)
scene.add(tl)
@@ -59,8 +62,16 @@ scene.add(t2)
# Detailed geometry view around bowtie and feed position
gv1 = gprMax.GeometryView(
p1=(tx_pos[0] - bowtie_dims[0] - 2 * dl, tx_pos[1] - bowtie_dims[1] / 2 - 2 * dl, tx_pos[2] - 2 * dl),
p2=(tx_pos[0] + bowtie_dims[0] + 2 * dl, tx_pos[1] + bowtie_dims[1] / 2 + 2 * dl, tx_pos[2] + 2 * dl),
p1=(
tx_pos[0] - bowtie_dims[0] - 2 * dl,
tx_pos[1] - bowtie_dims[1] / 2 - 2 * dl,
tx_pos[2] - 2 * dl,
),
p2=(
tx_pos[0] + bowtie_dims[0] + 2 * dl,
tx_pos[1] + bowtie_dims[1] / 2 + 2 * dl,
tx_pos[2] + 2 * dl,
),
dl=(dl, dl, dl),
filename="antenna_bowtie_fs_pcb",
output_type="f",

查看文件

@@ -1,4 +1,4 @@
# Copyright (C) 2015-2024: The University of Edinburgh, United Kingdom
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, and John Hartley
#
# This file is part of gprMax.
@@ -32,7 +32,8 @@ logger = logging.getLogger(__name__)
# Parse command line arguments
parser = argparse.ArgumentParser(
description="Plots a comparison of fields between " + "given simulation output and experimental data files.",
description="Plots a comparison of fields between "
+ "given simulation output and experimental data files.",
usage="cd gprMax; python -m testing.test_experimental modelfile realfile output",
)
parser.add_argument("modelfile", help="name of model output file including path")

查看文件

@@ -1,4 +1,4 @@
# Copyright (C) 2015-2024: The University of Edinburgh, United Kingdom
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, and John Hartley
#
# This file is part of gprMax.
@@ -113,7 +113,11 @@ for i, model in enumerate(testmodels):
# Tx/Rx position to feed to analytical solution
rxpos = filetest[path].attrs["Position"]
txpos = filetest["/srcs/src1/"].attrs["Position"]
rxposrelative = ((rxpos[0] - txpos[0]), (rxpos[1] - txpos[1]), (rxpos[2] - txpos[2]))
rxposrelative = (
(rxpos[0] - txpos[0]),
(rxpos[1] - txpos[1]),
(rxpos[2] - txpos[2]),
)
# Analytical solution of a dipole in free space
dataref = hertzian_dipole_fs(