你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-05 20:16:52 +08:00
Merge pull request #417 from ThomasRigoni7/peplinski_soil_materials_name_fix
fixed material index mismatch between Grid.solid and materials list
这个提交包含在:
@@ -867,7 +867,7 @@ def process_geometrycmds(geometry, G):
|
|||||||
if nbins == 1:
|
if nbins == 1:
|
||||||
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' must be used with more than one material from the mixing model.')
|
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' must be used with more than one material from the mixing model.')
|
||||||
# Create materials from mixing model as number of bins now known from fractal_box command
|
# Create materials from mixing model as number of bins now known from fractal_box command
|
||||||
mixingmodel.calculate_debye_properties(nbins, G)
|
mixingmodel.calculate_debye_properties(nbins, G, tmp[13])
|
||||||
elif not material:
|
elif not material:
|
||||||
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' mixing model or material with ID {} does not exist'.format(tmp[12]))
|
raise CmdInputError("'" + ' '.join(tmp) + "'" + ' mixing model or material with ID {} does not exist'.format(tmp[12]))
|
||||||
|
|
||||||
|
@@ -266,7 +266,7 @@ class PeplinskiSoil(object):
|
|||||||
self.mu = watervolfraction
|
self.mu = watervolfraction
|
||||||
self.startmaterialnum = 0
|
self.startmaterialnum = 0
|
||||||
|
|
||||||
def calculate_debye_properties(self, nbins, G):
|
def calculate_debye_properties(self, nbins, G, fractalboxname):
|
||||||
"""
|
"""
|
||||||
Calculates the real and imaginery part of a Debye model for the soil as
|
Calculates the real and imaginery part of a Debye model for the soil as
|
||||||
well as a conductivity. It uses an approximation to a semi-empirical model (http://dx.doi.org/10.1109/36.387598).
|
well as a conductivity. It uses an approximation to a semi-empirical model (http://dx.doi.org/10.1109/36.387598).
|
||||||
@@ -274,7 +274,9 @@ class PeplinskiSoil(object):
|
|||||||
Args:
|
Args:
|
||||||
nbins (int): Number of bins to use to create the different materials.
|
nbins (int): Number of bins to use to create the different materials.
|
||||||
G (class): Grid class instance - holds essential parameters describing the model.
|
G (class): Grid class instance - holds essential parameters describing the model.
|
||||||
|
fractalboxname (str): Name of the fractal box for which the materials are being created.
|
||||||
"""
|
"""
|
||||||
|
self.startmaterialnum = len(G.materials)
|
||||||
|
|
||||||
# Debye model properties of water
|
# Debye model properties of water
|
||||||
f = 1.3e9
|
f = 1.3e9
|
||||||
@@ -311,24 +313,17 @@ class PeplinskiSoil(object):
|
|||||||
sig = muiter[0]**(b2 / a) * ((sigf * (self.rs - self.rb)) / (self.rs * muiter[0]))
|
sig = muiter[0]**(b2 / a) * ((sigf * (self.rs - self.rb)) / (self.rs * muiter[0]))
|
||||||
|
|
||||||
# Check to see if the material already exists before creating a new one
|
# Check to see if the material already exists before creating a new one
|
||||||
requiredID = '|{:.4f}|'.format(float(muiter[0]))
|
materialID = '|{:.4f}_{}|'.format(float(muiter[0]), fractalboxname)
|
||||||
material = next((x for x in G.materials if x.ID == requiredID), None)
|
m = Material(len(G.materials), materialID)
|
||||||
if muiter.index == 0:
|
m.type = 'debye'
|
||||||
if material:
|
m.averagable = False
|
||||||
self.startmaterialnum = material.numID
|
m.poles = 1
|
||||||
else:
|
if m.poles > Material.maxpoles:
|
||||||
self.startmaterialnum = len(G.materials)
|
Material.maxpoles = m.poles
|
||||||
if not material:
|
m.er = eri
|
||||||
m = Material(len(G.materials), requiredID)
|
m.se = sig
|
||||||
m.type = 'debye'
|
m.deltaer.append(er - eri)
|
||||||
m.averagable = False
|
m.tau.append(Material.watertau)
|
||||||
m.poles = 1
|
G.materials.append(m)
|
||||||
if m.poles > Material.maxpoles:
|
|
||||||
Material.maxpoles = m.poles
|
|
||||||
m.er = eri
|
|
||||||
m.se = sig
|
|
||||||
m.deltaer.append(er - eri)
|
|
||||||
m.tau.append(Material.watertau)
|
|
||||||
G.materials.append(m)
|
|
||||||
|
|
||||||
muiter.iternext()
|
muiter.iternext()
|
||||||
|
在新工单中引用
屏蔽一个用户