你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
comments
这个提交包含在:
@@ -23,6 +23,7 @@ from .precursor_nodes_filtered import PrecursorNodes as PrecursorNodesFilteredHS
|
|||||||
|
|
||||||
from ..updates import CPUUpdates
|
from ..updates import CPUUpdates
|
||||||
|
|
||||||
|
|
||||||
def create_updates(G):
|
def create_updates(G):
|
||||||
"""Return the solver for the given subgrids."""
|
"""Return the solver for the given subgrids."""
|
||||||
updaters = []
|
updaters = []
|
||||||
@@ -43,7 +44,9 @@ def create_updates(G):
|
|||||||
updates = SubgridUpdates(G, updaters)
|
updates = SubgridUpdates(G, updaters)
|
||||||
return updates
|
return updates
|
||||||
|
|
||||||
|
|
||||||
class SubgridUpdates(CPUUpdates):
|
class SubgridUpdates(CPUUpdates):
|
||||||
|
"""Provides update functions for the Sub gridding simulation."""
|
||||||
|
|
||||||
def __init__(self, G, updaters):
|
def __init__(self, G, updaters):
|
||||||
super().__init__(G)
|
super().__init__(G)
|
||||||
@@ -51,6 +54,7 @@ class SubgridUpdates(CPUUpdates):
|
|||||||
|
|
||||||
def hsg_1(self):
|
def hsg_1(self):
|
||||||
"""Method to update the subgrids over the first phase."""
|
"""Method to update the subgrids over the first phase."""
|
||||||
|
# updaters update each subgrid
|
||||||
for sg_updater in self.updaters:
|
for sg_updater in self.updaters:
|
||||||
sg_updater.hsg_1()
|
sg_updater.hsg_1()
|
||||||
|
|
||||||
@@ -87,20 +91,19 @@ class SubgridUpdater(CPUUpdates):
|
|||||||
sub_grid = self.grid
|
sub_grid = self.grid
|
||||||
precursors = self.precursors
|
precursors = self.precursors
|
||||||
|
|
||||||
|
# copy the main grid electric fields at the IS position
|
||||||
precursors.update_electric()
|
precursors.update_electric()
|
||||||
|
|
||||||
upper_m = int(sub_grid.ratio / 2 - 0.5)
|
upper_m = int(sub_grid.ratio / 2 - 0.5)
|
||||||
|
|
||||||
for m in range(1, upper_m + 1):
|
for m in range(1, upper_m + 1):
|
||||||
|
|
||||||
# STD update, interpolate inc. field in time, apply correction
|
|
||||||
self.store_outputs()
|
self.store_outputs()
|
||||||
self.update_electric_a()
|
self.update_electric_a()
|
||||||
self.update_electric_pml()
|
self.update_electric_pml()
|
||||||
precursors.interpolate_magnetic_in_time(int(m + sub_grid.ratio / 2 - 0.5))
|
precursors.interpolate_magnetic_in_time(int(m + sub_grid.ratio / 2 - 0.5))
|
||||||
sub_grid.update_electric_is(precursors)
|
sub_grid.update_electric_is(precursors)
|
||||||
self.update_electric_b()
|
self.update_electric_b()
|
||||||
|
|
||||||
self.update_electric_sources()
|
self.update_electric_sources()
|
||||||
|
|
||||||
# STD update, interpolate inc. field in time, apply correction
|
# STD update, interpolate inc. field in time, apply correction
|
||||||
|
在新工单中引用
屏蔽一个用户