你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Move time step stability factor into Model
这个提交包含在:
@@ -202,11 +202,10 @@ class TimeStepStabilityFactor(UserObjectSingle):
|
||||
)
|
||||
raise ValueError
|
||||
|
||||
G = model.G
|
||||
G.dt_mod = f
|
||||
G.dt = G.dt * G.dt_mod
|
||||
model.dt_mod = f
|
||||
model.G.dt *= model.dt_mod
|
||||
|
||||
logger.info(f"Time step (modified): {G.dt:g} secs")
|
||||
logger.info(f"Time step (modified): {model.G.dt:g} secs")
|
||||
|
||||
|
||||
class TimeWindow(UserObjectSingle):
|
||||
|
@@ -59,7 +59,6 @@ class FDTDGrid:
|
||||
self.dl: np.ndarray[Any, np.dtype[np.single]]
|
||||
self.dt = 0.0
|
||||
|
||||
self.dt_mod = 1.0 # Time step stability factor
|
||||
self.iteration = 0 # Current iteration number
|
||||
self.iterations = 0 # Total number of iterations
|
||||
self.timewindow = 0
|
||||
|
@@ -60,6 +60,8 @@ class Model:
|
||||
self.gny = 0
|
||||
self.gnz = 0
|
||||
|
||||
self.dt_mod = 1.0 # Time step stability factor
|
||||
|
||||
self.G = self._create_grid()
|
||||
# Monitor memory usage
|
||||
self.p = None
|
||||
@@ -126,6 +128,14 @@ class Model:
|
||||
def dl(self, value: np.ndarray[Any, np.dtype[np.single]]):
|
||||
self.G.dl = value
|
||||
|
||||
@property
|
||||
def dt(self) -> float:
|
||||
return self.G.dt
|
||||
|
||||
@dt.setter
|
||||
def dt(self, value: float):
|
||||
self.G.dt = value
|
||||
|
||||
def _create_grid(self) -> FDTDGrid:
|
||||
"""Create grid object according to solver.
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户