你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
report box geometry in subgrid relative to main grid
这个提交包含在:
@@ -91,9 +91,12 @@ class Box(UserObjectGeometry):
|
||||
# if they havent specfied - go with the grid default
|
||||
averagebox = grid.averagevolumeobjects
|
||||
|
||||
p1, p2 = uip.check_box_points(p1, p2, self.__str__())
|
||||
xs, ys, zs = p1
|
||||
xf, yf, zf = p2
|
||||
p3, p4 = uip.check_box_points(p1, p2, self.__str__())
|
||||
# find nearest point on grid without translation
|
||||
p5 = uip.round_to_grid_static_point(p1)
|
||||
p6 = uip.round_to_grid_static_point(p2)
|
||||
xs, ys, zs = p3
|
||||
xf, yf, zf = p4
|
||||
|
||||
# Look up requested materials in existing list of material instances
|
||||
materials = [y for x in materialsrequested for y in grid.materials if y.ID == x]
|
||||
@@ -134,4 +137,5 @@ class Box(UserObjectGeometry):
|
||||
build_box(xs, xf, ys, yf, zs, zf, numID, numIDx, numIDy, numIDz, averaging, grid.solid, grid.rigidE, grid.rigidH, grid.ID)
|
||||
|
||||
dielectricsmoothing = 'on' if averaging else 'off'
|
||||
logger.info(self.grid_name(grid) + f"Box from {xs * grid.dx:g}m, {ys * grid.dy:g}m, {zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, {zf * grid.dz:g}m of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.")
|
||||
|
||||
logger.info(self.grid_name(grid) + f"Box from {p5[0]:g}m, {p5[1]:g}m, {p5[2]:g}m, to {p6[0]:g}m, {p6[1]:g}m, {p6[2]:g}m of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.")
|
||||
|
@@ -126,6 +126,11 @@ class MainGridUserInput(UserInput):
|
||||
"""Function to get the index of a continuous point regardless of the point of origin of the grid."""
|
||||
return super().discretise_point(p)
|
||||
|
||||
def round_to_grid_static_point(self, p):
|
||||
"""Function to get the index of a continuous point regardless of the point of origin of the grid."""
|
||||
return super().discretise_point(p) * self.grid.dl
|
||||
|
||||
|
||||
class SubgridUserInput(MainGridUserInput):
|
||||
"""Class to handle (x, y, z) points supplied by the user in the sub grid.
|
||||
This class autotranslates points from main grid to subgrid equivalent
|
||||
@@ -183,3 +188,8 @@ class SubgridUserInput(MainGridUserInput):
|
||||
"""Function to get the index of a continuous point regardless of the point of origin of the grid."""
|
||||
return super().discretise_point(p)
|
||||
|
||||
def round_to_grid_static_point(self, p):
|
||||
"""Function to get the index of a continuous point regardless of the point of origin of the grid."""
|
||||
return super().discretise_point(p) * self.grid.dl
|
||||
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户