你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
rename
这个提交包含在:
@@ -16,26 +16,22 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from gprMax.updates import CPUUpdates
|
from gprMax.updates import CPUUpdates
|
||||||
from gprMax.updates import SubGridsUpdates
|
|
||||||
from gprMax.updates import GPUUpdates
|
from gprMax.updates import GPUUpdates
|
||||||
from gprMax.utilities import timer
|
from gprMax.utilities import timer
|
||||||
|
|
||||||
|
|
||||||
def create_solver(sim_config):
|
def create_solver(sim_config):
|
||||||
"""Returns the configured solver."""
|
"""Returns the configured solver."""
|
||||||
if sim_config.cpu:
|
if sim_config.gpu:
|
||||||
from gprMax.Grid import FDTDGrid
|
from .grid import GPUGrid
|
||||||
G = FDTDGrid()
|
|
||||||
updates = CPUUpdates(G)
|
|
||||||
|
|
||||||
elif sim_config.gpu:
|
|
||||||
from gprMax.Grid import GPUGrid
|
|
||||||
G = GPUGrid()
|
G = GPUGrid()
|
||||||
updates = GPUUpdates(G)
|
updates = GPUUpdates(G)
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError
|
from .grid import FDTDGrid
|
||||||
|
G = FDTDGrid()
|
||||||
|
updates = CPUUpdates(G)
|
||||||
|
|
||||||
solver = Solver(updates, iterator)
|
solver = Solver(updates)
|
||||||
|
|
||||||
return solver
|
return solver
|
||||||
|
|
||||||
@@ -44,7 +40,7 @@ class Solver:
|
|||||||
|
|
||||||
"""Generic solver for Update objects"""
|
"""Generic solver for Update objects"""
|
||||||
|
|
||||||
def __init__(self, updates, iterator):
|
def __init__(self, updates):
|
||||||
"""Context for the model to run in. Sub-class this with contexts
|
"""Context for the model to run in. Sub-class this with contexts
|
||||||
i.e. an MPI context.
|
i.e. an MPI context.
|
||||||
|
|
||||||
@@ -53,7 +49,7 @@ class Solver:
|
|||||||
iterator (iterator): can be range() or tqdm()
|
iterator (iterator): can be range() or tqdm()
|
||||||
"""
|
"""
|
||||||
self.updates = updates
|
self.updates = updates
|
||||||
self.iterator = iterator
|
#self.iterator = iterator
|
||||||
|
|
||||||
def solve(self):
|
def solve(self):
|
||||||
"""Time step the FDTD model."""
|
"""Time step the FDTD model."""
|
在新工单中引用
屏蔽一个用户