def get_set_info(the_set):
    """ Get information about the set, such that it can be regenerated 
    even after the mesh is redefined (i.e. after changes to node and 
    element numbering)
    
    :param the_set: The set to aquire info about
    :type the_set: Set object (Abaqus)
    
    :returns: Dictionary with the following fields:
    
    * 'nodes': list of lists (len=3) with node coordinates for all nodes
      involved in the_set (either inside, or part of element)
    * 'node_inds': Indicies in list 'nodes' that belong to the set
      themselves (i.e. excluding those only part of an element)
    * 'elems': list of lists with indices corresponding to list 'nodes'
      
    :rtype: dict
    
    """
    
    set_info = {'nodes': [], 'node_inds': [], 'elems': []}
    old_nodes = []
    old_set_nodes = the_set.nodes
    for elem in the_set.elements:
        set_info['elems'].append([])
        for enod in elem.getNodes():
            try: 
                ind = old_nodes.index(enod)
            except ValueError:
                # Could not find enod in old_nodes, add it
                old_nodes.append(enod)
                ind = len(old_nodes)-1
                
                # Also add the node coordinates 
                set_info['nodes'].append(enod.coordinates)
                
                # If node inside set, add its new index to 'node_inds'
                if enod in old_set_nodes:
                    set_info['node_inds'].append(ind)
                    
                
            set_info['elems'][-1].append(ind)
    
    return set_info