• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python miscUtils.LogMessages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中miscUtils.LogMessages的典型用法代码示例。如果您正苦于以下问题:Python LogMessages类的具体用法?Python LogMessages怎么用?Python LogMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了LogMessages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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]
开发者ID:lcpt,项目名称:xc,代码行数:35,代码来源:vtk_internal_force_diagram.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:30,代码来源:load_vector_field.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:32,代码来源:GridModel.py


示例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)
开发者ID:lcpt,项目名称:xc,代码行数:31,代码来源:vtk_FE_graphic.py


示例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.')
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:limit_state_data.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:29,代码来源:limit_state_data.py


示例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)
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:predefined_spaces.py


示例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
开发者ID:lcpt,项目名称:xc_utils,代码行数:25,代码来源:FrictionalCohesionalSoil.py


示例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]))
开发者ID:lcpt,项目名称:xc,代码行数:27,代码来源:shell_testing_bench.py


示例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)
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:predefined_spaces.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:28,代码来源:sets_mng.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:27,代码来源:predefined_spaces.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:section_properties.py


示例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
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:section_properties.py


示例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)
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:export_internal_forces.py


示例16: gdls_resist_materiales3D

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)
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:predefined_spaces.py


示例17: defConcrete02

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
开发者ID:lcpt,项目名称:xc,代码行数:30,代码来源:typical_materials.py


示例18: VtkCreaStrArraySetData

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
开发者ID:lcpt,项目名称:xc,代码行数:27,代码来源:create_array_set_data.py


示例19: defVarControlMov

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',"")
开发者ID:lcpt,项目名称:xc,代码行数:7,代码来源:def_vars_control.py


示例20: displayDispRot

    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)
开发者ID:lcpt,项目名称:xc,代码行数:35,代码来源:quick_graphics.py



注:本文中的miscUtils.LogMessages类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python misc_utils_objectfactory.ObjFactory类代码示例发布时间:2022-05-27
下一篇:
Python warnings.warn函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap