コード例 #1
0
ファイル: meshes.py プロジェクト: zch1996/fluidity
 def NeList(self):
   neList = [[] for i in range(self.NodeCoordsCount())]
   for i, element in enumerate(self.GetVolumeElements()):
     nodes = element.GetNodes()
     for node in nodes:  
       if not i in neList[node]:
         neList[node].append(i)
       
   for eList in neList:
     utils.StripListDuplicates(eList)
     
   return neList
コード例 #2
0
ファイル: meshes.py プロジェクト: zch1996/fluidity
 def NNList(self):
   nnList = [[] for i in range(self.NodeCoordsCount())]
   for element in self.GetSurfaceElements() + self.GetVolumeElements():
     type = element.GetType()
     assert(type.GetElementFamilyId() == elements.ELEMENT_FAMILY_SIMPLEX and type.GetDegree() == 1)
     nodes = element.GetNodes()
     for node in nodes:
       for cNode in nodes:
         if not cNode == node:
           nnList[node].append(cNode)
   
   for nList in nnList:
     utils.StripListDuplicates(nList)
     
   return nnList
コード例 #3
0
ファイル: vtutools.py プロジェクト: zhoubing34/multifluids
def VtuEeList(vtu):
    """
  Generate the element-element list for the supplied vtu.
  Note well: This will only work for a continuous mesh.
  """

    nCells = vtu.ugrid.GetNumberOfCells()

    eeList = []
    for i in range(nCells):
        eeList.append([])

        cellPoints = vtu.GetCellPoints(i)
        for point in cellPoints:
            pointCells = vtu.GetPointCells(point)
            for cell in pointCells:
                eeList[-1].append(cell)

        utils.StripListDuplicates(eeList[-1])

    return eeList