你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Made changes to the reformatted code as per the suggestions given.
这个提交包含在:
@@ -178,8 +178,8 @@ def write_processed_file(processedlines):
|
||||
for item in processedlines:
|
||||
f.write(f'{item}')
|
||||
|
||||
logger.info(f'Written input commands, after processing any Python code and '
|
||||
f'include commands, to file: {processedfile}\n')
|
||||
logger.info(f'Written input commands, after processing any Python ' +
|
||||
f'code and include commands, to file: {processedfile}\n')
|
||||
|
||||
|
||||
def check_cmd_names(processedlines, checkessential=True):
|
||||
|
@@ -55,7 +55,7 @@ def process_singlecmds(singlecmds):
|
||||
if singlecmds[cmd] is not None:
|
||||
tmp = tuple(int(x) for x in singlecmds[cmd].split())
|
||||
if len(tmp) != 1:
|
||||
logger.exception(f'{cmd} requires exactly one parameter to specify '
|
||||
logger.exception(f'{cmd} requires exactly one parameter to specify ' +
|
||||
f'the number of CPU OpenMP threads to use')
|
||||
raise ValueError
|
||||
|
||||
@@ -94,7 +94,7 @@ def process_singlecmds(singlecmds):
|
||||
if singlecmds[cmd] is not None:
|
||||
tmp = singlecmds[cmd].split()
|
||||
if len(tmp) != 1:
|
||||
logger.exception(f'{cmd} requires exactly one parameter to specify the '
|
||||
logger.exception(f'{cmd} requires exactly one parameter to specify the ' +
|
||||
f'time window. Either in seconds or number of iterations.')
|
||||
raise ValueError
|
||||
tmp = tmp[0].lower()
|
||||
|
@@ -884,27 +884,19 @@ class OpenCLUpdates:
|
||||
knl_electric_name = getattr(knl_pml_updates_electric, knl_name)
|
||||
knl_magnetic_name = getattr(knl_pml_updates_magnetic, knl_name)
|
||||
|
||||
pml.update_electric_dev = self.elwise(
|
||||
self.ctx,
|
||||
knl_electric_name['args_opencl'].substitute(
|
||||
{'REAL': config.sim_config.dtypes['C_float_or_double']}
|
||||
),
|
||||
knl_electric_name['func'].substitute(subs),
|
||||
f'pml_updates_electric_{knl_name}',
|
||||
preamble=self.knl_common,
|
||||
options=config.sim_config.devices['compiler_opts'],
|
||||
)
|
||||
pml.update_electric_dev = self.elwise(self.ctx,
|
||||
knl_electric_name['args_opencl'].substitute({'REAL': config.sim_config.dtypes['C_float_or_double']}),
|
||||
knl_electric_name['func'].substitute(subs),
|
||||
'pml_updates_electric_' + knl_name,
|
||||
preamble=self.knl_common,
|
||||
options=config.sim_config.devices['compiler_opts'])
|
||||
|
||||
pml.update_magnetic_dev = self.elwise(
|
||||
self.ctx,
|
||||
knl_magnetic_name['args_opencl'].substitute(
|
||||
{'REAL': config.sim_config.dtypes['C_float_or_double']}
|
||||
),
|
||||
knl_magnetic_name['func'].substitute(subs),
|
||||
f'pml_updates_magnetic_{knl_name}',
|
||||
preamble=self.knl_common,
|
||||
options=config.sim_config.devices['compiler_opts'],
|
||||
)
|
||||
pml.update_magnetic_dev = self.elwise(self.ctx,
|
||||
knl_magnetic_name['args_opencl'].substitute({'REAL': config.sim_config.dtypes['C_float_or_double']}),
|
||||
knl_magnetic_name['func'].substitute(subs),
|
||||
'pml_updates_magnetic_' + knl_name,
|
||||
preamble=self.knl_common,
|
||||
options=config.sim_config.devices['compiler_opts'])
|
||||
|
||||
def _set_rx_knl(self):
|
||||
"""Receivers - initialises arrays on compute device, prepares kernel and
|
||||
|
在新工单中引用
屏蔽一个用户