你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Ensure the same four component materials form the same ID.
这个提交包含在:
@@ -53,17 +53,22 @@ cpdef void create_electric_average(
|
||||
G: FDTDGrid class describing a grid in a model.
|
||||
"""
|
||||
|
||||
# Make an ID composed of the names of the four materials that will be averaged
|
||||
requiredID = (G.materials[numID1].ID + '+' + G.materials[numID2].ID + '+' +
|
||||
G.materials[numID3].ID + '+' + G.materials[numID4].ID)
|
||||
# Make an ID composed of the names of the four materials that will
|
||||
# be averaged. Sort the names to ensure the same four component
|
||||
# materials always form the same ID.
|
||||
requiredID = "+".join(
|
||||
sorted(
|
||||
[
|
||||
G.materials[numID1].ID,
|
||||
G.materials[numID2].ID,
|
||||
G.materials[numID3].ID,
|
||||
G.materials[numID4].ID,
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
# Check if this material already exists
|
||||
tmp = requiredID.split('+')
|
||||
material = [x for x in G.materials if
|
||||
x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and
|
||||
x.ID.count(tmp[1]) == requiredID.count(tmp[1]) and
|
||||
x.ID.count(tmp[2]) == requiredID.count(tmp[2]) and
|
||||
x.ID.count(tmp[3]) == requiredID.count(tmp[3])]
|
||||
material = [x for x in G.materials if x.ID == requiredID]
|
||||
|
||||
if material:
|
||||
G.ID[componentID, i, j, k] = material[0].numID
|
||||
|
在新工单中引用
屏蔽一个用户