Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/parcsr_ls/HYPRE_parcsr_amg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,18 @@ HYPRE_BoomerAMGSetIsolatedFPoints(HYPRE_Solver solver,
isolated_fpt_index) );
}

/*--------------------------------------------------------------------------
* HYPRE_BoomerAMGSetUseAuxStrengthMatrix
*--------------------------------------------------------------------------*/

HYPRE_Int
HYPRE_BoomerAMGSetUseAuxStrengthMatrix(HYPRE_Solver solver,
HYPRE_Int use_aux_strength_mat)
{
return (hypre_BoomerAMGSetUseAuxStrengthMatrix( (void *) solver,
use_aux_strength_mat) );
}

/*--------------------------------------------------------------------------
* HYPRE_BoomerAMGSetCumNnzAP
*--------------------------------------------------------------------------*/
Expand All @@ -2262,3 +2274,4 @@ HYPRE_BoomerAMGGetCumNnzAP( HYPRE_Solver solver,
{
return ( hypre_BoomerAMGGetCumNnzAP( (void *) solver, cum_nnz_AP ) );
}

8 changes: 8 additions & 0 deletions src/parcsr_ls/HYPRE_parcsr_ls.h
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,14 @@ HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints(HYPRE_Solver solver,
HYPRE_Int num_isolated_fpt,
HYPRE_BigInt *isolated_fpt_index);

/**
* (Optional) if use_aux_strength_mat equals 1, the strength matrix is created from
* an auxilliary M-matrix that is generated from the original system matrix A.
**/
HYPRE_Int
HYPRE_BoomerAMGSetUseAuxStrengthMatrix(HYPRE_Solver solver,
HYPRE_Int use_aux_strength_mat);

/**
* (Optional) if Sabs equals 1, the strength of connection test is based
* on the absolute value of the matrix coefficients
Expand Down
1 change: 1 addition & 0 deletions src/parcsr_ls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ FILES =\
par_schwarz.c\
par_stats.c\
par_strength.c\
par_aux_strength.c\
par_sv_interp.c\
par_sv_interp_ln.c\
par_vardifconv.c\
Expand Down
26 changes: 25 additions & 1 deletion src/parcsr_ls/_hypre_parcsr_ls.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,14 @@ typedef struct
HYPRE_Solver dslu_solver;
#endif

/* use auxilliary strength matrix */
HYPRE_Int use_aux_strength_matrix;

/* store complexity info */
HYPRE_Real grid_complexity;
HYPRE_Real operator_complexity;
HYPRE_Real memory_complexity;

} hypre_ParAMGData;

/*--------------------------------------------------------------------------
Expand Down Expand Up @@ -581,6 +589,14 @@ typedef struct
#define hypre_ParAMGDataDSLUSolver(amg_data) ((amg_data)->dslu_solver)
#endif

/* use auxilliary matrix for defining strength */
#define hypre_ParAMGDataUseAuxStrengthMatrix(amg_data) ((amg_data)->use_aux_strength_matrix)

/* store complexity info */
#define hypre_ParAMGDataGridComplexity(amg_data) ((amg_data)->grid_complexity)
#define hypre_ParAMGDataOperatorComplexity(amg_data) ((amg_data)->operator_complexity)
#define hypre_ParAMGDataMemoryComplexity(amg_data) ((amg_data)->memory_complexity)

#endif
/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
Expand Down Expand Up @@ -2058,6 +2074,8 @@ HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_
HYPRE_BigInt *isolated_fpt_index );
HYPRE_Int HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt,
HYPRE_BigInt *fpt_index );
HYPRE_Int HYPRE_BoomerAMGSetUseAuxStrengthMatrix(HYPRE_Solver solver,
HYPRE_Int use_aux_strength_mat);
HYPRE_Int HYPRE_BoomerAMGSetCumNnzAP ( HYPRE_Solver solver, HYPRE_Real cum_nnz_AP );
HYPRE_Int HYPRE_BoomerAMGGetCumNnzAP ( HYPRE_Solver solver, HYPRE_Real *cum_nnz_AP );

Expand Down Expand Up @@ -2684,6 +2702,8 @@ HYPRE_Int hypre_BoomerAMGSetFPoints( void *data, HYPRE_Int isolated, HYPRE_Int n
HYPRE_Int hypre_BoomerAMGSetCumNnzAP ( void *data, HYPRE_Real cum_nnz_AP );
HYPRE_Int hypre_BoomerAMGGetCumNnzAP ( void *data, HYPRE_Real *cum_nnz_AP );

HYPRE_Int hypre_BoomerAMGSetUseAuxStrengthMatrix( void *data, HYPRE_Int use_aux_strength_mat);

/* par_amg_setup.c */
HYPRE_Int hypre_BoomerAMGSetup ( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f,
hypre_ParVector *u );
Expand Down Expand Up @@ -3098,6 +3118,9 @@ HYPRE_Int hypre_IntersectTwoArrays ( HYPRE_Int *x, HYPRE_Real *x_data, HYPRE_Int
HYPRE_Int hypre_IntersectTwoBigArrays ( HYPRE_BigInt *x, HYPRE_Real *x_data, HYPRE_Int x_length,
HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z, HYPRE_Real *output_x_data,
HYPRE_Int *intersect_length );
HYPRE_Int hypre_IntersectTwoBigIntegerArrays ( HYPRE_BigInt *x, HYPRE_Int x_length,
HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z,
HYPRE_Int *intersect_length );
HYPRE_Int hypre_SortedCopyParCSRData ( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B );
HYPRE_Int hypre_BoomerAMG_MyCreateS ( hypre_ParCSRMatrix *A, HYPRE_Real strength_threshold,
HYPRE_Real max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr );
Expand Down Expand Up @@ -3365,7 +3388,8 @@ HYPRE_Int hypre_BoomerAMGCreateSabsHost ( hypre_ParCSRMatrix *A, HYPRE_Real stre
HYPRE_Int hypre_BoomerAMGCreate2ndSDevice( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker,
HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr);
HYPRE_Int hypre_BoomerAMGMakeSocFromSDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S);

HYPRE_Int hypre_BoomerAMGCreateAuxS(hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S,
hypre_ParCSRMatrix **S_aux_ptr, HYPRE_Int method);

/* par_sv_interp.c */
HYPRE_Int hypre_BoomerAMGSmoothInterpVectors ( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs,
Expand Down
23 changes: 22 additions & 1 deletion src/parcsr_ls/par_amg.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ hypre_BoomerAMGCreate( void )
HYPRE_Int rap2;
HYPRE_Int keepT;
HYPRE_Int modu_rap;
HYPRE_Int use_aux_strength_mat;

/* solve params */
HYPRE_Int min_iter;
Expand Down Expand Up @@ -305,6 +306,8 @@ hypre_BoomerAMGCreate( void )
keepT = 0;
modu_rap = 0;

use_aux_strength_mat = -1;

if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE)
{
keepT = 1;
Expand Down Expand Up @@ -546,6 +549,8 @@ hypre_BoomerAMGCreate( void )
hypre_ParAMGDataKeepTranspose(amg_data) = keepT;
hypre_ParAMGDataModularizedMatMat(amg_data) = modu_rap;

hypre_ParAMGDataUseAuxStrengthMatrix(amg_data) = use_aux_strength_mat;

/* information for preserving indices as coarse grid points */
hypre_ParAMGDataCPointsMarker(amg_data) = NULL;
hypre_ParAMGDataCPointsLocalMarker(amg_data) = NULL;
Expand All @@ -563,6 +568,11 @@ hypre_BoomerAMGCreate( void )
hypre_ParAMGDataDSLUSolver(amg_data) = NULL;
#endif

/* init complexity info */
hypre_ParAMGDataGridComplexity(amg_data) = -1.0;
hypre_ParAMGDataOperatorComplexity(amg_data) = -1.0;
hypre_ParAMGDataMemoryComplexity(amg_data) = -1.0;

HYPRE_ANNOTATE_FUNC_END;

return (void *) amg_data;
Expand Down Expand Up @@ -5212,6 +5222,17 @@ hypre_BoomerAMGSetFPoints(void *data,
return hypre_error_flag;
}

HYPRE_Int
hypre_BoomerAMGSetUseAuxStrengthMatrix( void *data,
HYPRE_Int use_aux_strength_mat)
{
hypre_ParAMGData *amg_data = (hypre_ParAMGData*) data;

hypre_ParAMGDataUseAuxStrengthMatrix(amg_data) = use_aux_strength_mat;

return hypre_error_flag;
}

HYPRE_Int
hypre_BoomerAMGSetCumNnzAP( void *data,
HYPRE_Real cum_nnz_AP )
Expand All @@ -5228,7 +5249,6 @@ hypre_BoomerAMGSetCumNnzAP( void *data,
return hypre_error_flag;
}


HYPRE_Int
hypre_BoomerAMGGetCumNnzAP( void *data,
HYPRE_Real *cum_nnz_AP )
Expand All @@ -5244,3 +5264,4 @@ hypre_BoomerAMGGetCumNnzAP( void *data,

return hypre_error_flag;
}

16 changes: 16 additions & 0 deletions src/parcsr_ls/par_amg.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ typedef struct
HYPRE_Solver dslu_solver;
#endif

/* use auxilliary strength matrix */
HYPRE_Int use_aux_strength_matrix;

/* store complexity info */
HYPRE_Real grid_complexity;
HYPRE_Real operator_complexity;
HYPRE_Real memory_complexity;

} hypre_ParAMGData;

/*--------------------------------------------------------------------------
Expand Down Expand Up @@ -563,4 +571,12 @@ typedef struct
#define hypre_ParAMGDataDSLUSolver(amg_data) ((amg_data)->dslu_solver)
#endif

/* use auxilliary matrix for defining strength */
#define hypre_ParAMGDataUseAuxStrengthMatrix(amg_data) ((amg_data)->use_aux_strength_matrix)

/* store complexity info */
#define hypre_ParAMGDataGridComplexity(amg_data) ((amg_data)->grid_complexity)
#define hypre_ParAMGDataOperatorComplexity(amg_data) ((amg_data)->operator_complexity)
#define hypre_ParAMGDataMemoryComplexity(amg_data) ((amg_data)->memory_complexity)

#endif
Loading