PAL16202,16203 (Propagation 1D on edges group)

1) fix error message when Mesh.Compute() fails due to bad hypo definition
   2) fix args of TreatHypoStatus() calls
This commit is contained in:
eap 2007-11-07 10:08:39 +00:00
parent 65bad49375
commit 0a33c4aa98

View File

@ -482,7 +482,7 @@ class Mesh_Algorithm:
self.algo = algo self.algo = algo
status = mesh.mesh.AddHypothesis(self.geom, self.algo) status = mesh.mesh.AddHypothesis(self.geom, self.algo)
TreatHypoStatus( status, algo.GetName(), GetName(algo), True ) TreatHypoStatus( status, algo.GetName(), GetName(self.geom), True )
## Private method ## Private method
def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so", UseExisting=0): def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so", UseExisting=0):
@ -508,7 +508,7 @@ class Mesh_Algorithm:
SetName(hypo, hyp + a) SetName(hypo, hyp + a)
pass pass
status = self.mesh.mesh.AddHypothesis(self.geom, hypo) status = self.mesh.mesh.AddHypothesis(self.geom, hypo)
TreatHypoStatus( status, hyp, GetName(hypo), 0 ) TreatHypoStatus( status, GetName(hypo), GetName(self.geom), 0 )
return hypo return hypo
@ -1550,22 +1550,25 @@ class Mesh:
allReasons = "" allReasons = ""
for err in errors: for err in errors:
if err.isGlobalAlgo: if err.isGlobalAlgo:
glob = " global " glob = "global"
else: else:
glob = " local " glob = "local"
pass pass
dim = str(err.algoDim) dim = err.algoDim
if err.name == MISSING_ALGO: name = err.algoName
reason = glob + dim + "D algorithm is missing" if len(name) == 0:
elif err.name == MISSING_HYPO: reason = '%s %sD algorithm is missing' % (glob, dim)
name = '"' + err.algoName + '"' elif err.state == HYP_MISSING:
reason = glob + dim + "D algorithm " + name + " misses " + dim + "D hypothesis" reason = ('%s %sD algorithm "%s" misses %sD hypothesis'
elif err.name == NOT_CONFORM_MESH: % (glob, dim, name, dim))
reason = "Global \"Not Conform mesh allowed\" hypothesis is missing" elif err.state == HYP_NOTCONFORM:
elif err.name == BAD_PARAM_VALUE: reason = 'Global "Not Conform mesh allowed" hypothesis is missing'
name = '"' + err.algoName + '"' elif err.state == HYP_BAD_PARAMETER:
reason = "Hypothesis of" + glob + dim + "D algorithm " + name +\ reason = ('Hypothesis of %s %sD algorithm "%s" has a bad parameter value'
" has a bad parameter value" % ( glob, dim, name ))
elif err.state == HYP_BAD_GEOMETRY:
reason = ('%s %sD algorithm "%s" is assigned to geometry mismatching'
'its expectation' % ( glob, dim, name ))
else: else:
reason = "For unknown reason."+\ reason = "For unknown reason."+\
" Revise Mesh.Compute() implementation in smesh.py!" " Revise Mesh.Compute() implementation in smesh.py!"