你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Update to dispersion analysis for case where there is no waveform in a simulation.
这个提交包含在:
@@ -165,11 +165,11 @@ def dispersion_analysis(G):
|
||||
"""
|
||||
|
||||
# Physical phase velocity error (percentage); grid sampling density; material with maximum permittivity; maximum significant frequency
|
||||
results = {'deltavp': False, 'N': False, 'material': False, 'maxfreq': []}
|
||||
results = {'deltavp': False, 'N': False, 'waveform': True, 'material': False, 'maxfreq': []}
|
||||
|
||||
# Find maximum significant frequency
|
||||
if G.waveforms:
|
||||
for waveform in G.waveforms:
|
||||
|
||||
if waveform.type == 'sine' or waveform.type == 'contsine':
|
||||
results['maxfreq'].append(4 * waveform.freq)
|
||||
|
||||
@@ -208,8 +208,11 @@ def dispersion_analysis(G):
|
||||
freq = np.where((np.amax(power[freqmaxpower::]) - power[freqmaxpower::]) > G.highestfreqthres)[0][0] + 1
|
||||
results['maxfreq'].append(freqs[freq])
|
||||
|
||||
# If waveform is truncated don't do any further analysis
|
||||
else:
|
||||
results['waveformID'] = waveform.ID
|
||||
results['waveform'] = False
|
||||
else:
|
||||
results['waveform'] = False
|
||||
|
||||
if results['maxfreq']:
|
||||
results['maxfreq'] = max(results['maxfreq'])
|
||||
|
@@ -172,8 +172,8 @@ def run_model(args, currentmodelrun, numbermodelruns, inputfile, usernamespace):
|
||||
|
||||
# Check to see if numerical dispersion might be a problem
|
||||
results = dispersion_analysis(G)
|
||||
if 'waveformID' in results:
|
||||
print(Fore.RED + "\nWARNING: Numerical dispersion analysis not carried out as duration of waveform '{}' means it does not fit within specified time window and is therefore being truncated.".format(results['waveformID']) + Style.RESET_ALL)
|
||||
if not results['waveform']:
|
||||
print(Fore.RED + "\nWARNING: Numerical dispersion analysis not carried out as either no waveform detected or waveform does not fit within specified time window and is therefore being truncated." + Style.RESET_ALL)
|
||||
elif results['N'] < G.mingridsampling:
|
||||
raise GeneralError("Non-physical wave propagation: Material '{}' has wavelength sampled by {} cells, less than required minimum for physical wave propagation. Maximum significant frequency estimated as {:g}Hz".format(results['material'].ID, results['N'], results['maxfreq']))
|
||||
elif results['deltavp'] and np.abs(results['deltavp']) > G.maxnumericaldisp:
|
||||
|
在新工单中引用
屏蔽一个用户