你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
set dispersive update methods based on model configuration
这个提交包含在:
@@ -20,6 +20,8 @@ class CPUUpdates:
|
|||||||
|
|
||||||
def __init__(self, G):
|
def __init__(self, G):
|
||||||
self.G = G
|
self.G = G
|
||||||
|
self.dispersive_update_a = None
|
||||||
|
self.dispersive_update_b = None
|
||||||
|
|
||||||
def store_outputs(self, iteration):
|
def store_outputs(self, iteration):
|
||||||
# Store field component values for every receiver and transmission line
|
# Store field component values for every receiver and transmission line
|
||||||
@@ -88,41 +90,22 @@ class CPUUpdates:
|
|||||||
|
|
||||||
# If there are any dispersive materials do 1st part of dispersive update
|
# If there are any dispersive materials do 1st part of dispersive update
|
||||||
# (it is split into two parts as it requires present and updated electric field values).
|
# (it is split into two parts as it requires present and updated electric field values).
|
||||||
elif Material.maxpoles == 1:
|
self.dispersive_update_a(self.G.nx,
|
||||||
update_electric_dispersive_1pole_A(self.G.nx,
|
self.G.ny,
|
||||||
self.G.ny,
|
self.G.nz,
|
||||||
self.G.nz,
|
config.hostinfo['ompthreads'],
|
||||||
config.hostinfo['ompthreads'],
|
self.G.updatecoeffsE,
|
||||||
self.G.updatecoeffsE,
|
self.G.updatecoeffsdispersive,
|
||||||
self.G.updatecoeffsdispersive,
|
self.G.ID,
|
||||||
self.G.ID,
|
self.G.Tx,
|
||||||
self.G.Tx,
|
self.G.Ty,
|
||||||
self.G.Ty,
|
self.G.Tz,
|
||||||
self.G.Tz,
|
self.G.Ex,
|
||||||
self.G.Ex,
|
self.G.Ey,
|
||||||
self.G.Ey,
|
self.G.Ez,
|
||||||
self.G.Ez,
|
self.G.Hx,
|
||||||
self.G.Hx,
|
self.G.Hy,
|
||||||
self.G.Hy,
|
self.G.Hz)
|
||||||
self.G.Hz)
|
|
||||||
elif Material.maxpoles > 1:
|
|
||||||
update_electric_dispersive_multipole_A(self.G.nx,
|
|
||||||
self.G.ny,
|
|
||||||
self.G.nz,
|
|
||||||
config.hostinfo['ompthreads'],
|
|
||||||
Material.maxpoles,
|
|
||||||
self.G.updatecoeffsE,
|
|
||||||
self.G.updatecoeffsdispersive,
|
|
||||||
self.G.ID,
|
|
||||||
self.G.Tx,
|
|
||||||
self.G.Ty,
|
|
||||||
self.G.Tz,
|
|
||||||
self.G.Ex,
|
|
||||||
self.G.Ey,
|
|
||||||
self.G.Ez,
|
|
||||||
self.G.Hx,
|
|
||||||
self.G.Hy,
|
|
||||||
self.G.Hz)
|
|
||||||
|
|
||||||
def update_electric_pml(self):
|
def update_electric_pml(self):
|
||||||
# Update electric field components with the PML correction
|
# Update electric field components with the PML correction
|
||||||
@@ -139,33 +122,31 @@ class CPUUpdates:
|
|||||||
# (it is split into two parts as it requires present and updated electric
|
# (it is split into two parts as it requires present and updated electric
|
||||||
# field values). Therefore it can only be completely updated after the
|
# field values). Therefore it can only be completely updated after the
|
||||||
# electric field has been updated by the PML and source updates.
|
# electric field has been updated by the PML and source updates.
|
||||||
if Material.maxpoles == 1:
|
update_e_dispersive_b(self.G.nx,
|
||||||
update_electric_dispersive_1pole_B(self.G.nx,
|
self.G.ny,
|
||||||
self.G.ny,
|
self.G.nz,
|
||||||
self.G.nz,
|
config.hostinfo['ompthreads'],
|
||||||
config.hostinfo['ompthreads'],
|
Material.maxpoles,
|
||||||
self.G.updatecoeffsdispersive,
|
self.G.updatecoeffsdispersive,
|
||||||
self.G.ID,
|
self.G.ID,
|
||||||
self.G.Tx,
|
self.G.Tx,
|
||||||
self.G.Ty,
|
self.G.Ty,
|
||||||
self.G.Tz,
|
self.G.Tz,
|
||||||
self.G.Ex,
|
self.G.Ex,
|
||||||
self.G.Ey,
|
self.G.Ey,
|
||||||
self.G.Ez)
|
self.G.Ez)
|
||||||
elif Material.maxpoles > 1:
|
|
||||||
update_electric_dispersive_multipole_B(self.G.nx,
|
def set_dispersive_updates(self, model_config):
|
||||||
self.G.ny,
|
"""Function to set dispersive update functions based on model."""
|
||||||
self.G.nz,
|
update_f = 'update_electric_dispersive_{}pole_{}_{}_{}'
|
||||||
config.hostinfo['ompthreads'],
|
disp_a = update_f.format(model_config.poles, 'A', model_config.precision, model_config.dispersion_type)
|
||||||
Material.maxpoles,
|
disp_b = update_f.format(model_config.poles, 'B', model_config.precision, model_config.dispersion_type)
|
||||||
self.G.updatecoeffsdispersive,
|
|
||||||
self.G.ID,
|
disp_a_f = getattr(import_module('.cython.fields_updates_dispersive'), disp_a)
|
||||||
self.G.Tx,
|
disp_b_f = getattr(import_module('.cython.fields_updates_dispersive'), disp_b)
|
||||||
self.G.Ty,
|
|
||||||
self.G.Tz,
|
self.dispersive_update_a = disp_a_f
|
||||||
self.G.Ex,
|
self.dispersive_update_b = disp_b_f
|
||||||
self.G.Ey,
|
|
||||||
self.G.Ez)
|
|
||||||
|
|
||||||
|
|
||||||
class SubgridUpdates:
|
class SubgridUpdates:
|
||||||
|
在新工单中引用
屏蔽一个用户