code: def add_data(self, data):
          
          subdata = np.atleast_2d(data)
  
          # we try to accommodate transposed input
          if subdata.shape[1] != self.grid.nr_of_nodes:
              if subdata.shape[0] == self.grid.nr_of_nodes:
                  subdata = subdata.T
              else:
                  raise Exception(
                      'Number of values does not match the number of ' +
                      'nodes in the grid {0} grid nodes vs {1} data'.format(
                          self.grid.nr_of_nodes, subdata.shape,
                      )
                  )
  
          return_ids = []
          for dataset in subdata:
              cid = self._get_next_index()
              self.nodevals[cid] = dataset.copy()
              return_ids.append(cid)
  
          if len(return_ids) == 1:
              return return_ids[0]
          else:
              return return_ids
docs: Add data to the node value sets
  
          Parameters
          ----------
          data: numpy.ndarray
              one or more node value sets. It must either be 1D or 2D, with the
              first dimension the number of parameter sets (K), and the second
              the number of elements (Z): K x Z
  
          Examples
          --------
  
          >>> # suppose that grid is a fully initialized grid oject with 50 nodes
              nodeman = NodeMan(grid)
              #
              one_data_set = np.ones(50)
              cid = nodeman.add_data(one_data_set)
              print(nodeman.parsets[cid])
              two_data_sets = np.ones((2, 50))
              cids = nodeman.add_data(two_data_sets)
              print(cids)
          [0, ]
          [1, 2]