你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
@@ -64,7 +64,7 @@ class AddGrass(UserObjectGeometry):
|
||||
self.kwargs["p1"] = tuple(rot_pts[0, :])
|
||||
self.kwargs["p2"] = tuple(rot_pts[1, :])
|
||||
|
||||
def build(self, model, uip):
|
||||
def build(self, grid, uip):
|
||||
"""Add Grass to fractal box."""
|
||||
try:
|
||||
p1 = self.kwargs["p1"]
|
||||
@@ -91,7 +91,7 @@ class AddGrass(UserObjectGeometry):
|
||||
self._do_rotate()
|
||||
|
||||
# Get the correct fractal volume
|
||||
volumes = [volume for volume in model.fractalvolumes if volume.ID == fractal_box_id]
|
||||
volumes = [volume for volume in grid.fractalvolumes if volume.ID == fractal_box_id]
|
||||
try:
|
||||
volume = volumes[0]
|
||||
except NameError:
|
||||
@@ -114,7 +114,6 @@ class AddGrass(UserObjectGeometry):
|
||||
raise ValueError
|
||||
|
||||
# Check for valid orientations
|
||||
grid = uip.grid
|
||||
if xs == xf:
|
||||
if ys == yf or zs == zf:
|
||||
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
|
||||
@@ -250,11 +249,11 @@ class AddGrass(UserObjectGeometry):
|
||||
surface.grass.append(g)
|
||||
|
||||
# Check to see if grass has been already defined as a material
|
||||
if not any(x.ID == "grass" for x in model.materials):
|
||||
create_grass(model)
|
||||
if not any(x.ID == "grass" for x in grid.materials):
|
||||
create_grass(grid)
|
||||
|
||||
# Check if time step for model is suitable for using grass
|
||||
grass = next((x for x in model.materials if x.ID == "grass"))
|
||||
grass = next((x for x in grid.materials if x.ID == "grass"))
|
||||
testgrass = next((x for x in grass.tau if x < grid.dt), None)
|
||||
if testgrass:
|
||||
logger.exception(
|
||||
|
@@ -16,8 +16,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import numpy as np
|
||||
from scipy import fftpack
|
||||
|
||||
@@ -34,17 +32,7 @@ class FractalSurface:
|
||||
|
||||
surfaceIDs = ["xminus", "xplus", "yminus", "yplus", "zminus", "zplus"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
xs: float,
|
||||
xf: float,
|
||||
ys: float,
|
||||
yf: float,
|
||||
zs: float,
|
||||
zf: float,
|
||||
dimension: float,
|
||||
seed: Optional[int] = None,
|
||||
):
|
||||
def __init__(self, xs, xf, ys, yf, zs, zf, dimension, seed):
|
||||
"""
|
||||
Args:
|
||||
xs, xf, ys, yf, zs, zf: floats for the extent of the fractal surface
|
||||
@@ -55,9 +43,8 @@ class FractalSurface:
|
||||
seed: int for seed value for random number generator.
|
||||
"""
|
||||
|
||||
self.ID: str
|
||||
self.surfaceID: str
|
||||
self.operatingonID: str
|
||||
self.ID = None
|
||||
self.surfaceID = None
|
||||
self.xs = xs
|
||||
self.xf = xf
|
||||
self.ys = ys
|
||||
@@ -73,7 +60,7 @@ class FractalSurface:
|
||||
dimension # Fractal dimension from: http://dx.doi.org/10.1017/CBO9781139174695
|
||||
)
|
||||
self.weighting = np.array([1, 1], dtype=np.float64)
|
||||
self.fractalrange: Tuple[int, int] = (0, 0)
|
||||
self.fractalrange = (0, 0)
|
||||
self.filldepth = 0
|
||||
self.grass = []
|
||||
|
||||
@@ -154,8 +141,8 @@ class FractalVolume:
|
||||
seed: int for seed value for random number generator.
|
||||
"""
|
||||
|
||||
self.ID: str
|
||||
self.operatingonID: str
|
||||
self.ID = None
|
||||
self.operatingonID = None
|
||||
self.xs = xs
|
||||
self.xf = xf
|
||||
self.ys = ys
|
||||
|
@@ -26,7 +26,6 @@ import numpy as np
|
||||
import psutil
|
||||
from colorama import Fore, Style, init
|
||||
|
||||
from gprMax.fractals import FractalVolume
|
||||
from gprMax.grid.cuda_grid import CUDAGrid
|
||||
from gprMax.grid.opencl_grid import OpenCLGrid
|
||||
from gprMax.materials import ListMaterial, Material, PeplinskiSoil, RangeMaterial
|
||||
@@ -68,7 +67,6 @@ class Model:
|
||||
self.subgrids: List[SubGridBaseGrid] = []
|
||||
|
||||
self.mixingmodels: List[Union[PeplinskiSoil, RangeMaterial, ListMaterial]] = []
|
||||
self.fractalvolumes: List[FractalVolume] = []
|
||||
|
||||
self.geometryviews: List[GeometryView] = []
|
||||
self.geometryobjects: List[GeometryObjects] = []
|
||||
|
在新工单中引用
屏蔽一个用户