1
1
/*BHEADER**********************************************************************
2
* Copyright (c) 2006 The Regents of the University of California.
2
* Copyright (c) 2008, Lawrence Livermore National Security, LLC.
3
3
* Produced at the Lawrence Livermore National Laboratory.
4
* Written by the HYPRE team. UCRL-CODE-222953.
7
* This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/).
8
* Please see the COPYRIGHT_and_LICENSE file for the copyright notice,
9
* disclaimer, contact information and the GNU Lesser General Public License.
11
* HYPRE is free software; you can redistribute it and/or modify it under the
12
* terms of the GNU General Public License (as published by the Free Software
13
* Foundation) version 2.1 dated February 1999.
15
* HYPRE is distributed in the hope that it will be useful, but WITHOUT ANY
16
* WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
17
* FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
18
* Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program; if not, write to the Free Software Foundation,
22
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4
* This file is part of HYPRE. See file COPYRIGHT for details.
6
* HYPRE is free software; you can redistribute it and/or modify it under the
7
* terms of the GNU Lesser General Public License (as published by the Free
8
* Software Foundation) version 2.1 dated February 1999.
25
11
***********************************************************************EHEADER*/
30
17
#include "headers.h"
31
18
#include "par_amg.h"
260
250
printf(" Coarsening Type = CLJP, fixed random \n");
252
else if (abs(coarsen_type) == 21) /* BM Aug 29, 2006 */
254
printf(" Coarsening Type = CGC \n");
256
else if (abs(coarsen_type) == 22) /* BM Aug 29, 2006 */
258
printf(" Coarsening Type = CGC-E \n");
262
260
/*if (coarsen_type > 0)
264
262
printf(" Hybrid Coarsening (switch to CLJP when coarsening slows)\n");
335
333
printf(" Interpolation = block classical interpolation with diagonal blocks\n");
336
334
printf(" for nodal systems AMG\n");
336
else if (interp_type == 24)
338
printf(" Interpolation = block direct interpolation \n");
339
printf(" for nodal systems AMG\n");
341
printf( "\nBlock Operator Matrix Information:\n\n");
346
printf( "\nBlock Operator Matrix Information:\n");
347
printf( "(Row sums and weights use sum of all elements in the block -keeping signs)\n\n");
397
403
min_entries = (A_diag_i[1]-A_diag_i[0])+(A_offd_i[1]-A_offd_i[0]);
398
404
for (j = A_diag_i[0]; j < A_diag_i[1]; j++)
400
hypre_CSRBlockMatrixBlockNorm(1, &A_diag_data[j*bnnz], &tmp_norm, block_size);
406
hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[j*bnnz], &tmp_norm, block_size);
401
407
min_rowsum += tmp_norm;
404
410
for (j = A_offd_i[0]; j < A_offd_i[1]; j++)
406
hypre_CSRBlockMatrixBlockNorm(1, &A_offd_data[j*bnnz], &tmp_norm, block_size);
412
hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[j*bnnz], &tmp_norm, block_size);
407
413
min_rowsum += tmp_norm;
419
425
for (i = A_diag_i[j]; i < A_diag_i[j+1]; i++)
421
hypre_CSRBlockMatrixBlockNorm(1, &A_diag_data[i*bnnz], &tmp_norm, block_size);
427
hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[i*bnnz], &tmp_norm, block_size);
422
428
rowsum += tmp_norm;
424
430
for (i = A_offd_i[j]; i < A_offd_i[j+1]; i++)
426
hypre_CSRBlockMatrixBlockNorm(1, &A_offd_data[i*bnnz], &tmp_norm, block_size);
432
hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[i*bnnz], &tmp_norm, block_size);
427
433
rowsum += tmp_norm;
429
435
min_rowsum = hypre_min(rowsum, min_rowsum);
564
570
printf( "\n\nBlock Interpolation Matrix Information:\n\n");
571
printf( "(Row sums and weights use sum of all elements in the block - keeping signs)\n\n");
568
printf( "\n\nInterpolation Matrix Information:\n\n");
575
printf( "\n\nInterpolation Matrix Information:\n");
571
579
printf(" entries/row min max");
612
620
if (hypre_CSRBlockMatrixNumCols(P_block_diag))
614
hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[0], &tmp_norm, block_size);
622
hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[0], &tmp_norm, block_size);
615
623
min_weight = tmp_norm;
619
627
for (j = P_diag_i[0]; j < P_diag_i[1]; j++)
621
hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[j*bnnz], &tmp_norm, block_size);
629
hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[j*bnnz], &tmp_norm, block_size);
622
630
min_weight = hypre_min(min_weight, tmp_norm);
624
632
if (tmp_norm != 1.0)
631
639
for (j = P_offd_i[0]; j < P_offd_i[1]; j++)
633
hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[j*bnnz], &tmp_norm, block_size);
641
hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[j*bnnz], &tmp_norm, block_size);
634
642
min_weight = hypre_min(min_weight, tmp_norm);
636
644
if (tmp_norm != 1.0)
654
662
for (i = P_diag_i[j]; i < P_diag_i[j+1]; i++)
656
hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[i*bnnz], &tmp_norm, block_size);
664
hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[i*bnnz], &tmp_norm, block_size);
657
665
min_weight = hypre_min(min_weight, tmp_norm);
659
667
if (tmp_norm != 1.0)
665
673
for (i = P_offd_i[j]; i < P_offd_i[j+1]; i++)
667
hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[i*bnnz], &tmp_norm, block_size);
675
hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[i*bnnz], &tmp_norm, block_size);
668
676
min_weight = hypre_min(min_weight, tmp_norm);
670
678
if (tmp_norm != 1.0)
867
875
printf( " Cycle type (1 = V, 2 = W, etc.): %d\n\n", cycle_type);
868
876
printf( " Relaxation Parameters:\n");
869
877
printf( " Visiting Grid: down up coarse\n");
870
printf( " Number of partial sweeps: %4d %2d %4d \n",
878
printf( " Number of sweeps: %4d %2d %4d \n",
871
879
num_grid_sweeps[1],
872
880
num_grid_sweeps[2],num_grid_sweeps[3]);
873
881
printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d %4d \n",
1006
1014
printf( " Cycle type (1 = V, 2 = W, etc.): %d\n\n", cycle_type);
1007
1015
printf( " Relaxation Parameters:\n");
1008
1016
printf( " Visiting Grid: down up coarse\n");
1009
printf( " Visiting Grid: down up coarse\n");
1010
printf( " Number of partial sweeps: %4d %2d %4d \n",
1017
printf( " Number of sweeps: %4d %2d %4d \n",
1011
1018
num_grid_sweeps[1],
1012
1019
num_grid_sweeps[2],num_grid_sweeps[3]);
1013
1020
printf( " Type 0=Jac, 3=hGS, 6=hSGS, 9=GE: %4d %2d %4d \n",