你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Updated dispersion check function to return the spatial resolution of the minimum wavelength in the model.
这个提交包含在:
@@ -99,9 +99,12 @@ def dispersion_check(G):
|
|||||||
G (class): Grid class instance - holds essential parameters describing the model.
|
G (class): Grid class instance - holds essential parameters describing the model.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
(boolean): Potential numerical dispersion
|
resolution (float): Potential numerical dispersion
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Minimum number of spatial steps to resolve smallest wavelength
|
||||||
|
resolvedsteps = 10
|
||||||
|
|
||||||
# Find maximum frequency
|
# Find maximum frequency
|
||||||
maxfreqs = []
|
maxfreqs = []
|
||||||
for waveform in G.waveforms:
|
for waveform in G.waveforms:
|
||||||
@@ -137,25 +140,21 @@ def dispersion_check(G):
|
|||||||
|
|
||||||
# Find minimum wavelength
|
# Find minimum wavelength
|
||||||
ers = [material.er for material in G.materials]
|
ers = [material.er for material in G.materials]
|
||||||
miner = max(ers)
|
maxer = max(ers)
|
||||||
|
|
||||||
# Minimum velocity
|
# Minimum velocity
|
||||||
minvelocity = c / np.sqrt(miner)
|
minvelocity = c / np.sqrt(maxer)
|
||||||
|
|
||||||
# Minimum number of spatial steps to resolve smallest wavelength
|
|
||||||
resolution = 10
|
|
||||||
|
|
||||||
# Minimum wavelength
|
# Minimum wavelength
|
||||||
minwavelength = minvelocity / maxfreq
|
minwavelength = minvelocity / maxfreq
|
||||||
|
|
||||||
# Test for numerical dispersion
|
# Resolution of minimum wavelength
|
||||||
if max((G.dx, G.dy, G.dz)) > (minwavelength / resolution):
|
resolution = minwavelength / resolvedsteps
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return False
|
resolution = 0
|
||||||
|
|
||||||
|
return resolution
|
||||||
|
|
||||||
|
|
||||||
def get_other_directions(direction):
|
def get_other_directions(direction):
|
||||||
|
在新工单中引用
屏蔽一个用户