-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new struct to hold convergence parameters for the Krylov solvers. #1172
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other | ||
* HYPRE Project Developers. See the top-level COPYRIGHT file for details. | ||
* | ||
* SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
******************************************************************************/ | ||
|
||
/****************************************************************************** | ||
* | ||
* Krylov convergence parameters header | ||
* | ||
*****************************************************************************/ | ||
|
||
#ifndef hypre_CONV_PARAMS_HEADER | ||
#define hypre_CONV_PARAMS_HEADER | ||
|
||
|
||
/** | ||
* The {\tt hypre\_conv\_params} object ... | ||
**/ | ||
|
||
/* | ||
Summary of Parameters to Control Stopping Test: | ||
- tol = relative error tolerance, as above | ||
-a_tol = absolute convergence tolerance (default is 0.0) | ||
If one desires the convergence test to check the absolute | ||
convergence tolerance *only*, then set the relative convergence | ||
tolerance to 0.0. (The default convergence test is <C*r,r> <= | ||
max(relative_tolerance^2 * <C*b, b>, absolute_tolerance^2) | ||
- cf_tol = convergence factor tolerance; if >0 used for special test | ||
for slow convergence | ||
- atolf = absolute error tolerance factor to be used _together_ with the | ||
relative error tolerance, |delta-residual| / ( atolf + |right-hand-side| ) < tol | ||
(To BE PHASED OUT) | ||
*/ | ||
|
||
typedef struct | ||
{ | ||
HYPRE_Real tol; | ||
HYPRE_Real atolf; | ||
HYPRE_Real cf_tol; | ||
HYPRE_Real a_tol; | ||
HYPRE_Real rtol; | ||
|
||
HYPRE_Real rel_residual_norm; | ||
|
||
} hypre_conv_params; | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,49 @@ | |
extern "C" { | ||
#endif | ||
|
||
/****************************************************************************** | ||
* | ||
* Krylov convergence parameters header | ||
* | ||
*****************************************************************************/ | ||
|
||
#ifndef hypre_CONV_PARAMS_HEADER | ||
#define hypre_CONV_PARAMS_HEADER | ||
|
||
|
||
/** | ||
* The {\tt hypre\_conv\_params} object ... | ||
**/ | ||
|
||
/* | ||
Summary of Parameters to Control Stopping Test: | ||
- tol = relative error tolerance, as above | ||
-a_tol = absolute convergence tolerance (default is 0.0) | ||
If one desires the convergence test to check the absolute | ||
convergence tolerance *only*, then set the relative convergence | ||
tolerance to 0.0. (The default convergence test is <C*r,r> <= | ||
max(relative_tolerance^2 * <C*b, b>, absolute_tolerance^2) | ||
- cf_tol = convergence factor tolerance; if >0 used for special test | ||
for slow convergence | ||
- atolf = absolute error tolerance factor to be used _together_ with the | ||
relative error tolerance, |delta-residual| / ( atolf + |right-hand-side| ) < tol | ||
(To BE PHASED OUT) | ||
*/ | ||
|
||
typedef struct | ||
{ | ||
HYPRE_Real tol; | ||
HYPRE_Real atolf; | ||
HYPRE_Real cf_tol; | ||
HYPRE_Real a_tol; | ||
HYPRE_Real rtol; | ||
|
||
HYPRE_Real rel_residual_norm; | ||
|
||
} hypre_conv_params; | ||
|
||
#endif | ||
|
||
/****************************************************************************** | ||
* | ||
* BiCGSTAB bicgstab | ||
|
@@ -1109,11 +1152,8 @@ typedef struct | |
|
||
typedef struct | ||
{ | ||
HYPRE_Real tol; | ||
HYPRE_Real atolf; | ||
HYPRE_Real cf_tol; | ||
HYPRE_Real a_tol; | ||
HYPRE_Real rtol; | ||
void *conv_params; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this have to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rfalgout indeed I can do something similar for this. The type of the struct will be inferred by the precision in which we are building functions in pcg.c. So the struct's precision type will be the same as the function's. |
||
|
||
HYPRE_Int max_iter; | ||
HYPRE_Int two_norm; | ||
HYPRE_Int rel_change; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't conform to our naming conventions. Should be
hypre_ConvParams
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rfalgout yes, I agree. I expected to change this at some point.