code: def check_diag(self, jac, name):
          
          system = self.system
          pos = []
          names = []
          pairs = ''
          size = jac.size
          diag = jac[0:size[0] ** 2:size[0] + 1]
  
          for idx in range(size[0]):
              if abs(diag[idx]) <= 1e-8:
                  pos.append(idx)
  
          for idx in pos:
              names.append(system.varname.__dict__[name][idx])
  
          if len(names) > 0:
              for i, j in zip(pos, names):
                  pairs += '{0}: {1}\n'.format(i, j)
              logger.debug('Jacobian diagonal check:')
              logger.debug(pairs)
docs: Check matrix ``jac`` for diagonal elements that equals 0