示例#1
0
    def __init__(self, nodes, index):
        SkeletonElementBase.__init__(self, nodes)
        skeletonselectable.SkeletonSelectable.__init__(self, index)

        # Although the CSkeletonElement keeps a list of
        # CSkeletonNodes, the extra information in the Python
        # SkeletonNodes isn't available unless we keep a list of them
        # here, as well.  It's possible that we could move all the
        # extra info into the CSkeletonNode class and swig it.
        # Canonical ordering will still work, because it's based on
        # indices.
        self.nodes = nodes
        
        for node in nodes:
            node.addElement(self)
            
        # When a real mesh is made from the skeleton in which this
        # element lives, self.meshindex gets assigned the index of
        # that element.  This index is the same for all the real meshes.
        self.meshindex = None

        self.ID = object_id.ObjectID()

        # process ID (only meaningful in parallel mode)
        if parallel_enable.enabled():
            from ooflib.SWIG.common import mpitools
            self._procID = mpitools.Rank()
        else:
            self._procID = None
示例#2
0
    def dimIndependentInit(self, index):
        self._elements = []
        self.ID = object_id.ObjectID()

        # parallel attributes
        if parallel_enable.enabled():
            self._owners = []  # only for the initial Skeleton
            self._shared_with = []  # except me
            self._remote_index = {}  # procID : remote index
示例#3
0
    def __init__(self, nodes, index):
        ## nodes is a tuple containing two SkeletonNodes in canonical
        ## order (see skeletonnode.canonical_order().
        skeletonselectable.SkeletonSelectable.__init__(self, index)
        self._nodes = nodes
        self._elements = []
        self.edges = []

        ## parallel processing variables
        self._rank = -1
        self.ID = object_id.ObjectID()