你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Cleanup initialisation of coefficient arrays.
这个提交包含在:
@@ -290,11 +290,11 @@ def run_model(args, modelrun, numbermodelruns, inputfile, usernamespace):
|
|||||||
voltagesource.create_material(G)
|
voltagesource.create_material(G)
|
||||||
|
|
||||||
# Initialise arrays of update coefficients to pass to update functions
|
# Initialise arrays of update coefficients to pass to update functions
|
||||||
G.initialise_std_updatecoeff_arrays(len(G.materials))
|
G.initialise_std_updatecoeff_arrays()
|
||||||
|
|
||||||
# Initialise arrays of update coefficients and temporary values if there are any dispersive materials
|
# Initialise arrays of update coefficients and temporary values if there are any dispersive materials
|
||||||
if Material.maxpoles != 0:
|
if Material.maxpoles != 0:
|
||||||
G.initialise_dispersive_arrays(len(G.materials))
|
G.initialise_dispersive_arrays()
|
||||||
|
|
||||||
# Calculate update coefficients, store in arrays, and list materials in model
|
# Calculate update coefficients, store in arrays, and list materials in model
|
||||||
if G.messages:
|
if G.messages:
|
||||||
|
@@ -78,25 +78,17 @@ class FDTDGrid:
|
|||||||
self.Hy = np.zeros((self.nx, self.ny + 1, self.nz), dtype=floattype)
|
self.Hy = np.zeros((self.nx, self.ny + 1, self.nz), dtype=floattype)
|
||||||
self.Hz = np.zeros((self.nx, self.ny, self.nz + 1), dtype=floattype)
|
self.Hz = np.zeros((self.nx, self.ny, self.nz + 1), dtype=floattype)
|
||||||
|
|
||||||
def initialise_std_updatecoeff_arrays(self, nummaterials):
|
def initialise_std_updatecoeff_arrays(self):
|
||||||
"""Initialise arrays for storing update coefficients.
|
"""Initialise arrays for storing update coefficients."""
|
||||||
|
self.updatecoeffsE = np.zeros((len(self.materials), 5), dtype=floattype)
|
||||||
Args:
|
self.updatecoeffsH = np.zeros((len(self.materials), 5), dtype=floattype)
|
||||||
nummaterials (int): Number of materials present in the model.
|
|
||||||
"""
|
|
||||||
self.updatecoeffsE = np.zeros((nummaterials, 5), dtype=floattype)
|
|
||||||
self.updatecoeffsH = np.zeros((nummaterials, 5), dtype=floattype)
|
|
||||||
|
|
||||||
def initialise_dispersive_arrays(self, nummaterials):
|
def initialise_dispersive_arrays(self):
|
||||||
"""Initialise arrays for storing coefficients when there are dispersive materials present.
|
"""Initialise arrays for storing coefficients when there are dispersive materials present."""
|
||||||
|
|
||||||
Args:
|
|
||||||
nummaterials (int): Number of materials present in the model.
|
|
||||||
"""
|
|
||||||
self.Tx = np.zeros((Material.maxpoles, self.nx, self.ny + 1, self.nz + 1), dtype=complextype)
|
self.Tx = np.zeros((Material.maxpoles, self.nx, self.ny + 1, self.nz + 1), dtype=complextype)
|
||||||
self.Ty = np.zeros((Material.maxpoles, self.nx + 1, self.ny, self.nz + 1), dtype=complextype)
|
self.Ty = np.zeros((Material.maxpoles, self.nx + 1, self.ny, self.nz + 1), dtype=complextype)
|
||||||
self.Tz = np.zeros((Material.maxpoles, self.nx + 1, self.ny + 1, self.nz), dtype=complextype)
|
self.Tz = np.zeros((Material.maxpoles, self.nx + 1, self.ny + 1, self.nz), dtype=complextype)
|
||||||
self.updatecoeffsdispersive = np.zeros((nummaterials, 3 * Material.maxpoles), dtype=complextype)
|
self.updatecoeffsdispersive = np.zeros((len(self.materials), 3 * Material.maxpoles), dtype=complextype)
|
||||||
|
|
||||||
|
|
||||||
def dispersion_check(waveforms, materials, dx, dy, dz):
|
def dispersion_check(waveforms, materials, dx, dy, dz):
|
||||||
|
在新工单中引用
屏蔽一个用户