你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Updated some functions to make them much cleaner.
这个提交包含在:
@@ -437,14 +437,18 @@ class HertzianDipole(UserObjectMulti):
|
||||
if config.get_model_config().mode == "2D":
|
||||
logger.info(
|
||||
f"{self.grid_name(grid)}Hertzian dipole is a line "
|
||||
f"source in 2D with polarity {h.polarisation} at "
|
||||
f"{p2[0]:g}m, {p2[1]:g}m, {p2[2]:g}m," + startstop + f"using waveform {h.waveformID} created."
|
||||
+ f"source in 2D with polarity {h.polarisation} at "
|
||||
+ f"{p2[0]:g}m, {p2[1]:g}m, {p2[2]:g}m,"
|
||||
+ startstop
|
||||
+ f"using waveform {h.waveformID} created."
|
||||
)
|
||||
else:
|
||||
logger.info(
|
||||
f"{self.grid_name(grid)}Hertzian dipole with "
|
||||
f"polarity {h.polarisation} at {p2[0]:g}m, "
|
||||
f"{p2[1]:g}m, {p2[2]:g}m," + startstop + f"using waveform {h.waveformID} created."
|
||||
+ f"polarity {h.polarisation} at {p2[0]:g}m, "
|
||||
+ f"{p2[1]:g}m, {p2[2]:g}m,"
|
||||
+ startstop
|
||||
+ f"using waveform {h.waveformID} created."
|
||||
)
|
||||
|
||||
grid.hertziandipoles.append(h)
|
||||
@@ -704,8 +708,10 @@ class TransmissionLine(UserObjectMulti):
|
||||
|
||||
logger.info(
|
||||
f"{self.grid_name(grid)}Transmission line with polarity "
|
||||
f"{t.polarisation} at {p2[0]:g}m, {p2[1]:g}m, "
|
||||
f"{p2[2]:g}m, resistance {t.resistance:.1f} Ohms," + startstop + f"using waveform {t.waveformID} created."
|
||||
+ f"{t.polarisation} at {p2[0]:g}m, {p2[1]:g}m, "
|
||||
+ f"{p2[2]:g}m, resistance {t.resistance:.1f} Ohms,"
|
||||
+ startstop
|
||||
+ f"using waveform {t.waveformID} created."
|
||||
)
|
||||
|
||||
grid.transmissionlines.append(t)
|
||||
|
@@ -208,22 +208,7 @@ class Snapshot:
|
||||
G: FDTDGrid class describing a grid in a model.
|
||||
"""
|
||||
|
||||
celldata = {}
|
||||
|
||||
for k, v in self.outputs.items():
|
||||
if v:
|
||||
if k == "Ex":
|
||||
celldata[k] = self.snapfields["Ex"]
|
||||
if k == "Ey":
|
||||
celldata[k] = self.snapfields["Ey"]
|
||||
if k == "Ez":
|
||||
celldata[k] = self.snapfields["Ez"]
|
||||
if k == "Hx":
|
||||
celldata[k] = self.snapfields["Hx"]
|
||||
if k == "Hy":
|
||||
celldata[k] = self.snapfields["Hy"]
|
||||
if k == "Hz":
|
||||
celldata[k] = self.snapfields["Hz"]
|
||||
celldata = {k: self.snapfields[k] for k, v in self.outputs.items() if v}
|
||||
|
||||
imageToVTK(
|
||||
str(self.filename.with_suffix("")),
|
||||
@@ -255,24 +240,10 @@ class Snapshot:
|
||||
f.attrs["dx_dy_dz"] = (self.dx * G.dx, self.dy * G.dy, self.dz * G.dz)
|
||||
f.attrs["time"] = self.time * G.dt
|
||||
|
||||
if self.outputs["Ex"]:
|
||||
f["Ex"] = self.snapfields["Ex"]
|
||||
pbar.update(n=self.snapfields["Ex"].nbytes)
|
||||
if self.outputs["Ey"]:
|
||||
f["Ey"] = self.snapfields["Ey"]
|
||||
pbar.update(n=self.snapfields["Ey"].nbytes)
|
||||
if self.outputs["Ez"]:
|
||||
f["Ez"] = self.snapfields["Ez"]
|
||||
pbar.update(n=self.snapfields["Ez"].nbytes)
|
||||
if self.outputs["Hx"]:
|
||||
f["Hx"] = self.snapfields["Hx"]
|
||||
pbar.update(n=self.snapfields["Hx"].nbytes)
|
||||
if self.outputs["Hy"]:
|
||||
f["Hy"] = self.snapfields["Hy"]
|
||||
pbar.update(n=self.snapfields["Hy"].nbytes)
|
||||
if self.outputs["Hz"]:
|
||||
f["Hz"] = self.snapfields["Hz"]
|
||||
pbar.update(n=self.snapfields["Hz"].nbytes)
|
||||
for field, output in self.outputs.items():
|
||||
if output:
|
||||
f[field] = self.snapfields[field]
|
||||
pbar.update(n=self.snapfields[field].nbytes)
|
||||
|
||||
f.close()
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户