你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Allow subgrids to inherit any time step stability factor. Remove get_src function (not used).
这个提交包含在:
@@ -189,7 +189,9 @@ class TimeStepStabilityFactor(UserObjectSingle):
|
||||
logger.exception(f'{self.__str__()} requires the value of the time '
|
||||
f'step stability factor to be between zero and one')
|
||||
raise ValueError
|
||||
G.dt = G.dt * f
|
||||
|
||||
G.dt_mod = f
|
||||
G.dt = G.dt * G.dt_mod
|
||||
|
||||
logger.info(f'Time step (modified): {G.dt:g} secs')
|
||||
|
||||
|
@@ -287,7 +287,8 @@ class Comments():
|
||||
# Information on PML thickness
|
||||
if self.grid.pmls['slabs']:
|
||||
comments['PMLthickness'] = self.pml_gv_comment()
|
||||
srcs = self.grid.get_srcs()
|
||||
srcs = (self.grid.hertziandipoles + self.grid.magneticdipoles +
|
||||
self.grid.voltagesources + self.grid.transmissionlines)
|
||||
if srcs:
|
||||
comments['Sources'] = self.srcs_rx_gv_comment(srcs)
|
||||
if self.grid.rxs:
|
||||
|
@@ -46,8 +46,9 @@ class FDTDGrid:
|
||||
self.dy = 0
|
||||
self.dz = 0
|
||||
self.dt = 0
|
||||
self.iteration = 0
|
||||
self.iterations = 0
|
||||
self.dt_mod = None # Time step stability factor
|
||||
self.iteration = 0 # Current iteration number
|
||||
self.iterations = 0 # Total number of iterations
|
||||
self.timewindow = 0
|
||||
|
||||
# PML parameters - set some defaults to use if not user provided
|
||||
@@ -297,9 +298,6 @@ class FDTDGrid:
|
||||
# hardware maximum. Avoids inadvertently exceeding the CFL due to
|
||||
# binary representation of floating point number.
|
||||
self.dt = round_value(self.dt, decimalplaces=d.getcontext().prec - 1)
|
||||
|
||||
def get_srcs(self):
|
||||
return self.hertziandipoles + self.magneticdipoles + self.voltagesources + self.transmissionlines
|
||||
|
||||
|
||||
class CUDAGrid(FDTDGrid):
|
||||
|
@@ -54,7 +54,7 @@ class SubGridBase(UserObjectMulti):
|
||||
sg.dz = grid.dz / sg.ratio
|
||||
sg.dl = np.array([sg.dx, sg.dy, sg.dz])
|
||||
|
||||
def set_main_grid_indices(self, sg, grid, uip, p1, p2):
|
||||
def set_main_grid_indices(self, sg, uip, p1, p2):
|
||||
"""Sets subgrid indices related to main grid placement."""
|
||||
# Location of the IS
|
||||
sg.i0, sg.j0, sg.k0 = p1
|
||||
@@ -91,11 +91,14 @@ class SubGridBase(UserObjectMulti):
|
||||
|
||||
self.set_discretisation(sg, grid)
|
||||
|
||||
# Set the temporal discretisation
|
||||
# Set temporal discretisation including inheriting any time step
|
||||
# stability factor from the main grid
|
||||
sg.calculate_dt()
|
||||
if sg.dt_mod:
|
||||
sg.dt = sg.dt * sg.dt_mod
|
||||
|
||||
# Set the indices related to the subgrids main grid placement
|
||||
self.set_main_grid_indices(sg, grid, uip, p1, p2)
|
||||
self.set_main_grid_indices(sg, uip, p1, p2)
|
||||
|
||||
"""
|
||||
try:
|
||||
|
在新工单中引用
屏蔽一个用户