你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Tweaks to inherit any time step mods from main grid to subgrid
这个提交包含在:
@@ -191,7 +191,7 @@ class TimeStepStabilityFactor(UserObjectSingle):
|
||||
raise ValueError
|
||||
|
||||
G.dt_mod = f
|
||||
G.calculate_dt()
|
||||
G.dt = G.dt * G.dt_mod
|
||||
|
||||
logger.info(f'Time step (modified): {G.dt:g} secs')
|
||||
|
||||
|
@@ -46,7 +46,7 @@ class FDTDGrid:
|
||||
self.dy = 0
|
||||
self.dz = 0
|
||||
self.dt = 0
|
||||
self.dt_mod = 1 # Time step stability factor
|
||||
self.dt_mod = None # Time step stability factor
|
||||
self.iteration = 0 # Current iteration number
|
||||
self.iterations = 0 # Total number of iterations
|
||||
self.timewindow = 0
|
||||
@@ -299,9 +299,6 @@ class FDTDGrid:
|
||||
# binary representation of floating point number.
|
||||
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):
|
||||
"""Additional grid methods for solving on GPU using CUDA."""
|
||||
|
@@ -294,4 +294,4 @@ class SubGridHSG(SubGridBaseGrid):
|
||||
f'(({self.nwx} x {self.nwy} x {self.nwz} = {self.nwx * self.nwy * self.nwz} cells)')
|
||||
logger.debug(f'[{self.name}] Total region: {self.nx:d} x {self.ny:d} x {self.nz:d} = ' +
|
||||
f'{(self.nx * self.ny * self.nz):g} cells')
|
||||
logger.info(f'[{self.name}] Time step (at CFL limit): {self.dt:g} secs')
|
||||
logger.info(f'[{self.name}] Time step: {self.dt:g} secs')
|
@@ -91,8 +91,12 @@ class SubGridBase(UserObjectMulti):
|
||||
|
||||
self.set_discretisation(sg, grid)
|
||||
|
||||
# Set temporal discretisation
|
||||
# Set temporal discretisation including any inherited time step
|
||||
# stability factor from the main grid
|
||||
sg.calculate_dt()
|
||||
if grid.dt_mod:
|
||||
sg.dt = sg.dt * grid.dt_mod
|
||||
|
||||
|
||||
# Set the indices related to the subgrids main grid placement
|
||||
self.set_main_grid_indices(sg, uip, p1, p2)
|
||||
|
在新工单中引用
屏蔽一个用户