你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Further tweaks to inheriting time step stability in subgrids
这个提交包含在:
@@ -191,7 +191,7 @@ class TimeStepStabilityFactor(UserObjectSingle):
|
|||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
G.dt_mod = f
|
G.dt_mod = f
|
||||||
G.dt = G.dt * G.dt_mod
|
G.calculate_dt()
|
||||||
|
|
||||||
logger.info(f'Time step (modified): {G.dt:g} secs')
|
logger.info(f'Time step (modified): {G.dt:g} secs')
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ class FDTDGrid:
|
|||||||
self.dy = 0
|
self.dy = 0
|
||||||
self.dz = 0
|
self.dz = 0
|
||||||
self.dt = 0
|
self.dt = 0
|
||||||
self.dt_mod = None # Time step stability factor
|
self.dt_mod = 1 # Time step stability factor
|
||||||
self.iteration = 0 # Current iteration number
|
self.iteration = 0 # Current iteration number
|
||||||
self.iterations = 0 # Total number of iterations
|
self.iterations = 0 # Total number of iterations
|
||||||
self.timewindow = 0
|
self.timewindow = 0
|
||||||
@@ -299,6 +299,9 @@ class FDTDGrid:
|
|||||||
# binary representation of floating point number.
|
# binary representation of floating point number.
|
||||||
self.dt = round_value(self.dt, decimalplaces=d.getcontext().prec - 1)
|
self.dt = round_value(self.dt, decimalplaces=d.getcontext().prec - 1)
|
||||||
|
|
||||||
|
# Apply any time step stability factor
|
||||||
|
self.dt = self.dt * self.dt_mod
|
||||||
|
|
||||||
|
|
||||||
class CUDAGrid(FDTDGrid):
|
class CUDAGrid(FDTDGrid):
|
||||||
"""Additional grid methods for solving on GPU using CUDA."""
|
"""Additional grid methods for solving on GPU using CUDA."""
|
||||||
|
@@ -91,11 +91,8 @@ class SubGridBase(UserObjectMulti):
|
|||||||
|
|
||||||
self.set_discretisation(sg, grid)
|
self.set_discretisation(sg, grid)
|
||||||
|
|
||||||
# Set temporal discretisation including inheriting any time step
|
# Set temporal discretisation
|
||||||
# stability factor from the main grid
|
|
||||||
sg.calculate_dt()
|
sg.calculate_dt()
|
||||||
if sg.dt_mod:
|
|
||||||
sg.dt = sg.dt * sg.dt_mod
|
|
||||||
|
|
||||||
# Set the indices related to the subgrids main grid placement
|
# Set the indices related to the subgrids main grid placement
|
||||||
self.set_main_grid_indices(sg, uip, p1, p2)
|
self.set_main_grid_indices(sg, uip, p1, p2)
|
||||||
|
在新工单中引用
屏蔽一个用户