def localize(self, inod):
        """
        Strips nodes not in inod and remaps connectivities.
        Omits elements where remap[conn] contains -1...
        """
        remap = nm.empty((self.n_nod,), dtype=nm.int32)
        remap.fill(-1)
        remap[inod] = nm.arange(inod.shape[0], dtype=nm.int32)

        self.coors = self.coors[inod]
        self.ngroups = self.ngroups[inod]
        conns = []
        mat_ids = []
        for ig, conn in enumerate(self.conns):
            if conn.shape[0] == 0:
                continue

            aux = remap[conn]
            ii = nm.unique(nm.where(aux == -1)[0])
            ii = nm.setdiff1d(nm.arange(conn.shape[0], dtype=nm.int32), ii)
            conns.append(aux[ii])
            mat_ids.append(self.mat_ids[ig][ii])
        self.conns = conns
        self.mat_ids = mat_ids

        self._set_shape_info()
def localize ( self , inod ) : remap = nm . empty ( ( self . n_nod , ) , dtype = nm . int32 ) remap . fill ( - 1 ) remap [ inod ] = nm . arange ( inod . shape [ 0 ] , dtype = nm . int32 ) self . coors = self . coors [ inod ] self . ngroups = self . ngroups [ inod ] conns = [ ] mat_ids = [ ] for ig , conn in enumerate ( self . conns ) : if conn . shape [ 0 ] == 0 : continue aux = remap [ conn ] ii = nm . unique ( nm . where ( aux == - 1 ) [ 0 ] ) ii = nm . setdiff1d ( nm . arange ( conn . shape [ 0 ] , dtype = nm . int32 ) , ii ) conns . append ( aux [ ii ] ) mat_ids . append ( self . mat_ids [ ig ] [ ii ] ) self . conns = conns self . mat_ids = mat_ids self . _set_shape_info ( )
Strips nodes not in inod and remaps connectivities.
        Omits elements where remap[conn] contains -1...