Refactor TimeStepStabilityFactor UserObject

这个提交包含在:
nmannall
2024-05-14 14:59:30 +01:00
父节点 7cfe57948a
当前提交 6331a47fd6
共有 2 个文件被更改,包括 5 次插入3 次删除

查看文件

@@ -188,7 +188,7 @@ class TimeStepStabilityFactor(UserObjectSingle):
super().__init__(**kwargs)
self.order = 4
def build(self, G, uip):
def build(self, model, uip):
try:
f = self.kwargs["f"]
except KeyError:
@@ -202,6 +202,7 @@ class TimeStepStabilityFactor(UserObjectSingle):
)
raise ValueError
G = model.G
G.dt_mod = f
G.dt = G.dt * G.dt_mod
@@ -220,7 +221,7 @@ class TimeWindow(UserObjectSingle):
super().__init__(**kwargs)
self.order = 5
def build(self, G, uip):
def build(self, model, uip):
# If number of iterations given
# The +/- 1 used in calculating the number of iterations is to account for
# the fact that the solver (iterations) loop runs from 0 to < G.iterations

查看文件

@@ -61,7 +61,8 @@ class FDTDGrid:
self.dz = 0.0
self.dl: np.ndarray
self.dt = 0.0
self.dt_mod = None # Time step stability factor
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