你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
comments
这个提交包含在:
@@ -17,19 +17,9 @@
|
|||||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from ..grid import FDTDGrid
|
from ..grid import FDTDGrid
|
||||||
|
|
||||||
from ..materials import Material
|
|
||||||
|
|
||||||
from scipy.constants import mu_0
|
|
||||||
from scipy.constants import epsilon_0
|
|
||||||
from scipy.constants import c
|
from scipy.constants import c
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from colorama import init
|
|
||||||
from colorama import Fore
|
|
||||||
from colorama import Style
|
|
||||||
init()
|
|
||||||
|
|
||||||
|
|
||||||
class SubGridBase(FDTDGrid):
|
class SubGridBase(FDTDGrid):
|
||||||
|
|
||||||
@@ -64,6 +54,7 @@ class SubGridBase(FDTDGrid):
|
|||||||
|
|
||||||
# Number of sub cells to extend the sub grid beyond the IS boundary
|
# Number of sub cells to extend the sub grid beyond the IS boundary
|
||||||
d_to_pml = self.s_is_os_sep + self.pml_separation
|
d_to_pml = self.s_is_os_sep + self.pml_separation
|
||||||
|
# index of the is
|
||||||
self.n_boundary_cells = d_to_pml + self.pmlthickness['x0']
|
self.n_boundary_cells = d_to_pml + self.pmlthickness['x0']
|
||||||
self.n_boundary_cells_x = d_to_pml + self.pmlthickness['x0']
|
self.n_boundary_cells_x = d_to_pml + self.pmlthickness['x0']
|
||||||
self.n_boundary_cells_y = d_to_pml + self.pmlthickness['y0']
|
self.n_boundary_cells_y = d_to_pml + self.pmlthickness['y0']
|
||||||
@@ -72,17 +63,17 @@ class SubGridBase(FDTDGrid):
|
|||||||
self.interpolation = kwargs['interpolation']
|
self.interpolation = kwargs['interpolation']
|
||||||
|
|
||||||
def calculate_dt(self):
|
def calculate_dt(self):
|
||||||
|
"""Calculate dt at the CFL limit."""
|
||||||
self.dt = (1 / (c * np.sqrt(
|
self.dt = (1 / (c * np.sqrt(
|
||||||
(1 / self.dx) * (1 / self.dx) +
|
(1 / self.dx) * (1 / self.dx) +
|
||||||
(1 / self.dy) * (1 / self.dy) +
|
(1 / self.dy) * (1 / self.dy) +
|
||||||
(1 / self.dz) * (1 / self.dz))))
|
(1 / self.dz) * (1 / self.dz))))
|
||||||
|
|
||||||
|
|
||||||
def main_grid_index_to_subgrid_index(self, i, j, k):
|
def main_grid_index_to_subgrid_index(self, i, j, k):
|
||||||
|
"""Calculate local subgrid index from global main grid index."""
|
||||||
i_s = self.n_boundary_cells_x + (i - self.i0) * self.ratio
|
i_s = self.n_boundary_cells_x + (i - self.i0) * self.ratio
|
||||||
j_s = self.n_boundary_cells_y + (j - self.j0) * self.ratio
|
j_s = self.n_boundary_cells_y + (j - self.j0) * self.ratio
|
||||||
k_s = self.n_boundary_cells_z + (k - self.k0) * self.ratio
|
k_s = self.n_boundary_cells_z + (k - self.k0) * self.ratio
|
||||||
|
|
||||||
return (i_s, j_s, k_s)
|
return (i_s, j_s, k_s)
|
||||||
|
|
||||||
def initialise_geometry_arrays(self):
|
def initialise_geometry_arrays(self):
|
||||||
|
在新工单中引用
屏蔽一个用户