本文整理汇总了Python中miscUtils.LogMessages.warning方法的典型用法代码示例。如果您正苦于以下问题:Python LogMessages.warning方法的具体用法?Python LogMessages.warning怎么用?Python LogMessages.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miscUtils.LogMessages
的用法示例。
在下文中一共展示了LogMessages.warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: displayLocalAxes
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def displayLocalAxes(self,setToDisplay=None,vectorScale=1.0,viewDef= vtk_graphic_base.CameraParameters('XYZPos'), caption= '',fileName=None,defFScale=0.0):
'''vector field display of the loads applied to the chosen set of elements in the load case passed as parameter
:param setToDisplay: set of elements to be displayed (defaults to total set)
:param vectorScale: factor to apply to the vectors length in the representation
:param viewDef: parameters that define the view to use
predefined view names: 'XYZPos','XNeg','XPos','YNeg','YPos',
'ZNeg','ZPos'
:param fileName: full name of the graphic file to generate. Defaults to `None`, in this case it returns a console output graphic.
:param caption: text to display in the graphic
: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 == None):
setToDisplay=self.getPreprocessor().getSets.getSet('total')
setToDisplay.fillDownwards()
lmsg.warning('set to display not defined; using total set.')
defDisplay= vtk_FE_graphic.RecordDefDisplayEF()
defDisplay.setupGrid(setToDisplay)
if setToDisplay.color.Norm()==0:
setToDisplay.color=xc.Vector([rd.random(),rd.random(),rd.random()])
vField=lavf.LocalAxesVectorField(setToDisplay.name+'_localAxes',vectorScale)
vField.dumpVectors(setToDisplay)
defDisplay.cameraParameters= viewDef
defDisplay.defineMeshScene(None,defFScale,color=setToDisplay.color)
vField.addToDisplay(defDisplay)
defDisplay.displayScene(caption,fileName)
return defDisplay
示例2: dumpLoads
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [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
示例3: getElementComponentData
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def getElementComponentData(self,elem):
'''Returns the data to use to represent the diagram over the element
:param elem: element to deal with.
:param component: component to represent:
'''
# default values.
elemVDir= elem.getJVector3d(True) #initialGeometry= True
value1= 0.0
value2= 0.0
if(self.component == 'N'):
value1= elem.getN1
value2= elem.getN2
elif(self.component == 'Qy'):
elemVDir= elem.getJVector3d(True) # initialGeometry= True
value1= elem.getVy1
value2= elem.getVy2
elif(self.component == 'Qz'):
elemVDir= elem.getKVector3d(True) # initialGeometry= True
value1= elem.getVz1
value2= elem.getVz2
elif(self.component == 'T'):
value1= elem.getT1
value2= elem.getT2
elif(self.component == 'My'):
elemVDir= elem.getKVector3d(True) # initialGeometry= True
value1= elem.getMy1
value2= elem.getMy2
elif(self.component == 'Mz'):
elemVDir= elem.getJVector3d(True) # initialGeometry= True
value1= elem.getMz1
value2= elem.getMz2
else:
lmsg.warning("'component :'"+ self.component+ "' unknown.")
return [elemVDir,value1,value2]
示例4: alphaZ
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def alphaZ(self):
'''Return shear shape factor with respect to local z-axis'''
msg= 'alphaZ: shear shape factor not implemented for section: '
msg+= self.sectionName
msg+= '. 5/6 returned'
lmsg.warning(msg)
return 5.0/6.0
示例5: dispLoadCaseBeamEl
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [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)
示例6: displayDispRot
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def displayDispRot(self,itemToDisp='',setToDisplay=None,fConvUnits=1.0,unitDescription= '',viewDef= vtk_graphic_base.CameraParameters('XYZPos',1.0),fileName=None,defFScale=0.0,rgMinMax=None):
'''displays the component of the displacement or rotations in the
set of entities.
:param itemToDisp: component of the displacement ('uX', 'uY' or 'uZ')
or the rotation ('rotX', rotY', 'rotZ') to be depicted
:param setToDisplay: set of entities to be represented (defaults to all
entities)
:param fConvUnits: factor of conversion to be applied to the results
(defaults to 1)
:param unitDescription: string describing units like '[mm] or [cm]'
: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)
:param rgMinMax: range (vmin,vmax) with the maximum and minimum values of
the field to be represented. All the values less than vmin are
displayed in blue and those greater than vmax in red
(defaults to None)
'''
if(setToDisplay):
self.xcSet= setToDisplay
else:
lmsg.warning('QuickGraphics::displayDispRot; set to display not defined; using previously defined set (total if None).')
vCompDisp= self.getDispComponentFromName(itemToDisp)
nodSet= self.xcSet.getNodes
for n in nodSet:
n.setProp('propToDisp',n.getDisp[vCompDisp])
field= Fields.ScalarField(name='propToDisp',functionName="getProp",component=None,fUnitConv=fConvUnits,rgMinMax=rgMinMax)
defDisplay= self.getDisplay(viewDef)
defDisplay.displayMesh(xcSets=self.xcSet,field=field,diagrams= None, fName=fileName,caption=self.loadCaseName+' '+itemToDisp+' '+unitDescription+' '+self.xcSet.description,defFScale=defFScale)
示例7: gdls_resist_materiales2D
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def gdls_resist_materiales2D(nodes):
'''Defines the dimension of the space: nodes by two coordinates (x,y) and three DOF for each node (Ux,Uy,theta)
:param nodes: preprocessor nodes handler
'''
lmsg.warning('gdls_resist_materiales2D DEPRECATED; use StructuralMechanics2D.')
return StructuralMechanics2D(nodes)
示例8: gdls_resist_materiales3D
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def gdls_resist_materiales3D(nodes):
'''Define the dimension of the space: nodes by three coordinates (x,y,z) and six DOF for each node (Ux,Uy,Uz,thetaX,thetaY,thetaZ)
:param nodes: preprocessor nodes handler
'''
lmsg.warning('gdls_resist_materiales3D DEPRECATED; use StructuralMechanics3D.')
return StructuralMechanics3D(nodes)
示例9: defVarControlMov
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def defVarControlMov(obj, code):
if(not obj.hasProp('span')):
lmsg.warning('span property not defined for: '+str(obj.tag) + ' object.')
obj.setProp(code+'Max',0.0)
obj.setProp('Comb'+code+'Max',"")
obj.setProp(code+'Min',0.0)
obj.setProp('Comb'+code+'Min',"")
示例10: setUniaxialBearing2D
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def setUniaxialBearing2D(self,iNod,bearingMaterial,direction):
'''Modelize an uniaxial bearing on the defined direction.
Args:
iNod (int): node identifier (tag).
bearingMaterial (str): material name for the zero length
element.
Returns:
:rtype: (int, int) new node tag, new element tag.
'''
nodes= self.preprocessor.getNodeHandler
newNode= nodes.duplicateNode(iNod) # new node.
# Element definition
elems= self.preprocessor.getElementHandler
elems.dimElem= self.preprocessor.getNodeHandler.dimSpace # space dimension.
if(elems.dimElem>2):
lmsg.warning("Not a bi-dimensional space.")
elems.defaultMaterial= bearingMaterial
zl= elems.newElement("ZeroLength",xc.ID([newNode.tag,iNod]))
zl.setupVectors(xc.Vector([direction[0],direction[1],0]),xc.Vector([-direction[1],direction[0],0]))
zl.clearMaterials()
zl.setMaterial(0,bearingMaterial)
# Boundary conditions
numDOFs= self.preprocessor.getNodeHandler.numDOFs
for i in range(0,numDOFs):
spc= self.constraints.newSPConstraint(newNode.tag,i,0.0)
return newNode.tag, zl.tag
示例11: gdls_elasticidad2D
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def gdls_elasticidad2D(nodes):
'''Defines the dimension of the space: nodes by two coordinates (x,y) and two DOF for each node (Ux,Uy)
:param nodes: nodes handler
'''
lmsg.warning('gdls_elasticidad2D DEPRECATED; use SolidMechanics2D.')
return SolidMechanics2D(nodes)
示例12: J
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def J(self):
'''Return torsional constant of the section'''
msg= 'Torsional constant not implemented for section:'
msg+= self.sectionName
msg+= '. Zero returned'
lmsg.warning(msg)
return 0.0
示例13: displayNodeValueDiagram
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def displayNodeValueDiagram(self,itemToDisp='',setToDisplay=None,fConvUnits=1.0,scaleFactor=1.0,unitDescription= '',viewDef= vtk_graphic_base.CameraParameters('XYZPos'),fileName=None,defFScale=0.0):
'''displays the a displacement (uX,uY,...) or a property defined in nodes
as a diagram over lines (i.e. appropiated for beam elements).
:param itemToDisp: item to display.
:param setToDisplay: set of entities (elements of type beam) to be
represented
:param fConvUnits: factor of conversion to be applied to the results
(defalts to 1)
:param scaleFactor: factor of scale to apply to the diagram display of
:param unitDescription: string like '[m]' or '[rad]' or '[m/s2]'
:param viewDef: camera parameters.
: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::displayNodeValueDiagram; set to display not defined; using previously defined set (total if None).')
diagram= npd.NodePropertyDiagram(scaleFactor= scaleFactor,fUnitConv= fConvUnits,sets=[self.xcSet],attributeName= itemToDisp)
diagram.addDiagram()
defDisplay= self.getDisplay(viewDef)
defDisplay.setupGrid(self.xcSet)
defDisplay.defineMeshScene(None,defFScale,color=self.xcSet.color)
defDisplay.appendDiagram(diagram) #Append diagram to the scene.
caption= self.loadCaseName+' '+itemToDisp+' '+unitDescription +' '+self.xcSet.description
defDisplay.displayScene(caption=caption,fName=fileName)
示例14: ic
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def ic(self,deltaB,deltaL,Hload,Beff,Leff):
'''Factor that introduces the effect of load inclination on
the cohesion component.
:param deltaB: angle between the load and the foundation width
atan(HloadB/VLoad).
:param deltaL: angle between the load and the foundation length
atan(HloadL/VLoad).
:param Hload: Horizontal load.
:param Beff: Width of the effective foundation area
(see figure 12 in page 44 of reference[2]).
:param Leff: Length of the effective foundation area
(see figure 12 in page 44 of reference[2]).
'''
if(self.getDesignPhi()!=0.0):
iq= self.iq(deltaB,deltaL)
return (iq*self.Nq()-1.0)/(self.Nq()-1.0)
else: #See expresion (15) in reference [2]
resist= Beff*Leff*self.getDesignC()
if(Hload<=resist):
twoAlpha= math.acos(Hload/resist)
return 0.5+(twoAlpha+math.sin(twoAlpha))/(math.pi+2.0)
else:
lmsg.warning('Load (H= '+str(Hload)+') greater than soil strength R='+str(resist)+' returns 0.0')
return 0.0
示例15: defConcrete02
# 需要导入模块: from miscUtils import LogMessages [as 别名]
# 或者: from miscUtils.LogMessages import warning [as 别名]
def defConcrete02(preprocessor,name,epsc0,fpc,fpcu,epscu,ratioSlope,ft,Ets):
''''Constructs an uniaxial concrete material with linear tension
softening. Compressive concrete parameters should be input as negative values.
The initial slope for this model is (2*fpc/epsc0)
:param preprocessor: preprocessor
:param name: name identifying the material
:param epsc0: concrete strain at maximum strength
:param fpc: concrete compressive strength at 28 days (compression is negative)
:param fpcu: concrete crushing strength
:param epscu: concrete strain at crushing strength
:param ratioSlope: ratio between unloading slope at epscu and initial slope
:param ft: tensile strength
:param Ets: tension softening stiffness (absolute value) (slope of the linear tension softening branch)
'''
materials= preprocessor.getMaterialHandler
materials.newMaterial("concrete02_material",name)
retval= materials.getMaterial(name)
retval.name= name
retval.epsc0= epsc0
retval.fpc= fpc
retval.fpcu= fpcu
retval.epscu= epscu
retval.ratioSlope=ratioSlope
retval.ft=ft
retval.Ets=Ets
if fpc==fpcu:
lmsg.warning("concrete02 compressive strength fpc is equal to crushing strength fpcu => the solver can return wrong stresses or have convergence problems ")
return retval