# File structures/CellComplex.rb, line 363
  def getTuple(cell)
    begin
      tuple = []
      
      # get cells at and bellow cell
      k = cell.dim
      if dim < 0 || dim > @dim
        raise "cell has dimesion #{dim} and complex has dimension #{@dim}"
      end
      c = cell
      while k >= 0 do
        tuple[k] = c
        lowC = @lower[c]
        c = (lowC == nil) ? nil : lowC[0]
        if c == nil && k > 0
          raise "non-vertex cell has no boundary elements #{k} #{cell}"
        end
        k -= 1
      end
      
      ctuple = CellTuple.new(tuple)
      ctuple = switch(0, ctuple) if @inverted[ctuple[@dim]]
    return ctuple
  
    rescue => exc
      print "CellComplex.getTuple: ", $!
      puts exc.backtrace
      exit
    end
  end