你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Refactor grid discretisation initialisation
这个提交包含在:
@@ -90,14 +90,14 @@ class Discretisation(UserObjectSingle):
|
||||
super().__init__(**kwargs)
|
||||
self.order = 2
|
||||
|
||||
def build(self, G, uip):
|
||||
def build(self, model, uip):
|
||||
try:
|
||||
G.dl = np.array(self.kwargs["p1"])
|
||||
G.dx, G.dy, G.dz = self.kwargs["p1"]
|
||||
model.set_grid_discretisation(self.kwargs["p1"])
|
||||
except KeyError:
|
||||
logger.exception(f"{self.__str__()} discretisation requires a point")
|
||||
raise
|
||||
|
||||
G = model.G
|
||||
if G.dl[0] <= 0:
|
||||
logger.exception(
|
||||
f"{self.__str__()} discretisation requires the "
|
||||
|
@@ -59,6 +59,7 @@ class FDTDGrid:
|
||||
self.dx = 0.0
|
||||
self.dy = 0.0
|
||||
self.dz = 0.0
|
||||
self.dl: np.ndarray
|
||||
self.dt = 0.0
|
||||
self.dt_mod = None # Time step stability factor
|
||||
self.iteration = 0 # Current iteration number
|
||||
|
@@ -20,6 +20,7 @@ import datetime
|
||||
import itertools
|
||||
import logging
|
||||
import sys
|
||||
from typing import Tuple
|
||||
|
||||
import humanize
|
||||
import numpy as np
|
||||
@@ -160,6 +161,10 @@ class Model:
|
||||
if grid.snapshots:
|
||||
save_snapshots(grid)
|
||||
|
||||
def set_grid_discretisation(self, point: Tuple[float, float, float]):
|
||||
self.G.dl = np.array(point)
|
||||
self.G.dx, self.G.dy, self.G.dz = point
|
||||
|
||||
def solve(self, solver):
|
||||
"""Solve using FDTD method.
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户