你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 15:27:57 +08:00
PEP8 code cleanups.
这个提交包含在:
@@ -217,17 +217,17 @@ class MagneticDipole(Source):
|
||||
|
||||
def gpu_initialise_src_arrays(sources, G):
|
||||
"""Initialise arrays on GPU for source coordinates/polarisation, other source information, and source waveform values.
|
||||
|
||||
|
||||
Args:
|
||||
sources (list): List of sources of one class, e.g. HertzianDipoles.
|
||||
G (class): Grid class instance - holds essential parameters describing the model.
|
||||
|
||||
|
||||
Returns:
|
||||
srcinfo1_gpu (int): numpy array of source cell coordinates and polarisation information.
|
||||
srcinfo2_gpu (float): numpy array of other source information, e.g. length, resistance etc...
|
||||
srcwaves_gpu (float): numpy array of source waveform values.
|
||||
"""
|
||||
|
||||
|
||||
import pycuda.gpuarray as gpuarray
|
||||
|
||||
srcinfo1 = np.zeros((len(sources), 4), dtype=np.int32)
|
||||
@@ -237,14 +237,14 @@ def gpu_initialise_src_arrays(sources, G):
|
||||
srcinfo1[i, 0] = src.xcoord
|
||||
srcinfo1[i, 1] = src.ycoord
|
||||
srcinfo1[i, 2] = src.zcoord
|
||||
|
||||
|
||||
if src.polarisation == 'x':
|
||||
srcinfo1[i, 3] = 0
|
||||
elif src.polarisation == 'y':
|
||||
srcinfo1[i, 3] = 1
|
||||
elif src.polarisation == 'z':
|
||||
srcinfo1[i, 3] = 2
|
||||
|
||||
|
||||
if src.__class__.__name__ == 'HertzianDipole':
|
||||
srcinfo2[i] = src.dl
|
||||
srcwaves[i, :] = src.waveformvaluesJ
|
||||
@@ -253,7 +253,7 @@ def gpu_initialise_src_arrays(sources, G):
|
||||
srcwaves[i, :] = src.waveformvaluesJ
|
||||
elif src.__class__.__name__ == 'MagneticDipole':
|
||||
srcwaves[i, :] = src.waveformvaluesM
|
||||
|
||||
|
||||
srcinfo1_gpu = gpuarray.to_gpu(srcinfo1)
|
||||
srcinfo2_gpu = gpuarray.to_gpu(srcinfo2)
|
||||
srcwaves_gpu = gpuarray.to_gpu(srcwaves)
|
||||
|
在新工单中引用
屏蔽一个用户