added relax_type 8, which uses ParCSRRelax, block Gauss-Seidel smoothed
with L1-norms on off diagonal part of matrix (no CF-relaxation possible)
This commit is contained in:
parent
e939497362
commit
915acf6b26
@ -255,6 +255,7 @@ hypre_BoomerAMGCreate()
|
||||
hypre_ParAMGDataDofPointArray(amg_data) = NULL;
|
||||
hypre_ParAMGDataPointDofMapArray(amg_data) = NULL;
|
||||
hypre_ParAMGDataSmoother(amg_data) = NULL;
|
||||
hypre_ParAMGDataL1Norms(amg_data) = NULL;
|
||||
|
||||
hypre_ParAMGDataABlockArray(amg_data) = NULL;
|
||||
hypre_ParAMGDataPBlockArray(amg_data) = NULL;
|
||||
@ -333,6 +334,14 @@ hypre_BoomerAMGDestroy( void *data )
|
||||
|
||||
}
|
||||
|
||||
if (hypre_ParAMGDataL1Norms(amg_data))
|
||||
{
|
||||
for (i=0; i < num_levels; i++)
|
||||
if (hypre_ParAMGDataL1Norms(amg_data)[i])
|
||||
hypre_TFree(hypre_ParAMGDataL1Norms(amg_data)[i]);
|
||||
hypre_TFree(hypre_ParAMGDataL1Norms(amg_data));
|
||||
}
|
||||
|
||||
/* get rid of a fine level block matrix */
|
||||
if (hypre_ParAMGDataABlockArray(amg_data))
|
||||
if (hypre_ParAMGDataABlockArray(amg_data)[0])
|
||||
|
||||
@ -97,6 +97,7 @@ typedef struct
|
||||
int **dof_point_array;
|
||||
int **point_dof_map_array;
|
||||
int num_levels;
|
||||
double **l1_norms;
|
||||
|
||||
|
||||
/* Block data */
|
||||
@ -178,6 +179,7 @@ typedef struct
|
||||
#define hypre_ParAMGDataCRRate(amg_data) ((amg_data)->CR_rate)
|
||||
#define hypre_ParAMGDataISType(amg_data) ((amg_data)->IS_type)
|
||||
#define hypre_ParAMGDataCRUseCG(amg_data) ((amg_data)->CR_use_CG)
|
||||
#define hypre_ParAMGDataL1Norms(amg_data) ((amg_data)->l1_norms)
|
||||
|
||||
/* solve params */
|
||||
|
||||
|
||||
@ -104,6 +104,7 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
hypre_ParCSRMatrix *A_H;
|
||||
hypre_ParCSRMatrix *AN;
|
||||
double *SmoothVecs = NULL;
|
||||
double **l1_norms = NULL;
|
||||
|
||||
int old_num_levels, num_levels;
|
||||
int level;
|
||||
@ -201,7 +202,6 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
grid_relax_type[3] = hypre_ParAMGDataUserCoarseRelaxType(amg_data);
|
||||
|
||||
|
||||
|
||||
/* Verify that settings are correct for solving systmes */
|
||||
/* If the user has specified either a block interpolation or a block relaxation then
|
||||
we need to make sure the other has been choosen as well - so we can be
|
||||
@ -1635,8 +1635,22 @@ hypre_BoomerAMGSetup( void *amg_vdata,
|
||||
* Setup F and U arrays
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
if (grid_relax_type[1] == 8)
|
||||
{
|
||||
l1_norms = hypre_CTAlloc(double *, num_levels);
|
||||
hypre_ParAMGDataL1Norms(amg_data) = l1_norms;
|
||||
}
|
||||
|
||||
for (j = 0; j < num_levels; j++)
|
||||
{
|
||||
if (grid_relax_type[1] == 8 && j < num_levels-1)
|
||||
{
|
||||
hypre_ParCSRComputeL1Norms(A_array[j], 2, &l1_norms[j]);
|
||||
}
|
||||
else if (grid_relax_type[3] == 8 && j == num_levels-1)
|
||||
{
|
||||
hypre_ParCSRComputeL1Norms(A_array[j], 2, &l1_norms[j]);
|
||||
}
|
||||
if ((smooth_type == 9 || smooth_type == 19) && smooth_num_levels > j)
|
||||
{
|
||||
HYPRE_EuclidCreate(comm, &smoother[j]);
|
||||
|
||||
@ -114,6 +114,7 @@ hypre_BoomerAMGCycle( void *amg_vdata,
|
||||
int smooth_num_levels;
|
||||
|
||||
double alpha;
|
||||
double **l1_norms = NULL;
|
||||
|
||||
#if 0
|
||||
double *D_mat;
|
||||
@ -147,6 +148,7 @@ hypre_BoomerAMGCycle( void *amg_vdata,
|
||||
omega = hypre_ParAMGDataOmega(amg_data);
|
||||
smooth_type = hypre_ParAMGDataSmoothType(amg_data);
|
||||
smooth_num_levels = hypre_ParAMGDataSmoothNumLevels(amg_data);
|
||||
l1_norms = hypre_ParAMGDataL1Norms(amg_data);
|
||||
/* smooth_option = hypre_ParAMGDataSmoothOption(amg_data); */
|
||||
|
||||
cycle_op_count = hypre_ParAMGDataCycleOpCount(amg_data);
|
||||
@ -317,6 +319,19 @@ hypre_BoomerAMGCycle( void *amg_vdata,
|
||||
cycle_op_count += num_coeffs[level];
|
||||
}
|
||||
|
||||
if (relax_type == 8)
|
||||
{
|
||||
hypre_ParCSRRelax(A_array[level],
|
||||
Aux_F,
|
||||
2,
|
||||
1,
|
||||
l1_norms[level],
|
||||
relax_weight[level],
|
||||
omega[level],
|
||||
Aux_U,
|
||||
Vtemp);
|
||||
|
||||
}
|
||||
if (smooth_num_levels > level &&
|
||||
(smooth_type == 7 || smooth_type == 8 ||
|
||||
smooth_type == 9 || smooth_type == 19 ||
|
||||
|
||||
@ -866,7 +866,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata,
|
||||
grid_relax_type[1],
|
||||
grid_relax_type[2],grid_relax_type[3]);
|
||||
printf( " Point types, partial sweeps (1=C, -1=F):\n");
|
||||
if (grid_relax_points)
|
||||
if (grid_relax_points && grid_relax_type[1] != 8)
|
||||
{
|
||||
printf( " Pre-CG relaxation (down):");
|
||||
for (j = 0; j < num_grid_sweeps[1]; j++)
|
||||
@ -881,7 +881,7 @@ hypre_BoomerAMGSetupStats( void *amg_vdata,
|
||||
printf(" %2d", grid_relax_points[3][j]);
|
||||
printf( "\n\n");
|
||||
}
|
||||
else if (relax_order == 1)
|
||||
else if (relax_order == 1 && grid_relax_type[1] != 8)
|
||||
{
|
||||
printf( " Pre-CG relaxation (down):");
|
||||
for (j = 0; j < num_grid_sweeps[1]; j++)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user