本文整理汇总了Python中miscUtils.LogMessages.error方法的典型用法代码示例。如果您正苦于以下问题:Python LogMessages.error方法的具体用法?Python LogMessages.error怎么用?Python LogMessages.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miscUtils.LogMessages
的用法示例。
在下文中一共展示了LogMessages.error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runChecking
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def runChecking(self,outputCfg):
'''This method reads, for the elements in setCalc, the internal
forces previously calculated and saved in the corresponding file.
Using the 'initControlVars' and 'checkSetFromIntForcFile' methods of
the controller, the appropiate attributes are assigned to the
elements and the associated limit state verification is run.
The results are written to a file in order to be displayed or listed.
:param outputCfg: instance of class 'verifOutVars' which defines the
variables that control the output of the checking (set of
elements to be analyzed, append or not the results to the
result file [defatults to 'N'], generation or not
of list file [defatults to 'N', ...)
:param setCalc: set that contains elements to be checked
:param appendToResFile: 'Yes','Y','y',.., if results are appended to
existing file of results (defaults to 'N')
:param listFile: 'Yes','Y','y',.., if latex listing file of results
is desired to be generated (defaults to 'N')
'''
retval=None
if outputCfg.setCalc:
prep=outputCfg.setCalc.getPreprocessor
intForcCombFileName=self.getInternalForcesFileName()
self.controller.initControlVars(outputCfg.setCalc)
self.controller.checkSetFromIntForcFile(intForcCombFileName,outputCfg.setCalc)
retval=cv.writeControlVarsFromElements(self.controller.limitStateLabel,prep,self.getOutputDataBaseFileName(),outputCfg)
else:
lmsg.error("Result file hasn't been created, you must specify a valid set of elements")
return retval
示例2: exportaEsfuerzosShellSet
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def exportaEsfuerzosShellSet(preprocessor,nmbComb, st, fName):
'''Writes a comma separated values file with the element's internal forces.'''
errMsg= 'exportaEsfuerzosShellSet deprecated use exportInternalForces'
errMsg+= 'with apropriate arguments'
lmsg.error(errMsg)
elems= st.getElements
exportShellInternalForces(nmbComb,elems,fName)
示例3: dispLoadCaseBeamEl
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def dispLoadCaseBeamEl(self,loadCaseName='',setToDisplay=None,fUnitConv=1.0,elLoadComp='transComponent',elLoadScaleF=1.0,nodLoadScaleF=1.0,viewDef= vtk_graphic_base.CameraParameters('XYZPos'),caption='',fileName=None,defFScale=0.0):
'''Display the loads applied on beam elements and nodes for a given load case
:param setToDisplay: set of beam elements to be represented
:param fUnitConv: factor of conversion to be applied to the results
(defaults to 1)
:param elLoadComp: component of the loads on elements to be depicted
[possible components: 'axialComponent', 'transComponent',
'transYComponent', 'transZComponent']
:param elLoadScaleF: factor of scale to apply to the diagram display
of element loads (defaults to 1)
:param nodLoadScaleF: factor of scale to apply to the vector display of
nodal loads (defaults to 1)
:param vwDef: camera parameters.
:param caption: caption for the graphic
:param fileName: name of the file to plot the graphic. Defaults to None,
in that case an screen display is generated
:param defFScale: factor to apply to current displacement of nodes
so that the display position of each node equals to
the initial position plus its displacement multiplied
by this factor. (Defaults to 0.0, i.e. display of
initial/undeformed shape)
'''
if(setToDisplay):
self.xcSet= setToDisplay
if self.xcSet.color.Norm()==0:
self.xcSet.color=xc.Vector([rd.random(),rd.random(),rd.random()])
else:
lmsg.warning('QuickGraphics::dispLoadCaseBeamEl; set to display not defined; using previously defined set (total if None).')
preprocessor= self.feProblem.getPreprocessor
loadPatterns= preprocessor.getLoadHandler.getLoadPatterns
loadPatterns.addToDomain(loadCaseName)
defDisplay= self.getDisplay(viewDef)
grid= defDisplay.setupGrid(self.xcSet)
defDisplay.defineMeshScene(None,defFScale,color=self.xcSet.color)
orNodalLBar='H' #default orientation of scale bar for nodal loads
# auto-scaling parameters
LrefModSize=setToDisplay.getBnd(1.0).diagonal.getModulo() #representative length of set size (to auto-scale)
diagAux=lld.LinearLoadDiagram(scale=elLoadScaleF,fUnitConv=fUnitConv,loadPatternName=loadCaseName,component=elLoadComp)
maxAbs=diagAux.getMaxAbsComp(preprocessor)
if maxAbs > 0:
elLoadScaleF*=LrefModSize/maxAbs*100
#
diagram= lld.LinearLoadDiagram(scale=elLoadScaleF,fUnitConv=fUnitConv,loadPatternName=loadCaseName,component=elLoadComp)
diagram.addDiagram(preprocessor)
if diagram.isValid():
defDisplay.appendDiagram(diagram)
orNodalLBar='V'
# nodal loads
vField=lvf.LoadVectorField(loadPatternName=loadCaseName,fUnitConv=fUnitConv,scaleFactor=nodLoadScaleF,showPushing= True)
# loadPatterns= preprocessor.getLoadHandler.getLoadPatterns
lPattern= loadPatterns[loadCaseName]
count= 0
if(lPattern):
count=vField.dumpNodalLoads(preprocessor,defFScale=defFScale)
else:
lmsg.error('load pattern: '+ loadCaseName + ' not found.')
if count >0:
vField.addToDisplay(defDisplay,orientation=orNodalLBar)
defDisplay.displayScene(caption=caption,fName=fileName)
示例4: check
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def check(self,reinfConcreteSections):
'''Checking of displacements under frequent loads in
serviceability limit states (see self.dumpCombinations).
:param reinfConcreteSections: Reinforced concrete sections on each element.
'''
lmsg.error('FreqLoadsDisplacementControlLimitStateData.check() not implemented.')
示例5: VtkCreaStrArraySetData
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def VtkCreaStrArraySetData(setToDraw, entTypeName, attr):
'''Creates an array of strings with information associated
to the points and cells.
Parameters:
setToDraw: set of entities to be displayed
entTypeName: type of entities to be displayed
("pnts", "lines", "nodes", "elementos")
attr: attribute to be stored in the array
'''
# Define matrix
arr= vtk.vtkStringArray()
arr.SetName(attr)
container= None
if(entTypeName=="pnts"):
container= setToDraw.getPoints
elif(entTypeName=="lines"):
container= setToDraw.getLines
elif(entTypeName=="nodes"):
container= setToDraw.getNodes
elif(entTypeName=="elementos"):
container= setToDraw.getElements
else:
lmsg.error("error: "+entTypeName+" not implemented.")
for e in container:
tmp= str(getattr(e,attr))
arr.InsertValue(e.getIdx,tmp)
return arr
示例6: set_included_in_orthoPrism
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def set_included_in_orthoPrism(preprocessor,setInit,prismBase,prismAxis,setName):
'''reselect from set setInit those elements included in a orthogonal prism
defined by a 2D polygon and the direction of its axis.
:param preprocessor: preprocessor
:param setInit: set of elements to which restrict the search
:param prismBase: 2D polygon that defines the n-sided base of the prism.
The vertices of the polygon are defined in global
coordinates in the following way:
- for X-axis-prism: (y,z)
- for Y-axis-prism: (x,z)
- for Z-axis-prism: (x,y)
:param prismAxis: axis of the prism (can be equal to 'X', 'Y', 'Z')
:param setName: name of the set to be generated
'''
sElIni=setInit.getElements
if prismAxis in ['X','x']:
elem_inside_prism=[e for e in sElIni if prismBase.In(geom.Pos2d(e.getPosCentroid(True).y,e.getPosCentroid(True).z),0)]
elif prismAxis in ['Y','y']:
elem_inside_prism=[e for e in sElIni if prismBase.In(geom.Pos2d(e.getPosCentroid(True).x,e.getPosCentroid(True).z),0)]
elif prismAxis in ['Z','z']:
elem_inside_prism=[e for e in sElIni if prismBase.In(geom.Pos2d(e.getPosCentroid(True).x,e.getPosCentroid(True).y),0)]
else:
lmsg.error("Wrong prisma axis. Available values: 'X', 'Y', 'Z' \n")
s=lstElem_to_set(preprocessor,elem_inside_prism,setName)
s.fillDownwards()
return s
示例7: dumpLoads
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def dumpLoads(self, preprocessor,defFScale, showElementalLoads= True, showNodalLoads= True):
''' Iterate over loads dumping them into the graphic.
:param lp: load pattern
:param defFScale: factor to apply to current displacement of nodes
so that the display position of each node equals to
the initial position plus its displacement multiplied
by this factor.
:param showElementalLoads: if true show loads over elements.
:param showNodalLoads: if true show loads over nodes.
'''
preprocessor.resetLoadCase()
loadPatterns= preprocessor.getLoadHandler.getLoadPatterns
loadPatterns.addToDomain(self.lpName)
lp= loadPatterns[self.lpName]
count= 0
if(lp):
numberOfLoads= self.populateLoads(preprocessor,lp)
if(numberOfLoads>0):
self.data.scaleFactor/= self.getMaxLoad()
#Iterate over loaded elements.
count+= self.dumpElementalPositions(preprocessor,lp)
#Iterate over loaded nodes.
count+= self.dumpNodalPositions(preprocessor,lp,defFScale)
if(count==0):
lmsg.warning('LoadVectorField.dumpLoads: no loads defined.')
loadPatterns.removeFromDomain(self.lpName)
else:
lmsg.error('Load pattern: '+ self.lpName + ' not found.')
return count
示例8: VtkDefineElementsActor
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def VtkDefineElementsActor(self, reprType,field,color=xc.Vector([rd.random(),rd.random(),rd.random()])):
''' Define the actor to display elements
:param reprType: type of representation ("points", "wireframe" or
"surface")
:param field: field to be repreresented
:param color: RGB color to represent the elements (defaults to random
color)
'''
if(field):
field.setupOnGrid(self.gridRecord.uGrid)
self.gridMapper= vtk.vtkDataSetMapper()
self.gridMapper.SetInputData(self.gridRecord.uGrid)
if(field):
field.setupOnMapper(self.gridMapper)
elemActor= vtk.vtkActor()
elemActor.SetMapper(self.gridMapper)
elemActor.GetProperty().SetColor(color[0],color[1],color[2])
if(reprType=="points"):
elemActor.GetProperty().SetRepresentationToPoints()
elif(reprType=="wireframe"):
elemActor.GetProperty().SetRepresentationToWireFrame()
elif(reprType=="surface"):
elemActor.GetProperty().SetRepresentationToSurface()
else:
lmsg.error("Representation type: '"+ reprType+ "' unknown.")
self.renderer.AddActor(elemActor)
if(field):
field.creaColorScaleBar()
self.renderer.AddActor2D(field.scalarBar)
示例9: getSectionNamesForElement
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def getSectionNamesForElement(self,tagElem):
'''Returns the section names for the element which tag is being passed
as a parameter.'''
if tagElem in self.sectionDistribution.keys():
return self.sectionDistribution[tagElem]
else:
lmsg.error("element with tag: "+str(tagElem)+" not found.")
return None
示例10: getPressure
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def getPressure(self,z):
'''Return the earth pressure acting on the points at global coordinate z.'''
ret_press= 0.0
if(z<self.zGround):
ret_press=0.65*self.K*self.gammaSoil*self.H
if(z<self.zWater):
lmsg.error('pressures under water table not implemented.''')
return ret_press
示例11: writeResultTraction
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def writeResultTraction(self,outputFile,Nd):
famArm= self.tensionRebars
concrete= self.concrete
AsMin= self.getMinReinfAreaUnderTension()/2
ancrage= famArm.getBasicAnchorageLength(concrete)
ng_rebar_def.writeRebars(outputFile,concrete,famArm,AsMin)
if(abs(Nd)>0):
lmsg.error("ERROR; tension not implemented.")
示例12: displayElementUniformLoad
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def displayElementUniformLoad(self, preprocessor, unifLoad,loadPattern, color, force, fScale):
loadPatternName= loadPattern.getProp("dispName")
actorName= "flechaU"+loadPatternName+"%04d".format(unifLoad.tag)
eleTags= unifLoad.elementTags
for tag in eleTags:
ele= preprocessor.getElementHandler.getElement(tag)
actorName+= "%04d".format(tag) # Tag elemento.
lmsg.error('displayElementUniformLoad not implemented.')
示例13: getPlasticSectionModulusY
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def getPlasticSectionModulusY(self):
'''Returns the plastic section modulus around Y axis.
Computes the plastic section modulus assuming that plastic neutral
axis passes through section centroid (which is true whenever the
rectangular section is homogeneous).
'''
lmsg.error('getPlasticSectionModulusY not implemented.')
return 0.0
示例14: generateLoadPattern
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def generateLoadPattern(self,preprocessor,dictGeomEnt,lPatterns):
lmsg.log(' *** '+self.name+' *** ')
if(not self.lPattern):
self.lPattern= lPatterns.newLoadPattern("default",self.name)
lPatterns.currentLoadPattern= self.name
self.appendLoadsToLoadPattern(dictGeomEnt,preprocessor.getNodeHandler)
else:
lmsg.error('Error load pattern: '+ self.name+ ' already generated.')
return self.lPattern
示例15: getIntForceComponentFromName
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import error [as 别名]
def getIntForceComponentFromName(self,componentName):
if componentName[0] in ['N','M']:
return componentName.lower()
elif componentName == 'Q1':
return 'q13'
elif componentName == 'Q2':
return 'q23'
else: #LCPT I don't like this too much, I prefer let the user make the program to crass. Maybe a Warning?
lmsg.error('Item '+str(componentName) +'is not a valid component. Displayable items are: N1, N2, N12, M1, M2, M12, Q1, Q2')
return 'N1'