你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
PEP8 code cleanups.
这个提交包含在:
@@ -28,9 +28,11 @@ np.seterr(invalid='raise')
|
||||
from gprMax.constants import c
|
||||
from gprMax.constants import floattype
|
||||
from gprMax.constants import complextype
|
||||
from gprMax.exceptions import GeneralError
|
||||
from gprMax.materials import Material
|
||||
from gprMax.pml import PML
|
||||
from gprMax.utilities import fft_power
|
||||
from gprMax.utilities import human_size
|
||||
from gprMax.utilities import round_value
|
||||
|
||||
|
||||
@@ -234,8 +236,8 @@ class FDTDGrid(Grid):
|
||||
# Check if model can be run on specified GPU if required
|
||||
if self.gpu is not None:
|
||||
if self.memoryusage > self.gpu.totalmem:
|
||||
if snapmemsize != 0:
|
||||
G.snapsgpu2cpu = True
|
||||
if snapsmemsize != 0:
|
||||
self.snapsgpu2cpu = True
|
||||
else:
|
||||
raise GeneralError('Memory (RAM) required ~{} exceeds {} detected on specified {} - {} GPU!\n'.format(human_size(self.memoryusage), human_size(self.gpu.totalmem, a_kilobyte_is_1024_bytes=True), self.gpu.deviceID, self.gpu.name))
|
||||
|
||||
|
@@ -282,7 +282,7 @@ class PeplinskiSoil(object):
|
||||
erealw = Material.watereri + ((Material.waterdeltaer) / (1 + (w * Material.watertau)**2))
|
||||
|
||||
a = 0.65 # Experimentally derived constant
|
||||
es = (1.01 + 0.44 * self.rs)**2 - 0.062 # Relative permittivity of sand particles
|
||||
es = (1.01 + 0.44 * self.rs)**2 - 0.062 # Relative permittivity of sand particles
|
||||
b1 = 1.2748 - 0.519 * self.S - 0.152 * self.C
|
||||
b2 = 1.33797 - 0.603 * self.S - 0.166 * self.C
|
||||
|
||||
|
@@ -174,7 +174,7 @@ def gpu_initialise_snapshot_array(G):
|
||||
G (class): Grid class instance - holds essential parameters describing the model.
|
||||
|
||||
Returns:
|
||||
snapE*_gpu, snapH*_gpu (float): numpy arrays of snapshot data on GPU.
|
||||
snapE_gpu, snapH_gpu (float): numpy arrays of snapshot data on GPU.
|
||||
"""
|
||||
|
||||
import pycuda.gpuarray as gpuarray
|
||||
|
@@ -392,4 +392,3 @@ def detect_gpus():
|
||||
print('GPU(s) detected: {}'.format(' | '.join(gputext)))
|
||||
|
||||
return gpus
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户