Beispiel #1
0
 def getNodeReferenceItem(self):
     retval = oI.ObjectItem()
     nodeId = str(self.nodeId)
     name = nc.nodePrefix + nodeId
     row = rw.RowP012(
         "0", oI.ObjectItem(nc.idNodeContainer, None, None, None, None,
                            None),
         oI.ObjectItem(nc.progIdNodes, None, None, None, None, None),
         oI.ObjectItem(name, None, None, None, None, None))
     retval.rows.append(row)
     return retval
Beispiel #2
0
def getLoadCombComponentRow(combComp):
  id= str(combComp.id)
  lcName= combComp.loadCaseName
  if(lcName==''):
    lcName= loadCombPrefix+id
  p0= oI.ObjectItem(lcName) #Load case name
  p1= oI.ObjectItem(str(combComp.coef)) #Load case coefficient
  p2= oI.ObjectItem('',str(combComp.loadCaseId))
  p2.n= lcName
  return rw.RowP012(id,p0,p1,p2)
  retval.rows.append(row)

  return retval
Beispiel #3
0
 def getElementReferenceItem(self):
     retval = oI.ObjectItem()
     elementId = str(self.elementId)
     name = ec.elementPrefix + elementId
     row = rw.RowP0123(
         "0",
         oI.ObjectItem(ec.idEPPlaneContainer, None, None, None, None, None),
         oI.ObjectItem(ec.tEPPlaneContainerTb, None, None, None, None,
                       None),
         oI.ObjectItem(elementId, None, None, None, None, None),
         oI.ObjectItem(name, None, None, None, None, None))
     retval.rows.append(row)
     return retval
Beispiel #4
0
 def getObject(self):
     retval = obj.Object()
     loadCompId = str(self.nodeLoadCompId)
     retval.setId(loadCompId)
     name = nodeLoadPrefix + loadCompId
     retval.setNm(name)
     nodeId = str(self.nodeId)  # Node id
     retval.setP0(oI.ObjectItem(name))  #Name
     retval.setP1(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP2(self.getNodeReferenceItem())  #Reference to node.
     retval.setP3(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP4(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP5(self.getValueObjectItem())  #Value
     retval.setP6(self.getSystemItem())  #System 0 -> GCS, 1 -> LCS
     return retval
Beispiel #5
0
def getLoadGroupObject(loadGroup):
    retval = obj.Object()
    id = str(loadGroup.id)
    retval.setId(id)
    name = loadGroupPrefix + id
    retval.setNm(name)
    retval.setP0(oI.ObjectItem(name))  #Name
    tmp = None
    if (loadGroup.permanent):
        tmp = oI.ObjectItem('0')
        tmp.t = 'Permanent'
    else:
        tmp = oI.ObjectItem('1')
        tmp.t = 'Variable'
    retval.setP1(tmp)
    return retval
Beispiel #6
0
 def getDirectionObjectItem(self):
   '''returns an item which represents load component direction.'''
   dirId= '0'
   if(self.direction=='Y'):
     dirId= '1'
   elif(self.direction=='Z'):
     dirId= '2'
   return oI.ObjectItem(dirId,'','',self.direction) #Direction X, Y or Z
Beispiel #7
0
 def getObject(self):
     retval = obj.Object()
     loadCompId = str(self.elementLoadCompId)
     retval.setId(loadCompId)
     name = elementLoadPrefix + loadCompId
     retval.setNm(name)
     elementId = str(self.elementId)  # Load name.
     retval.setP0(self.getElementReferenceItem())  #Reference to element.
     retval.setP1(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP2(oI.ObjectItem(name))  #Name
     retval.setP3(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  #Unique id
     retval.setP4(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP5(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP6(self.getValueObjectItem())  #Value
     retval.setP7(self.getSystemItem())  #System 0 -> GCS, 1 -> LCS
     retval.setP8(oI.ObjectItem('0', '', '', 'Length'))  #Location.
     return retval
Beispiel #8
0
 def getPolygonRows(self, polygon):
     retval = oI.ObjectItem()
     counter = 0
     for point in polygon:
         retval.rows.append(
             PolygonPointRow(str(counter), point.x, point.y, point.z))
         counter += 1
     return retval
Beispiel #9
0
 def getDistributionObjectItem(self):
   '''returns an item which represents the surface
      load distribution: uniform, Dir X, Dir Y, 3 points.'''
   distributionId= '0'
   if(self.distribution=='Dir X'):
     distributionId= '1'
   elif(self.distribution=='Dir Y'):
     distributionId= '2'
   elif(self.distribution=='3 points'):
     distributionId= '3'
   return oI.ObjectItem(distributionId,'','',self.distribution) #Distribution
Beispiel #10
0
def getLoadCaseObject(loadCase):
    retval = obj.Object()
    id = str(loadCase.id)
    retval.setId(id)
    name = loadCase.name
    if (name == ''):
        name = loadCasePrefix + id
    retval.setNm(name)
    retval.setP0(oI.ObjectItem(name))  #Name
    retval.setP1(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  # Unique id
    tmp = oI.ObjectItem(str(getActionTypeCode(loadCase.actionType)))
    tmp.t = loadCase.actionType
    retval.setP2(tmp)  #??
    retval.setP3(oI.ObjectItem(loadCase.desc))  #Description
    gId = str(loadCase.loadGroupId)
    gName = lgc.loadGroupPrefix + gId
    tmp = oI.ObjectItem('', gId)
    tmp.n = gName
    retval.setP4(tmp)
    ltyp = loadCase.ltyp
    ltypName = getLoadTypeName(ltyp)
    tmp = oI.ObjectItem(str(ltyp))
    tmp.t = ltypName
    retval.setP5(tmp)  #??
    return retval
Beispiel #11
0
 def __init__(self, id, x, y, z):
     p0 = oI.ObjectItem(v='Head')  #Node
     p1 = oI.ObjectItem('0', '', '', 'Standard')  #Point definition
     p2 = oI.ObjectItem(str(x), '', '', '')  #X coordinate.
     p3 = oI.ObjectItem(str(y), '', '', '')  #Y coordinate.
     super(PolygonPointRow, self).__init__(id, p0, p1, p2, p3)
     self.p4 = oI.ObjectItem(str(z), '', '', '')  #Z coordinate.
     self.p22 = oI.ObjectItem(v='Ligne')  #Edge
Beispiel #12
0
def getLoadCombObject(loadComb):
  retval= obj.Object()
  id= str(loadComb.id)
  retval.setId(id)
  name= loadComb.name
  if(name==''):
    name= loadCombPrefix+id
  retval.setNm(name)
  retval.setP0(oI.ObjectItem(name)) #Name
  retval.setP1(oI.ObjectItem('{'+str(uuid.uuid4())+'}')) # Unique id
  retval.setP2(oI.ObjectItem(loadComb.desc)) #Description
  ctyp= getLoadCombType(loadComb.typ)
  ctypName= getLoadCombTypeName(ctyp)
  tmp= oI.ObjectItem(str(ctyp))
  tmp.t= ctypName
  retval.setP3(tmp)
  retval.setP4(getDescompObject(loadComb.descomp))
  retval.setP5(oI.ObjectItem('0')) #Explode
  retval.setP6(oI.ObjectItem('-1')) #Phase
  retval.setP7(oI.ObjectItem('0')) #Master ID
  return retval
Beispiel #13
0
 def getObject(self):
     retval = obj.Object()
     loadCompId = str(self.surfacePressureFreeCompId)
     retval.setId(loadCompId)
     name = surfacePressureFreePrefix + loadCompId
     retval.setNm(name)
     retval.setP0(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP1(oI.ObjectItem(name))  #Name
     retval.setP2(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  #Unique id
     retval.setP3(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP4(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP5(
         self.getDistributionObjectItem())  #Distribution (uniform,...)
     retval.setP6(self.getValueObjectItem())  #Value
     retval.setP7(oI.ObjectItem('4', '', '', 'Z= 0'))  #Validity
     retval.setP8(oI.ObjectItem('0', '', '', 'Auto'))  #Select
     retval.setP9(self.getSystemItem())  #System 0 -> GCS, 1 -> LCS
     retval.setP10(oI.ObjectItem('0', '', '', 'Length'))  #Location.
     retval.setP11(self.getPolygonRows(self.polygon))  #Reference to node.
     return retval
Beispiel #14
0
 def getSystemItem(self):
   '''returns an ObjectItem which represents the reference system of the load component.'''
   if(self.globalCooSys):
     return oI.ObjectItem('0','','','GCS')
   else:
     return oI.ObjectItem('1','','','LCS')
Beispiel #15
0
 def getValueObjectItem(self):
   '''returns an ObjectItem which represents the value of the load component.'''
   return oI.ObjectItem(str(self.value))
Beispiel #16
0
 def getLoadCaseReferenceItem(self):
   lcId= str(self.loadCaseId) #Reference to load case.
   retval= oI.ObjectItem('',lcId)
   retval.n= self.getLoadCaseName()
   return retval
Beispiel #17
0
def getDescompObject(descomp):
  retval= oI.ObjectItem()
  for cc in descomp:
    retval.rows.append(getLoadCombComponentRow(cc))
  return retval
Beispiel #18
0
 def getObject(self):
     '''Returns an XML object for the point force component.'''
     retval = obj.Object()  #SCIA XML basic object.
     loadCompId = str(self.pointForceFreeCompId)
     retval.setId(loadCompId)
     name = pointForceFreePrefix + loadCompId
     retval.setNm(name)
     retval.setP0(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP1(oI.ObjectItem(name))  #Name
     retval.setP2(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  # Unique id
     retval.setP3(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP4(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP5(oI.ObjectItem('4', '', '', 'Z= 0'))  #Validity
     retval.setP6(oI.ObjectItem('0', '', '', 'Auto'))  #Select
     retval.setP7(self.getValueObjectItem())  #Value
     retval.setP8(oI.ObjectItem(str(self.x)))  #X (position)
     retval.setP9(oI.ObjectItem(str(self.y)))  #Y (position)
     retval.setP10(oI.ObjectItem(str(self.z)))  #Z (position)
     retval.setP11(oI.ObjectItem(str(self.x)))  #ux (position?)
     retval.setP12(oI.ObjectItem(str(self.y)))  #uy (position?)
     retval.setP13(oI.ObjectItem(str(self.z)))  #uz (position?)
     retval.setP14(
         self.getSystemItem())  #System 0 -> GCS, 1 -> LCS, 2 -> Load LCS
     return retval