本文整理汇总了Python中miscUtils.LogMessages类的典型用法代码示例。如果您正苦于以下问题:Python LogMessages类的具体用法?Python LogMessages怎么用?Python LogMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LogMessages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getElementComponentData
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]
示例2: dumpLoads
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: displayLocalAxes
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
示例4: VtkDefineElementsActor
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)
示例5: check
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.')
示例6: runChecking
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
示例7: gdls_resist_materiales2D
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: ic
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
示例9: simulaCargasXYFromTable
def simulaCargasXYFromTable(nmbQuery, nmbTbEsf, idElem, offset):
'''
Crea las cargas sobre cada uno de los elementos a partir de las tablas creadas anteriormente
nmbQuery: Nombre de la consulta que se empleara para obtener las cargas.
nmbTbEsf: Nombre de la tabla que contiene los índices de sección.
idElem: Identificador del elemento shell.
'''
idSecc1= idElem*10
iNod1= idSecc1+1
idSecc2= offset+idSecc1
iNod2= idSecc2+1
cargas= preprocessor.getLoadHandler
casos= cargas.getLoadPatterns
lmsg.info("Cargando elemento: ",int(idElem),"\n")
con= sqlite.connect(nmbDataBase)
con.row_factory = sqlite.Row
idSecc= 0.0
cur= con.cursor()
cur.execute("select * from "+ nmbTbEsf + " where ELEM = " + sqlValue(idElem))
for row in cur:
idAccion= row['ACCION']
lp= casos.getLoadPattern(idAccion)
lp.setCurrentLoadPattern()
lp.newNodalLoad(iNod1,xc.Vector([row['AXIL_X'],row['Q_X'],row['RASANTE'],row['TORSOR'],row['MOM_X'],0.0]))
lp.newNodalLoad(iNod2,xc.Vector([row['AXIL_Y'],row['Q_Y'],row['RASANTE'],row['TORSOR'],row['MOM_Y'],0.0]))
示例10: gdls_elasticidad2D
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)
示例11: set_included_in_orthoPrism
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
示例12: iNod
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
示例13: alphaZ
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
示例14: J
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
示例15: exportaEsfuerzosShellSet
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)