(self)
return output
Print basic statistics about the multigrid hierarchy.
Print basic statistics about the multigrid hierarchy.
Print basic statistics about the multigrid hierarchy .
def __repr__(self):
        """Print basic statistics about the multigrid hierarchy."""
        output = 'MultilevelSolver\n'
        output += f'Number of Levels:     {len(self.levels)}\n'
        output += f'Operator Complexity: {self.operator_complexity():6.3f}\n'
        output += f'Grid Complexity:     {self.grid_complexity():6.3f}\n'
        output += f'Coarse Solver:        {self.coarse_solver.name()}\n'

        total_nnz = sum(level.A.nnz for level in self.levels)

        #          123456712345678901 123456789012 123456789
        #               0       10000        49600 [52.88%]
        output += '  level   unknowns     nonzeros\n'
        for n, level in enumerate(self.levels):
            A = level.A
            ratio = 100 * A.nnz / total_nnz
            output += f'{n:>6} {A.shape[1]:>11} {A.nnz:>12} [{ratio:2.2f}%]\n'

        return output
def __repr__ ( self ) : output = 'MultilevelSolver\n' output += f'Number of Levels:     {len(self.levels)}\n' output += f'Operator Complexity: {self.operator_complexity():6.3f}\n' output += f'Grid Complexity:     {self.grid_complexity():6.3f}\n' output += f'Coarse Solver:        {self.coarse_solver.name()}\n' total_nnz = sum ( level . A . nnz for level in self . levels ) #          123456712345678901 123456789012 123456789 #               0       10000        49600 [52.88%] output += '  level   unknowns     nonzeros\n' for n , level in enumerate ( self . levels ) : A = level . A ratio = 100 * A . nnz / total_nnz output += f'{n:>6} {A.shape[1]:>11} {A.nnz:>12} [{ratio:2.2f}%]\n' return output