你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Bug fixes for plane wave
这个提交包含在:
@@ -974,7 +974,7 @@ class DiscretePlaneWave(UserObjectMulti):
|
||||
self.order = 19
|
||||
self.hash = "#discrete_plane_wave"
|
||||
|
||||
def create(self, grid, uip):
|
||||
def build(self, grid, uip):
|
||||
try:
|
||||
theta = self.kwargs["theta"]
|
||||
phi = self.kwargs["phi"]
|
||||
@@ -1069,7 +1069,7 @@ class DiscretePlaneWave(UserObjectMulti):
|
||||
DPW.calculate_waveform_values(grid)
|
||||
|
||||
logger.info(
|
||||
f"{self.grid_name(grid)} Discrete Plane Wave within the TFSF Box "
|
||||
f"{self.grid_name(grid)}Discrete Plane Wave within the TFSF Box "
|
||||
+ f"spanning from {p1} m to {p2} m, incident in the direction "
|
||||
+ f"theta {theta} degrees and phi {phi} degrees "
|
||||
+ startstop
|
||||
@@ -1088,12 +1088,11 @@ class DiscretePlaneWave(UserObjectMulti):
|
||||
/ np.pi
|
||||
)
|
||||
logger.info(
|
||||
f"Since {self.grid_name(grid)} Discrete Plane Wave has been discretized "
|
||||
f"{self.grid_name(grid)}Discrete Plane Wave has been discretized "
|
||||
+ "the angles have been approximated to the nearest rational angles "
|
||||
+ "with some small tolerance levels. The chosen rational integers are "
|
||||
+ f"[m_x, m_y, m_z] : {DPW.m[:3]}. The approximated angles are : \n"
|
||||
+ "Approximated Phi : {:.3f}".format(phi_approx)
|
||||
+ "\nApproximated Theta : {:.3f} .".format(theta_approx)
|
||||
+ f"[m_x, m_y, m_z] : {DPW.m[:3]}. The approximated angles are: "
|
||||
+ f"Phi: {phi_approx:.3f} and Theta: {theta_approx:.3f}"
|
||||
)
|
||||
|
||||
grid.discreteplanewaves.append(DPW)
|
||||
|
@@ -275,12 +275,12 @@ def process_multicmds(multicmds):
|
||||
|
||||
scene_objects.append(plWave)
|
||||
|
||||
cmd = "#excitation_file"
|
||||
if multicmds[cmd] is not None:
|
||||
cmdname = "#excitation_file"
|
||||
if multicmds[cmdname] is not None:
|
||||
for cmdinstance in multicmds[cmdname]:
|
||||
tmp = cmdinstance.split()
|
||||
if len(tmp) not in [1, 3]:
|
||||
logger.exception(f"{cmd} requires either one or three parameter(s)")
|
||||
logger.exception(f"{cmdname} requires either one or three parameter(s)")
|
||||
raise ValueError
|
||||
|
||||
if len(tmp) > 1:
|
||||
|
@@ -119,10 +119,8 @@ class CPUUpdates:
|
||||
precompute = False,
|
||||
)
|
||||
|
||||
if(self.grid.iteration % 10 == 0):
|
||||
np.save('./snapshots/electric_z_{}.npy'.format(self.grid.iteration), self.grid.Ex)
|
||||
|
||||
|
||||
# if(self.grid.iteration % 10 == 0):
|
||||
# np.save('./snapshots/electric_z_{}.npy'.format(self.grid.iteration), self.grid.Ex)
|
||||
|
||||
def update_electric_a(self):
|
||||
"""Updates electric field components."""
|
||||
|
在新工单中引用
屏蔽一个用户