你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Updated logging.
这个提交包含在:
@@ -50,7 +50,6 @@ class UserObjectMulti:
|
||||
self.hash = '#example'
|
||||
self.autotranslate = True
|
||||
|
||||
|
||||
def __str__(self):
|
||||
"""Readable user string as per hash commands."""
|
||||
s = ''
|
||||
@@ -232,11 +231,11 @@ class HertzianDipole(UserObjectMulti):
|
||||
# Check polarity & position parameters
|
||||
if polarisation not in ('x', 'y', 'z'):
|
||||
raise CmdInputError(f"'{self.params_str()}' polarisation must be x, y, or z")
|
||||
if '2D TMx' in grid.mode and (polarisation == 'y' or polarisation == 'z'):
|
||||
if '2D TMx' in config.get_model_config().mode and (polarisation == 'y' or polarisation == 'z'):
|
||||
raise CmdInputError(f"'{self.params_str()}' polarisation must be x in 2D TMx mode")
|
||||
elif '2D TMy' in grid.mode and (polarisation == 'x' or polarisation == 'z'):
|
||||
elif '2D TMy' in config.get_model_config().mode and (polarisation == 'x' or polarisation == 'z'):
|
||||
raise CmdInputError(f"'{self.params_str()}' polarisation must be y in 2D TMy mode")
|
||||
elif '2D TMz' in grid.mode and (polarisation == 'x' or polarisation == 'y'):
|
||||
elif '2D TMz' in config.get_model_config().mode and (polarisation == 'x' or polarisation == 'y'):
|
||||
raise CmdInputError(f"'{self.params_str()}' polarisation must be z in 2D TMz mode")
|
||||
|
||||
xcoord, ycoord, zcoord = uip.check_src_rx_point(p1, self.params_str())
|
||||
@@ -288,7 +287,7 @@ class HertzianDipole(UserObjectMulti):
|
||||
|
||||
h.calculate_waveform_values(grid)
|
||||
|
||||
if grid.mode == '2D':
|
||||
if config.get_model_config().mode == '2D':
|
||||
logger.info(f'Hertzian dipole is a line source in 2D with polarity {h.polarisation} at {h.xcoord * grid.dx:g}m, {h.ycoord * grid.dy:g}m, {h.zcoord * grid.dz:g}m,' + startstop + f'using waveform {h.waveformID} created.')
|
||||
else:
|
||||
logger.info(f'Hertzian dipole with polarity {h.polarisation} at {h.xcoord * grid.dx:g}m, {h.ycoord * grid.dy:g}m, {h.zcoord * grid.dz:g}m,' + startstop + f'using waveform {h.waveformID} created.')
|
||||
|
@@ -255,12 +255,12 @@ class ModelBuildRun:
|
||||
|
||||
# Check number of OpenMP threads
|
||||
if config.sim_config.general['cpu']:
|
||||
logger.basic(f'CPU (OpenMP) solver: {config.get_model_config().ompthreads} thread(s) on {platform.node()}\n')
|
||||
logger.basic(f'CPU solver using: {config.get_model_config().ompthreads} OpenMP thread(s) on {platform.node()}\n')
|
||||
if config.get_model_config().ompthreads > config.sim_config.hostinfo['physicalcores']:
|
||||
logger.warning(Fore.RED + f"You have specified more threads ({config.get_model_config().ompthreads}) than available physical CPU cores ({config.sim_config.hostinfo['physicalcores']}). This may lead to degraded performance." + Style.RESET_ALL)
|
||||
# Print information about any GPU in use
|
||||
elif config.sim_config.general['cuda']:
|
||||
logger.basic(f"GPU solver: {config.get_model_config().cuda['gpu'].deviceID} - {config.get_model_config().cuda['gpu'].name} on {platform.node()}\n")
|
||||
logger.basic(f"GPU solver using: {config.get_model_config().cuda['gpu'].deviceID} - {config.get_model_config().cuda['gpu'].name} on {platform.node()}\n")
|
||||
|
||||
# Prepare iterator
|
||||
if config.sim_config.general['progressbars']:
|
||||
|
在新工单中引用
屏蔽一个用户