你已经派生过 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):
|
def update_previous_timestep_fields(self, field_names):
|
||||||
for fn in field_names:
|
for fn in field_names:
|
||||||
val = getattr(self, fn + '_1')
|
val = getattr(self, f'{fn}_1')
|
||||||
val_c = np.copy(val)
|
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):
|
def interpolate_to_sub_grid(self, field, coords):
|
||||||
x, z, x_sg, z_sg = coords
|
x, z, x_sg, z_sg = coords
|
||||||
|
@@ -36,7 +36,7 @@ def create_updates(G):
|
|||||||
elif sg_type == SubGridHSG and not sg.filter:
|
elif sg_type == SubGridHSG and not sg.filter:
|
||||||
precursors = PrecursorNodes(G, sg)
|
precursors = PrecursorNodes(G, sg)
|
||||||
else:
|
else:
|
||||||
logger.exception(str(sg) + ' is not a subgrid type')
|
logger.exception(f'{str(sg)} is not a subgrid type')
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
sgu = SubgridUpdater(sg, precursors, G)
|
sgu = SubgridUpdater(sg, precursors, G)
|
||||||
|
@@ -45,7 +45,7 @@ class SubGridBase(UserObjectMulti):
|
|||||||
elif isinstance(node, UserObjectGeometry):
|
elif isinstance(node, UserObjectGeometry):
|
||||||
self.children_geometry.append(node)
|
self.children_geometry.append(node)
|
||||||
else:
|
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
|
raise ValueError
|
||||||
|
|
||||||
def set_discretisation(self, sg, grid):
|
def set_discretisation(self, sg, grid):
|
||||||
@@ -123,12 +123,16 @@ class SubGridBase(UserObjectMulti):
|
|||||||
self.subgrid = sg
|
self.subgrid = sg
|
||||||
|
|
||||||
# Copy over built in materials
|
# 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
|
# Don't mix and match different subgrid types
|
||||||
for sg_made in grid.subgrids:
|
for sg_made in grid.subgrids:
|
||||||
if type(sg) != type(sg_made):
|
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
|
raise ValueError
|
||||||
|
|
||||||
# Reference the subgrid under the main grid to which it belongs
|
# Reference the subgrid under the main grid to which it belongs
|
||||||
|
在新工单中引用
屏蔽一个用户