code: def calculate_dimensions(self):
          
          x_coordinates = np.sort(self.grid['x'][:, 0])  # first x node
          self.nr_nodes_z = np.where(x_coordinates == x_coordinates[0])[0].size
          self.nr_elements_x = self.elements.shape[0] / (self.nr_nodes_z - 1)
          self.nr_nodes_x = self.nr_elements_x + 1
          self.nr_elements_z = self.nr_nodes_z - 1
docs: For a regular grid, calculate the element and node dimensions