你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 20:46:52 +08:00
Removed unnecessary argument from fractal surface and volume class methods.
这个提交包含在:
@@ -56,12 +56,8 @@ class FractalSurface(object):
|
||||
self.filldepth = 0
|
||||
self.grass = []
|
||||
|
||||
def generate_fractal_surface(self, G):
|
||||
"""Generate a 2D array with a fractal distribution.
|
||||
|
||||
Args:
|
||||
G (class): Grid class instance - holds essential parameters describing the model.
|
||||
"""
|
||||
def generate_fractal_surface(self):
|
||||
"""Generate a 2D array with a fractal distribution."""
|
||||
|
||||
if self.xs == self.xf:
|
||||
surfacedims = (self.ny + 1, self.nz + 1)
|
||||
@@ -134,12 +130,8 @@ class FractalVolume(object):
|
||||
self.nbins = 0
|
||||
self.fractalsurfaces = []
|
||||
|
||||
def generate_fractal_volume(self, G):
|
||||
"""Generate a 3D volume with a fractal distribution.
|
||||
|
||||
Args:
|
||||
G (class): Grid class instance - holds essential parameters describing the model.
|
||||
"""
|
||||
def generate_fractal_volume(self):
|
||||
"""Generate a 3D volume with a fractal distribution."""
|
||||
|
||||
self.fractalvolume = np.zeros((self.nx + 1, self.ny + 1, self.nz + 1), dtype=complextype)
|
||||
|
||||
|
@@ -981,7 +981,7 @@ def process_geometrycmds(geometry, G):
|
||||
if surface.surfaceID in existingsurfaceIDs:
|
||||
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' has already been used on the {} surface'.format(surface.surfaceID))
|
||||
|
||||
surface.generate_fractal_surface(G)
|
||||
surface.generate_fractal_surface()
|
||||
volume.fractalsurfaces.append(surface)
|
||||
|
||||
if G.messages:
|
||||
@@ -1191,7 +1191,7 @@ def process_geometrycmds(geometry, G):
|
||||
# Set the fractal range to scale the fractal distribution between zero and one
|
||||
surface.fractalrange = (0, 1)
|
||||
surface.operatingonID = volume.ID
|
||||
surface.generate_fractal_surface(G)
|
||||
surface.generate_fractal_surface()
|
||||
if numblades > surface.fractalsurface.shape[0] * surface.fractalsurface.shape[1]:
|
||||
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the specified surface is not large enough for the number of grass blades/roots specified')
|
||||
|
||||
@@ -1287,7 +1287,7 @@ def process_geometrycmds(geometry, G):
|
||||
materialnumID = next(x.numID for x in G.materials if x.ID == volume.operatingonID)
|
||||
volume.fractalvolume *= materialnumID
|
||||
else:
|
||||
volume.generate_fractal_volume(G)
|
||||
volume.generate_fractal_volume()
|
||||
volume.fractalvolume += mixingmodel.startmaterialnum
|
||||
|
||||
volume.generate_volume_mask()
|
||||
@@ -1500,7 +1500,7 @@ def process_geometrycmds(geometry, G):
|
||||
if volume.nbins == 1:
|
||||
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' is being used with a single material and no modifications, therefore please use a #box command instead.')
|
||||
else:
|
||||
volume.generate_fractal_volume(G)
|
||||
volume.generate_fractal_volume()
|
||||
volume.fractalvolume += mixingmodel.startmaterialnum
|
||||
|
||||
data = volume.fractalvolume.astype('int16', order='C')
|
||||
|
在新工单中引用
屏蔽一个用户