你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Remove unnecessary hsg attribute
这个提交包含在:
@@ -49,7 +49,7 @@ def create_G() -> FDTDGrid:
|
|||||||
class Solver:
|
class Solver:
|
||||||
"""Generic solver for Update objects"""
|
"""Generic solver for Update objects"""
|
||||||
|
|
||||||
def __init__(self, updates: Updates, hsg=False):
|
def __init__(self, updates: Updates):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
updates: Updates contains methods to run FDTD algorithm.
|
updates: Updates contains methods to run FDTD algorithm.
|
||||||
@@ -57,7 +57,6 @@ class Solver:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.updates = updates
|
self.updates = updates
|
||||||
self.hsg = hsg
|
|
||||||
self.solvetime = 0
|
self.solvetime = 0
|
||||||
self.memused = 0
|
self.memused = 0
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@ class Solver:
|
|||||||
self.updates.cleanup()
|
self.updates.cleanup()
|
||||||
|
|
||||||
|
|
||||||
def create_solver(G: FDTDGrid) -> Solver:
|
def create_solver(grid: FDTDGrid) -> Solver:
|
||||||
"""Create configured solver object.
|
"""Create configured solver object.
|
||||||
|
|
||||||
N.B. A large range of different functions exist to advance the time
|
N.B. A large range of different functions exist to advance the time
|
||||||
@@ -111,24 +110,22 @@ def create_solver(G: FDTDGrid) -> Solver:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if config.sim_config.general["subgrid"]:
|
if config.sim_config.general["subgrid"]:
|
||||||
updates = create_subgrid_updates(G)
|
updates = create_subgrid_updates(grid)
|
||||||
if config.get_model_config().materials["maxpoles"] != 0:
|
if config.get_model_config().materials["maxpoles"] != 0:
|
||||||
# Set dispersive update functions for both SubgridUpdates and
|
# Set dispersive update functions for both SubgridUpdates and
|
||||||
# SubgridUpdaters subclasses
|
# SubgridUpdaters subclasses
|
||||||
updates.set_dispersive_updates()
|
updates.set_dispersive_updates()
|
||||||
for u in updates.updaters:
|
for u in updates.updaters:
|
||||||
u.set_dispersive_updates()
|
u.set_dispersive_updates()
|
||||||
solver = Solver(updates, hsg=True)
|
elif type(grid) is FDTDGrid:
|
||||||
elif type(G) is FDTDGrid:
|
updates = CPUUpdates(grid)
|
||||||
updates = CPUUpdates(G)
|
|
||||||
if config.get_model_config().materials["maxpoles"] != 0:
|
if config.get_model_config().materials["maxpoles"] != 0:
|
||||||
updates.set_dispersive_updates()
|
updates.set_dispersive_updates()
|
||||||
solver = Solver(updates)
|
elif type(grid) is CUDAGrid:
|
||||||
elif type(G) is CUDAGrid:
|
updates = CUDAUpdates(grid)
|
||||||
updates = CUDAUpdates(G)
|
elif type(grid) is OpenCLGrid:
|
||||||
solver = Solver(updates)
|
updates = OpenCLUpdates(grid)
|
||||||
elif type(G) is OpenCLGrid:
|
|
||||||
updates = OpenCLUpdates(G)
|
solver = Solver(updates)
|
||||||
solver = Solver(updates)
|
|
||||||
|
|
||||||
return solver
|
return solver
|
||||||
|
在新工单中引用
屏蔽一个用户