你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Reformatted some code in a few more files.
这个提交包含在:
@@ -218,9 +218,9 @@ class PrecursorNodesBase:
|
||||
|
||||
def update_previous_timestep_fields(self, field_names):
|
||||
for fn in field_names:
|
||||
val = getattr(self, fn + '_1')
|
||||
val = getattr(self, f'{fn}_1')
|
||||
val_c = np.copy(val)
|
||||
setattr(self, fn + '_0', val_c)
|
||||
setattr(self, f'{fn}_0', val_c)
|
||||
|
||||
def interpolate_to_sub_grid(self, field, coords):
|
||||
x, z, x_sg, z_sg = coords
|
||||
|
@@ -36,7 +36,7 @@ def create_updates(G):
|
||||
elif sg_type == SubGridHSG and not sg.filter:
|
||||
precursors = PrecursorNodes(G, sg)
|
||||
else:
|
||||
logger.exception(str(sg) + ' is not a subgrid type')
|
||||
logger.exception(f'{str(sg)} is not a subgrid type')
|
||||
raise ValueError
|
||||
|
||||
sgu = SubgridUpdater(sg, precursors, G)
|
||||
|
@@ -45,7 +45,7 @@ class SubGridBase(UserObjectMulti):
|
||||
elif isinstance(node, UserObjectGeometry):
|
||||
self.children_geometry.append(node)
|
||||
else:
|
||||
logger.exception(str(node) + ' this Object can not be added to a sub grid')
|
||||
logger.exception(f'{str(node)} this Object can not be added to a sub grid')
|
||||
raise ValueError
|
||||
|
||||
def set_discretisation(self, sg, grid):
|
||||
@@ -123,12 +123,16 @@ class SubGridBase(UserObjectMulti):
|
||||
self.subgrid = sg
|
||||
|
||||
# Copy over built in materials
|
||||
sg.materials = [copy(m) for m in grid.materials if m.numID in range(0, grid.n_built_in_materials + 1)]
|
||||
sg.materials = [
|
||||
copy(m)
|
||||
for m in grid.materials
|
||||
if m.numID in range(grid.n_built_in_materials + 1)
|
||||
]
|
||||
|
||||
# Don't mix and match different subgrid types
|
||||
for sg_made in grid.subgrids:
|
||||
if type(sg) != type(sg_made):
|
||||
logger.exception(self.__str__() + ' please only use one type of subgrid')
|
||||
logger.exception(f'{self.__str__()} please only use one type of subgrid')
|
||||
raise ValueError
|
||||
|
||||
# Reference the subgrid under the main grid to which it belongs
|
||||
|
在新工单中引用
屏蔽一个用户