| 1 | /*BHEADER**********************************************************************
|
|---|
| 2 | * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
|---|
| 3 | * Produced at the Lawrence Livermore National Laboratory.
|
|---|
| 4 | * This file is part of HYPRE. See file COPYRIGHT for details.
|
|---|
| 5 | *
|
|---|
| 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.
|
|---|
| 9 | *
|
|---|
| 10 | * $Revision: 2.4 $
|
|---|
| 11 | ***********************************************************************EHEADER*/
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | /******************************************************************************
|
|---|
| 16 | *
|
|---|
| 17 | * Header file for HYPRE_ls library
|
|---|
| 18 | *
|
|---|
| 19 | *****************************************************************************/
|
|---|
| 20 |
|
|---|
| 21 | #ifndef HYPRE_PARCSR_LS_HEADER
|
|---|
| 22 | #define HYPRE_PARCSR_LS_HEADER
|
|---|
| 23 |
|
|---|
| 24 | #include "HYPRE.h"
|
|---|
| 25 | #include "HYPRE_utilities.h"
|
|---|
| 26 | #include "HYPRE_seq_mv.h"
|
|---|
| 27 | #include "HYPRE_parcsr_mv.h"
|
|---|
| 28 | #include "HYPRE_IJ_mv.h"
|
|---|
| 29 |
|
|---|
| 30 | #ifdef __cplusplus
|
|---|
| 31 | extern "C" {
|
|---|
| 32 | #endif
|
|---|
| 33 |
|
|---|
| 34 | /*--------------------------------------------------------------------------
|
|---|
| 35 | *--------------------------------------------------------------------------*/
|
|---|
| 36 |
|
|---|
| 37 | /**
|
|---|
| 38 | * @name ParCSR Solvers
|
|---|
| 39 | *
|
|---|
| 40 | * These solvers use matrix/vector storage schemes that are taylored
|
|---|
| 41 | * for general sparse matrix systems.
|
|---|
| 42 | *
|
|---|
| 43 | * @memo Linear solvers for sparse matrix systems
|
|---|
| 44 | **/
|
|---|
| 45 | /*@{*/
|
|---|
| 46 |
|
|---|
| 47 | /*--------------------------------------------------------------------------
|
|---|
| 48 | *--------------------------------------------------------------------------*/
|
|---|
| 49 |
|
|---|
| 50 | /**
|
|---|
| 51 | * @name ParCSR Solvers
|
|---|
| 52 | **/
|
|---|
| 53 | /*@{*/
|
|---|
| 54 |
|
|---|
| 55 | struct hypre_Solver_struct;
|
|---|
| 56 | /**
|
|---|
| 57 | * The solver object.
|
|---|
| 58 | **/
|
|---|
| 59 |
|
|---|
| 60 | #ifndef HYPRE_SOLVER_STRUCT
|
|---|
| 61 | #define HYPRE_SOLVER_STRUCT
|
|---|
| 62 | struct hypre_Solver_struct;
|
|---|
| 63 | typedef struct hypre_Solver_struct *HYPRE_Solver;
|
|---|
| 64 | #endif
|
|---|
| 65 |
|
|---|
| 66 | typedef int (*HYPRE_PtrToParSolverFcn)(HYPRE_Solver,
|
|---|
| 67 | HYPRE_ParCSRMatrix,
|
|---|
| 68 | HYPRE_ParVector,
|
|---|
| 69 | HYPRE_ParVector);
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 | #ifndef HYPRE_MODIFYPC
|
|---|
| 73 | #define HYPRE_MODIFYPC
|
|---|
| 74 | typedef int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver,
|
|---|
| 75 | int,
|
|---|
| 76 | double);
|
|---|
| 77 | #endif
|
|---|
| 78 |
|
|---|
| 79 | /*@}*/
|
|---|
| 80 |
|
|---|
| 81 | /*--------------------------------------------------------------------------
|
|---|
| 82 | *--------------------------------------------------------------------------*/
|
|---|
| 83 |
|
|---|
| 84 | /**
|
|---|
| 85 | * @name ParCSR BoomerAMG Solver and Preconditioner
|
|---|
| 86 | *
|
|---|
| 87 | * Parallel unstructured algebraic multigrid solver and preconditioner
|
|---|
| 88 | **/
|
|---|
| 89 | /*@{*/
|
|---|
| 90 |
|
|---|
| 91 | /**
|
|---|
| 92 | * Create a solver object.
|
|---|
| 93 | **/
|
|---|
| 94 | int HYPRE_BoomerAMGCreate(HYPRE_Solver *solver);
|
|---|
| 95 |
|
|---|
| 96 | /**
|
|---|
| 97 | * Destroy a solver object.
|
|---|
| 98 | **/
|
|---|
| 99 | int HYPRE_BoomerAMGDestroy(HYPRE_Solver solver);
|
|---|
| 100 |
|
|---|
| 101 | /**
|
|---|
| 102 | * Set up the BoomerAMG solver or preconditioner.
|
|---|
| 103 | * If used as a preconditioner, this function should be passed
|
|---|
| 104 | * to the iterative solver {\tt SetPrecond} function.
|
|---|
| 105 | *
|
|---|
| 106 | * @param solver [IN] object to be set up.
|
|---|
| 107 | * @param A [IN] ParCSR matrix used to construct the solver/preconditioner.
|
|---|
| 108 | * @param b Ignored by this function.
|
|---|
| 109 | * @param x Ignored by this function.
|
|---|
| 110 | **/
|
|---|
| 111 | int HYPRE_BoomerAMGSetup(HYPRE_Solver solver,
|
|---|
| 112 | HYPRE_ParCSRMatrix A,
|
|---|
| 113 | HYPRE_ParVector b,
|
|---|
| 114 | HYPRE_ParVector x);
|
|---|
| 115 |
|
|---|
| 116 | /**
|
|---|
| 117 | * Solve the system or apply AMG as a preconditioner.
|
|---|
| 118 | * If used as a preconditioner, this function should be passed
|
|---|
| 119 | * to the iterative solver {\tt SetPrecond} function.
|
|---|
| 120 | *
|
|---|
| 121 | * @param solver [IN] solver or preconditioner object to be applied.
|
|---|
| 122 | * @param A [IN] ParCSR matrix, matrix of the linear system to be solved
|
|---|
| 123 | * @param b [IN] right hand side of the linear system to be solved
|
|---|
| 124 | * @param x [OUT] approximated solution of the linear system to be solved
|
|---|
| 125 | **/
|
|---|
| 126 | int HYPRE_BoomerAMGSolve(HYPRE_Solver solver,
|
|---|
| 127 | HYPRE_ParCSRMatrix A,
|
|---|
| 128 | HYPRE_ParVector b,
|
|---|
| 129 | HYPRE_ParVector x);
|
|---|
| 130 |
|
|---|
| 131 | /**
|
|---|
| 132 | * Solve the transpose system $A^T x = b$ or apply AMG as a preconditioner
|
|---|
| 133 | * to the transpose system .
|
|---|
| 134 | * If used as a preconditioner, this function should be passed
|
|---|
| 135 | * to the iterative solver {\tt SetPrecond} function.
|
|---|
| 136 | *
|
|---|
| 137 | * @param solver [IN] solver or preconditioner object to be applied.
|
|---|
| 138 | * @param A [IN] ParCSR matrix
|
|---|
| 139 | * @param b [IN] right hand side of the linear system to be solved
|
|---|
| 140 | * @param x [OUT] approximated solution of the linear system to be solved
|
|---|
| 141 | **/
|
|---|
| 142 | int HYPRE_BoomerAMGSolveT(HYPRE_Solver solver,
|
|---|
| 143 | HYPRE_ParCSRMatrix A,
|
|---|
| 144 | HYPRE_ParVector b,
|
|---|
| 145 | HYPRE_ParVector x);
|
|---|
| 146 |
|
|---|
| 147 | /**
|
|---|
| 148 | * (Optional) Set the convergence tolerance, if BoomerAMG is used
|
|---|
| 149 | * as a solver. If it is used as a preconditioner, this function has
|
|---|
| 150 | * no effect. The default is 1.e-7.
|
|---|
| 151 | **/
|
|---|
| 152 | int HYPRE_BoomerAMGSetTol(HYPRE_Solver solver,
|
|---|
| 153 | double tol);
|
|---|
| 154 |
|
|---|
| 155 | /**
|
|---|
| 156 | * (Optional) Sets maximum number of iterations, if BoomerAMG is used
|
|---|
| 157 | * as a solver. If it is used as a preconditioner, this function has
|
|---|
| 158 | * no effect. The default is 20.
|
|---|
| 159 | **/
|
|---|
| 160 | int HYPRE_BoomerAMGSetMaxIter(HYPRE_Solver solver,
|
|---|
| 161 | int max_iter);
|
|---|
| 162 |
|
|---|
| 163 | /**
|
|---|
| 164 | * (Optional) Sets maximum number of multigrid levels.
|
|---|
| 165 | * The default is 25.
|
|---|
| 166 | **/
|
|---|
| 167 | int HYPRE_BoomerAMGSetMaxLevels(HYPRE_Solver solver,
|
|---|
| 168 | int max_levels);
|
|---|
| 169 |
|
|---|
| 170 | /**
|
|---|
| 171 | * (Optional) Sets AMG strength threshold. The default is 0.25.
|
|---|
| 172 | * For 2d Laplace operators, 0.25 is a good value, for 3d Laplace
|
|---|
| 173 | * operators, 0.5 or 0.6 is a better value. For elasticity problems,
|
|---|
| 174 | * a large strength threshold, such as 0.9, is often better.
|
|---|
| 175 | **/
|
|---|
| 176 | int HYPRE_BoomerAMGSetStrongThreshold(HYPRE_Solver solver,
|
|---|
| 177 | double strong_threshold);
|
|---|
| 178 |
|
|---|
| 179 | /**
|
|---|
| 180 | * (Optional) Sets a parameter to modify the definition of strength for
|
|---|
| 181 | * diagonal dominant portions of the matrix. The default is 0.9.
|
|---|
| 182 | * If max\_row\_sum is 1, no checking for diagonally dominant rows is
|
|---|
| 183 | * performed.
|
|---|
| 184 | **/
|
|---|
| 185 | int HYPRE_BoomerAMGSetMaxRowSum(HYPRE_Solver solver,
|
|---|
| 186 | double max_row_sum);
|
|---|
| 187 |
|
|---|
| 188 | /**
|
|---|
| 189 | * (Optional) Defines which parallel coarsening algorithm is used.
|
|---|
| 190 | * There are the following options for coarsen\_type:
|
|---|
| 191 | *
|
|---|
| 192 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 193 | * 0 & CLJP-coarsening (a parallel coarsening algorithm using independent sets. \\
|
|---|
| 194 | * 1 & classical Ruge-Stueben coarsening on each processor, no boundary treatment (not recommended!) \\
|
|---|
| 195 | * 3 & classical Ruge-Stueben coarsening on each processor, followed by a third pass, which adds coarse \\
|
|---|
| 196 | * & points on the boundaries \\
|
|---|
| 197 | * 6 & Falgout coarsening (uses 1 first, followed by CLJP using the interior coarse points \\
|
|---|
| 198 | * & generated by 1 as its first independent set) \\
|
|---|
| 199 | * 7 & CLJP-coarsening (using a fixed random vector, for debugging purposes only) \\
|
|---|
| 200 | * 8 & PMIS-coarsening (a parallel coarsening algorithm using independent sets, generating \\
|
|---|
| 201 | * & lower complexities than CLJP, might also lead to slower convergence) \\
|
|---|
| 202 | * 9 & PMIS-coarsening (using a fixed random vector, for debugging purposes only) \\
|
|---|
| 203 | * 10 & HMIS-coarsening (uses one pass Ruge-Stueben on each processor independently, followed \\
|
|---|
| 204 | * & by PMIS using the interior C-points generated as its first independent set) \\
|
|---|
| 205 | * 11 & one-pass Ruge-Stueben coarsening on each processor, no boundary treatment (not recommended!) \\
|
|---|
| 206 | * \hline
|
|---|
| 207 | * \end{tabular}
|
|---|
| 208 | *
|
|---|
| 209 | * The default is 6.
|
|---|
| 210 | **/
|
|---|
| 211 | int HYPRE_BoomerAMGSetCoarsenType(HYPRE_Solver solver,
|
|---|
| 212 | int coarsen_type);
|
|---|
| 213 |
|
|---|
| 214 | /**
|
|---|
| 215 | * (Optional) Defines whether local or global measures are used.
|
|---|
| 216 | **/
|
|---|
| 217 | int HYPRE_BoomerAMGSetMeasureType(HYPRE_Solver solver,
|
|---|
| 218 | int measure_type);
|
|---|
| 219 |
|
|---|
| 220 | /**
|
|---|
| 221 | * (Optional) Defines the type of cycle.
|
|---|
| 222 | * For a V-cycle, set cycle\_type to 1, for a W-cycle
|
|---|
| 223 | * set cycle\_type to 2. The default is 1.
|
|---|
| 224 | **/
|
|---|
| 225 | int HYPRE_BoomerAMGSetCycleType(HYPRE_Solver solver,
|
|---|
| 226 | int cycle_type);
|
|---|
| 227 |
|
|---|
| 228 | /**
|
|---|
| 229 | * (Optional) Defines the number of sweeps for the fine and coarse grid,
|
|---|
| 230 | * the up and down cycle.
|
|---|
| 231 | *
|
|---|
| 232 | * Note: This routine will be phased out!!!!
|
|---|
| 233 | * Use HYPRE\_BoomerAMGSetNumSweeps or HYPRE\_BoomerAMGSetCycleNumSweeps instead.
|
|---|
| 234 | **/
|
|---|
| 235 | int HYPRE_BoomerAMGSetNumGridSweeps(HYPRE_Solver solver,
|
|---|
| 236 | int *num_grid_sweeps);
|
|---|
| 237 |
|
|---|
| 238 | /**
|
|---|
| 239 | * (Optional) Sets the number of sweeps. On the finest level, the up and
|
|---|
| 240 | * the down cycle the number of sweeps are set to num\_sweeps and on the
|
|---|
| 241 | * coarsest level to 1. The default is 1.
|
|---|
| 242 | **/
|
|---|
| 243 | int HYPRE_BoomerAMGSetNumSweeps(HYPRE_Solver solver,
|
|---|
| 244 | int num_sweeps);
|
|---|
| 245 |
|
|---|
| 246 | /**
|
|---|
| 247 | * (Optional) Sets the number of sweeps at a specified cycle.
|
|---|
| 248 | * There are the following options for k:
|
|---|
| 249 | *
|
|---|
| 250 | * \begin{tabular}{|l|l|} \hline
|
|---|
| 251 | * the finest level & if k=0 \\
|
|---|
| 252 | * the down cycle & if k=1 \\
|
|---|
| 253 | * the up cycle & if k=2 \\
|
|---|
| 254 | * the coarsest level & if k=3.\\
|
|---|
| 255 | * \hline
|
|---|
| 256 | * \end{tabular}
|
|---|
| 257 | **/
|
|---|
| 258 | int HYPRE_BoomerAMGSetCycleNumSweeps(HYPRE_Solver solver,
|
|---|
| 259 | int num_sweeps,
|
|---|
| 260 | int k);
|
|---|
| 261 |
|
|---|
| 262 | /**
|
|---|
| 263 | * (Optional) Defines which smoother is used on the fine and coarse grid,
|
|---|
| 264 | * the up and down cycle.
|
|---|
| 265 | *
|
|---|
| 266 | * Note: This routine will be phased out!!!!
|
|---|
| 267 | * Use HYPRE\_BoomerAMGSetRelaxType or HYPRE\_BoomerAMGSetCycleRelaxType instead.
|
|---|
| 268 | **/
|
|---|
| 269 | int HYPRE_BoomerAMGSetGridRelaxType(HYPRE_Solver solver,
|
|---|
| 270 | int *grid_relax_type);
|
|---|
| 271 |
|
|---|
| 272 | /**
|
|---|
| 273 | * (Optional) Defines the smoother to be used. It uses the given
|
|---|
| 274 | * smoother on the fine grid, the up and
|
|---|
| 275 | * the down cycle and sets the solver on the coarsest level to Gaussian
|
|---|
| 276 | * elimination (9). The default is Gauss-Seidel (3).
|
|---|
| 277 | *
|
|---|
| 278 | * There are the following options for relax\_type:
|
|---|
| 279 | *
|
|---|
| 280 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 281 | * 0 & Jacobi \\
|
|---|
| 282 | * 1 & Gauss-Seidel, sequential (very slow!) \\
|
|---|
| 283 | * 2 & Gauss-Seidel, interior points in parallel, boundary sequential (slow!) \\
|
|---|
| 284 | * 3 & hybrid Gauss-Seidel or SOR, forward solve \\
|
|---|
| 285 | * 4 & hybrid Gauss-Seidel or SOR, backward solve \\
|
|---|
| 286 | * 5 & hybrid chaotic Gauss-Seidel (works only with OpenMP) \\
|
|---|
| 287 | * 6 & hybrid symmetric Gauss-Seidel or SSOR \\
|
|---|
| 288 | * 9 & Gaussian elimination (only on coarsest level) \\
|
|---|
| 289 | * \hline
|
|---|
| 290 | * \end{tabular}
|
|---|
| 291 | **/
|
|---|
| 292 | int HYPRE_BoomerAMGSetRelaxType(HYPRE_Solver solver,
|
|---|
| 293 | int relax_type);
|
|---|
| 294 |
|
|---|
| 295 | /**
|
|---|
| 296 | * (Optional) Defines the smoother at a given cycle.
|
|---|
| 297 | * For options of relax\_type see
|
|---|
| 298 | * description of HYPRE\_BoomerAMGSetRelaxType). Options for k are
|
|---|
| 299 | *
|
|---|
| 300 | * \begin{tabular}{|l|l|} \hline
|
|---|
| 301 | * the finest level & if k=0 \\
|
|---|
| 302 | * the down cycle & if k=1 \\
|
|---|
| 303 | * the up cycle & if k=2 \\
|
|---|
| 304 | * the coarsest level & if k=3. \\
|
|---|
| 305 | * \hline
|
|---|
| 306 | * \end{tabular}
|
|---|
| 307 | **/
|
|---|
| 308 | int HYPRE_BoomerAMGSetCycleRelaxType(HYPRE_Solver solver,
|
|---|
| 309 | int relax_type,
|
|---|
| 310 | int k);
|
|---|
| 311 |
|
|---|
| 312 | /**
|
|---|
| 313 | * (Optional) Defines in which order the points are relaxed. There are
|
|---|
| 314 | * the following options for
|
|---|
| 315 | * relax\_order:
|
|---|
| 316 | *
|
|---|
| 317 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 318 | * 0 & the points are relaxed in natural or lexicographic
|
|---|
| 319 | * order on each processor \\
|
|---|
| 320 | * 1 & CF-relaxation is used, i.e on the fine grid and the down
|
|---|
| 321 | * cycle the coarse points are relaxed first, \\
|
|---|
| 322 | * & followed by the fine points; on the up cycle the F-points are relaxed
|
|---|
| 323 | * first, followed by the C-points. \\
|
|---|
| 324 | * & On the coarsest level, if an iterative scheme is used,
|
|---|
| 325 | * the points are relaxed in lexicographic order. \\
|
|---|
| 326 | * \hline
|
|---|
| 327 | * \end{tabular}
|
|---|
| 328 | *
|
|---|
| 329 | * The default is 1 (CF-relaxation).
|
|---|
| 330 | **/
|
|---|
| 331 | int HYPRE_BoomerAMGSetRelaxOrder(HYPRE_Solver solver,
|
|---|
| 332 | int relax_order);
|
|---|
| 333 |
|
|---|
| 334 | /**
|
|---|
| 335 | * (Optional) Defines in which order the points are relaxed.
|
|---|
| 336 | *
|
|---|
| 337 | * Note: This routine will be phased out!!!!
|
|---|
| 338 | * Use HYPRE\_BoomerAMGSetRelaxOrder instead.
|
|---|
| 339 | **/
|
|---|
| 340 | int HYPRE_BoomerAMGSetGridRelaxPoints(HYPRE_Solver solver,
|
|---|
| 341 | int **grid_relax_points);
|
|---|
| 342 |
|
|---|
| 343 | /**
|
|---|
| 344 | * (Optional) Defines the relaxation weight for smoothed Jacobi and hybrid SOR.
|
|---|
| 345 | *
|
|---|
| 346 | * Note: This routine will be phased out!!!!
|
|---|
| 347 | * Use HYPRE\_BoomerAMGSetRelaxWt or HYPRE\_BoomerAMGSetLevelRelaxWt instead.
|
|---|
| 348 | **/
|
|---|
| 349 | int HYPRE_BoomerAMGSetRelaxWeight(HYPRE_Solver solver,
|
|---|
| 350 | double *relax_weight);
|
|---|
| 351 | /**
|
|---|
| 352 | * (Optional) Defines the relaxation weight for smoothed Jacobi and hybrid SOR
|
|---|
| 353 | * on all levels.
|
|---|
| 354 | *
|
|---|
| 355 | * \begin{tabular}{|l|l|} \hline
|
|---|
| 356 | * relax\_weight > 0 & this assigns the given relaxation weight on all levels \\
|
|---|
| 357 | * relax\_weight = 0 & the weight is determined on each level
|
|---|
| 358 | * with the estimate $3 \over {4\|D^{-1/2}AD^{-1/2}\|}$,\\
|
|---|
| 359 | * & where $D$ is the diagonal matrix of $A$ (this should only be used with Jacobi) \\
|
|---|
| 360 | * relax\_weight = -k & the relaxation weight is determined with at most k CG steps
|
|---|
| 361 | * on each level \\
|
|---|
| 362 | * & this should only be used for symmetric positive definite problems) \\
|
|---|
| 363 | * \hline
|
|---|
| 364 | * \end{tabular}
|
|---|
| 365 | *
|
|---|
| 366 | * The default is 1.
|
|---|
| 367 | **/
|
|---|
| 368 | int HYPRE_BoomerAMGSetRelaxWt(HYPRE_Solver solver,
|
|---|
| 369 | double relax_weight);
|
|---|
| 370 |
|
|---|
| 371 | /**
|
|---|
| 372 | * (Optional) Defines the relaxation weight for smoothed Jacobi and hybrid SOR
|
|---|
| 373 | * on the user defined level. Note that the finest level is denoted 0, the
|
|---|
| 374 | * next coarser level 1, etc. For nonpositive relax\_weight, the parameter is
|
|---|
| 375 | * determined on the given level as described for HYPRE\_BoomerAMGSetRelaxWt.
|
|---|
| 376 | * The default is 1.
|
|---|
| 377 | **/
|
|---|
| 378 | int HYPRE_BoomerAMGSetLevelRelaxWt(HYPRE_Solver solver,
|
|---|
| 379 | double relax_weight,
|
|---|
| 380 | int level);
|
|---|
| 381 |
|
|---|
| 382 | /**
|
|---|
| 383 | * (Optional) Defines the outer relaxation weight for hybrid SOR.
|
|---|
| 384 | * Note: This routine will be phased out!!!!
|
|---|
| 385 | * Use HYPRE\_BoomerAMGSetOuterWt or HYPRE\_BoomerAMGSetLevelOuterWt instead.
|
|---|
| 386 | **/
|
|---|
| 387 | int HYPRE_BoomerAMGSetOmega(HYPRE_Solver solver,
|
|---|
| 388 | double *omega);
|
|---|
| 389 |
|
|---|
| 390 | /**
|
|---|
| 391 | * (Optional) Defines the outer relaxation weight for hybrid SOR and SSOR
|
|---|
| 392 | * on all levels.
|
|---|
| 393 | *
|
|---|
| 394 | * \begin{tabular}{|l|l|} \hline
|
|---|
| 395 | * omega > 0 & this assigns the same outer relaxation weight omega on each level\\
|
|---|
| 396 | * omega = -k & an outer relaxation weight is determined with at most k CG
|
|---|
| 397 | * steps on each level \\
|
|---|
| 398 | * & (this only makes sense for symmetric
|
|---|
| 399 | * positive definite problems and smoothers, e.g. SSOR) \\
|
|---|
| 400 | * \hline
|
|---|
| 401 | * \end{tabular}
|
|---|
| 402 | *
|
|---|
| 403 | * The default is 1.
|
|---|
| 404 | **/
|
|---|
| 405 | int HYPRE_BoomerAMGSetOuterWt(HYPRE_Solver solver,
|
|---|
| 406 | double omega);
|
|---|
| 407 |
|
|---|
| 408 | /**
|
|---|
| 409 | * (Optional) Defines the outer relaxation weight for hybrid SOR or SSOR
|
|---|
| 410 | * on the user defined level. Note that the finest level is denoted 0, the
|
|---|
| 411 | * next coarser level 1, etc. For nonpositive omega, the parameter is
|
|---|
| 412 | * determined on the given level as described for HYPRE\_BoomerAMGSetOuterWt.
|
|---|
| 413 | * The default is 1.
|
|---|
| 414 | **/
|
|---|
| 415 | int HYPRE_BoomerAMGSetLevelOuterWt(HYPRE_Solver solver,
|
|---|
| 416 | double omega,
|
|---|
| 417 | int level);
|
|---|
| 418 |
|
|---|
| 419 | /**
|
|---|
| 420 | * (Optional)
|
|---|
| 421 | **/
|
|---|
| 422 | int HYPRE_BoomerAMGSetDebugFlag(HYPRE_Solver solver,
|
|---|
| 423 | int debug_flag);
|
|---|
| 424 |
|
|---|
| 425 | /**
|
|---|
| 426 | * Returns the residual.
|
|---|
| 427 | **/
|
|---|
| 428 | int HYPRE_BoomerAMGGetResidual(HYPRE_Solver solver,
|
|---|
| 429 | HYPRE_ParVector * residual);
|
|---|
| 430 |
|
|---|
| 431 | /**
|
|---|
| 432 | * Returns the number of iterations taken.
|
|---|
| 433 | **/
|
|---|
| 434 | int HYPRE_BoomerAMGGetNumIterations(HYPRE_Solver solver,
|
|---|
| 435 | int *num_iterations);
|
|---|
| 436 |
|
|---|
| 437 | /**
|
|---|
| 438 | * Returns the norm of the final relative residual.
|
|---|
| 439 | **/
|
|---|
| 440 | int HYPRE_BoomerAMGGetFinalRelativeResidualNorm(HYPRE_Solver solver,
|
|---|
| 441 | double *rel_resid_norm);
|
|---|
| 442 |
|
|---|
| 443 | /*
|
|---|
| 444 | * (Optional)
|
|---|
| 445 | **/
|
|---|
| 446 | int HYPRE_BoomerAMGSetRestriction(HYPRE_Solver solver,
|
|---|
| 447 | int restr_par);
|
|---|
| 448 |
|
|---|
| 449 | /**
|
|---|
| 450 | * (Optional) Defines a truncation factor for the interpolation.
|
|---|
| 451 | * The default is 0.
|
|---|
| 452 | **/
|
|---|
| 453 | int HYPRE_BoomerAMGSetTruncFactor(HYPRE_Solver solver,
|
|---|
| 454 | double trunc_factor);
|
|---|
| 455 |
|
|---|
| 456 | /**
|
|---|
| 457 | * (Optional) Defines the maximal number of elements per row for the interpolation.
|
|---|
| 458 | * The default is 0.
|
|---|
| 459 | **/
|
|---|
| 460 | int HYPRE_BoomerAMGSetPMaxElmts(HYPRE_Solver solver,
|
|---|
| 461 | int P_max_elmts);
|
|---|
| 462 |
|
|---|
| 463 | /**
|
|---|
| 464 | * (Optional) Defines the maximal number of elements per row for the aggressive coarsening interpolation.
|
|---|
| 465 | * The default is 0.
|
|---|
| 466 | **/
|
|---|
| 467 | int HYPRE_BoomerAMGSetAggPMaxElmts(HYPRE_Solver solver,
|
|---|
| 468 | int agg_P_max_elmts);
|
|---|
| 469 |
|
|---|
| 470 | /**
|
|---|
| 471 | * (Optional) Defines the maximal number of elements per row for P1 in the aggressive coarsening interpolation.
|
|---|
| 472 | * The default is 0.
|
|---|
| 473 | **/
|
|---|
| 474 | int HYPRE_BoomerAMGSetPMax1(HYPRE_Solver solver,
|
|---|
| 475 | int P_max1);
|
|---|
| 476 |
|
|---|
| 477 | /**
|
|---|
| 478 | * (Optional) Defines the maximal number of elements per row for P2 in the aggressive coarsening interpolation.
|
|---|
| 479 | * The default is 0.
|
|---|
| 480 | **/
|
|---|
| 481 | int HYPRE_BoomerAMGSetPMax2(HYPRE_Solver solver,
|
|---|
| 482 | int P_max2);
|
|---|
| 483 |
|
|---|
| 484 | /**
|
|---|
| 485 | * (Optional) Defines the largest strength threshold for which
|
|---|
| 486 | * the strength matrix S uses the communication package of the operator A.
|
|---|
| 487 | * If the strength threshold is larger than this values,
|
|---|
| 488 | * a communication package is generated for S. This can save
|
|---|
| 489 | * memory and decrease the amount of data that needs to be communicated,
|
|---|
| 490 | * if S is substantially sparser than A.
|
|---|
| 491 | * The default is 1.0.
|
|---|
| 492 | **/
|
|---|
| 493 | int HYPRE_BoomerAMGSetSCommPkgSwitch(HYPRE_Solver solver,
|
|---|
| 494 | double S_commpkg_switch);
|
|---|
| 495 |
|
|---|
| 496 | /*
|
|---|
| 497 | * (Optional) Specifies the use of LS interpolation - least-squares
|
|---|
| 498 | * fitting of smooth vectors.
|
|---|
| 499 | **/
|
|---|
| 500 | int HYPRE_BoomerAMGSetInterpType(HYPRE_Solver solver,
|
|---|
| 501 | int interp_type);
|
|---|
| 502 |
|
|---|
| 503 | /*
|
|---|
| 504 | * (Optional)
|
|---|
| 505 | **/
|
|---|
| 506 | int HYPRE_BoomerAMGSetMinIter(HYPRE_Solver solver,
|
|---|
| 507 | int min_iter);
|
|---|
| 508 |
|
|---|
| 509 | /*
|
|---|
| 510 | * (Optional) This routine will be eliminated in the future.
|
|---|
| 511 | **/
|
|---|
| 512 | int HYPRE_BoomerAMGInitGridRelaxation(int **num_grid_sweeps_ptr,
|
|---|
| 513 | int **grid_relax_type_ptr,
|
|---|
| 514 | int ***grid_relax_points_ptr,
|
|---|
| 515 | int coarsen_type,
|
|---|
| 516 | double **relax_weights_ptr,
|
|---|
| 517 | int max_levels);
|
|---|
| 518 |
|
|---|
| 519 | /**
|
|---|
| 520 | * (Optional) Enables the use of more complex smoothers.
|
|---|
| 521 | * The following options exist for smooth\_type:
|
|---|
| 522 | *
|
|---|
| 523 | * \begin{tabular}{|c|l|l|} \hline
|
|---|
| 524 | * value & smoother & routines needed to set smoother parameters \\
|
|---|
| 525 | * 6 & Schwarz smoothers & HYPRE\_BoomerAMGSetDomainType, HYPRE\_BoomerAMGSetOverlap, \\
|
|---|
| 526 | * & & HYPRE\_BoomerAMGSetVariant, HYPRE\_BoomerAMGSetSchwarzRlxWeight \\
|
|---|
| 527 | * 7 & Pilut & HYPRE\_BoomerAMGSetDropTol, HYPRE\_BoomerAMGSetMaxNzPerRow \\
|
|---|
| 528 | * 8 & ParaSails & HYPRE\_BoomerAMGSetSym, HYPRE\_BoomerAMGSetLevel, \\
|
|---|
| 529 | * & & HYPRE\_BoomerAMGSetFilter, HYPRE\_BoomerAMGSetThreshold \\
|
|---|
| 530 | * 9 & Euclid & HYPRE\_BoomerAMGSetEuclidFile \\
|
|---|
| 531 | * \hline
|
|---|
| 532 | * \end{tabular}
|
|---|
| 533 | *
|
|---|
| 534 | * The default is 6. Also, if no smoother parameters are set via the routines mentioned in the table above,
|
|---|
| 535 | * default values are used.
|
|---|
| 536 | **/
|
|---|
| 537 | int HYPRE_BoomerAMGSetSmoothType(HYPRE_Solver solver,
|
|---|
| 538 | int smooth_type);
|
|---|
| 539 |
|
|---|
| 540 | /**
|
|---|
| 541 | * (Optional) Sets the number of levels for more complex smoothers.
|
|---|
| 542 | * The smoothers,
|
|---|
| 543 | * as defined by HYPRE\_BoomerAMGSetSmoothType, will be used
|
|---|
| 544 | * on level 0 (the finest level) through level smooth\_num\_levels-1.
|
|---|
| 545 | * The default is 0, i.e. no complex smoothers are used.
|
|---|
| 546 | **/
|
|---|
| 547 | int HYPRE_BoomerAMGSetSmoothNumLevels(HYPRE_Solver solver,
|
|---|
| 548 | int smooth_num_levels);
|
|---|
| 549 |
|
|---|
| 550 | /**
|
|---|
| 551 | * (Optional) Sets the number of sweeps for more complex smoothers.
|
|---|
| 552 | * The default is 1.
|
|---|
| 553 | **/
|
|---|
| 554 | int HYPRE_BoomerAMGSetSmoothNumSweeps(HYPRE_Solver solver,
|
|---|
| 555 | int smooth_num_sweeps);
|
|---|
| 556 |
|
|---|
| 557 | /*
|
|---|
| 558 | * (Optional) Name of file to which BoomerAMG will print;
|
|---|
| 559 | * cf HYPRE\_BoomerAMGSetPrintLevel. (Presently this is ignored).
|
|---|
| 560 | **/
|
|---|
| 561 | int HYPRE_BoomerAMGSetPrintFileName(HYPRE_Solver solver,
|
|---|
| 562 | const char *print_file_name);
|
|---|
| 563 |
|
|---|
| 564 | /**
|
|---|
| 565 | * (Optional) Requests automatic printing of setup and solve information.
|
|---|
| 566 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 567 | * 0 & no printout (default) \\
|
|---|
| 568 | * 1 & print setup information \\
|
|---|
| 569 | * 2 & print solve information \\
|
|---|
| 570 | * 3 & print both setup and solve information \\
|
|---|
| 571 | * \hline
|
|---|
| 572 | * \end{tabular}
|
|---|
| 573 | * Note, that if one desires to print information and uses BoomerAMG as a
|
|---|
| 574 | * preconditioner, suggested print$\_$level is 1 to avoid excessive output,
|
|---|
| 575 | * and use print$\_$level of solver for solve phase information.
|
|---|
| 576 | **/
|
|---|
| 577 | int HYPRE_BoomerAMGSetPrintLevel(HYPRE_Solver solver,
|
|---|
| 578 | int print_level);
|
|---|
| 579 |
|
|---|
| 580 | /**
|
|---|
| 581 | * (Optional) Requests additional computations for diagnostic and similar
|
|---|
| 582 | * data to be logged by the user. Default to 0 for do nothing. The latest
|
|---|
| 583 | * residual will be available if logging > 1.
|
|---|
| 584 | **/
|
|---|
| 585 | int HYPRE_BoomerAMGSetLogging(HYPRE_Solver solver,
|
|---|
| 586 | int logging);
|
|---|
| 587 |
|
|---|
| 588 | /**
|
|---|
| 589 | * (Optional) Sets the size of the system of PDEs, if using the systems version.
|
|---|
| 590 | * The default is 1.
|
|---|
| 591 | **/
|
|---|
| 592 | int HYPRE_BoomerAMGSetNumFunctions(HYPRE_Solver solver,
|
|---|
| 593 | int num_functions);
|
|---|
| 594 |
|
|---|
| 595 | /**
|
|---|
| 596 | * (Optional) Sets whether to use the nodal systems version.
|
|---|
| 597 | * The default is 0.
|
|---|
| 598 | **/
|
|---|
| 599 | int HYPRE_BoomerAMGSetNodal(HYPRE_Solver solver,
|
|---|
| 600 | int nodal);
|
|---|
| 601 |
|
|---|
| 602 | /**
|
|---|
| 603 | * (Optional) Sets the mapping that assigns the function to each variable,
|
|---|
| 604 | * if using the systems version. If no assignment is made and the number of
|
|---|
| 605 | * functions is k > 1, the mapping generated is (0,1,...,k-1,0,1,...,k-1,...).
|
|---|
| 606 | **/
|
|---|
| 607 | int HYPRE_BoomerAMGSetDofFunc(HYPRE_Solver solver,
|
|---|
| 608 | int *dof_func);
|
|---|
| 609 |
|
|---|
| 610 | /**
|
|---|
| 611 | * (Optional) Defines the number of levels of aggressive coarsening.
|
|---|
| 612 | * The default is 0, i.e. no aggressive coarsening.
|
|---|
| 613 | **/
|
|---|
| 614 | int HYPRE_BoomerAMGSetAggNumLevels(HYPRE_Solver solver,
|
|---|
| 615 | int agg_num_levels);
|
|---|
| 616 |
|
|---|
| 617 | /**
|
|---|
| 618 | * (Optional) Defines the degree of aggressive coarsening.
|
|---|
| 619 | * The default is 1.
|
|---|
| 620 | **/
|
|---|
| 621 | int HYPRE_BoomerAMGSetNumPaths(HYPRE_Solver solver,
|
|---|
| 622 | int num_paths);
|
|---|
| 623 |
|
|---|
| 624 | /**
|
|---|
| 625 | * (Optional) Defines which variant of the Schwarz method is used.
|
|---|
| 626 | * The following options exist for variant:
|
|---|
| 627 | *
|
|---|
| 628 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 629 | * 0 & hybrid multiplicative Schwarz method (no overlap across processor
|
|---|
| 630 | * boundaries) \\
|
|---|
| 631 | * 1 & hybrid additive Schwarz method (no overlap across processor
|
|---|
| 632 | * boundaries) \\
|
|---|
| 633 | * 2 & additive Schwarz method \\
|
|---|
| 634 | * 3 & hybrid multiplicative Schwarz method (with overlap across processor
|
|---|
| 635 | * boundaries) \\
|
|---|
| 636 | * \hline
|
|---|
| 637 | * \end{tabular}
|
|---|
| 638 | *
|
|---|
| 639 | * The default is 0.
|
|---|
| 640 | **/
|
|---|
| 641 | int HYPRE_BoomerAMGSetVariant(HYPRE_Solver solver,
|
|---|
| 642 | int variant);
|
|---|
| 643 |
|
|---|
| 644 | /**
|
|---|
| 645 | * (Optional) Defines the overlap for the Schwarz method.
|
|---|
| 646 | * The following options exist for overlap:
|
|---|
| 647 | *
|
|---|
| 648 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 649 | * 0 & no overlap \\
|
|---|
| 650 | * 1 & minimal overlap (default) \\
|
|---|
| 651 | * 2 & overlap generated by including all neighbors of domain boundaries \\
|
|---|
| 652 | * \hline
|
|---|
| 653 | * \end{tabular}
|
|---|
| 654 | **/
|
|---|
| 655 | int HYPRE_BoomerAMGSetOverlap(HYPRE_Solver solver,
|
|---|
| 656 | int overlap);
|
|---|
| 657 |
|
|---|
| 658 | /**
|
|---|
| 659 | * (Optional) Defines the type of domain used for the Schwarz method.
|
|---|
| 660 | * The following options exist for domain\_type:
|
|---|
| 661 | *
|
|---|
| 662 | * \begin{tabular}{|c|l|} \hline
|
|---|
| 663 | * 0 & each point is a domain \\
|
|---|
| 664 | * 1 & each node is a domain (only of interest in "systems" AMG) \\
|
|---|
| 665 | * 2 & each domain is generated by agglomeration (default) \\
|
|---|
| 666 | * \hline
|
|---|
| 667 | * \end{tabular}
|
|---|
| 668 | **/
|
|---|
| 669 | int HYPRE_BoomerAMGSetDomainType(HYPRE_Solver solver,
|
|---|
| 670 | int domain_type);
|
|---|
| 671 |
|
|---|
| 672 | /**
|
|---|
| 673 | * (Optional) Defines a smoothing parameter for the additive Schwarz method.
|
|---|
| 674 | **/
|
|---|
| 675 | int HYPRE_BoomerAMGSetSchwarzRlxWeight(HYPRE_Solver solver,
|
|---|
| 676 | double schwarz_rlx_weight);
|
|---|
| 677 |
|
|---|
| 678 | /*@}*/
|
|---|
| 679 |
|
|---|
| 680 | /*--------------------------------------------------------------------------
|
|---|
| 681 | *--------------------------------------------------------------------------*/
|
|---|
| 682 |
|
|---|
| 683 | /**
|
|---|
| 684 | * @name ParCSR PCG Solver
|
|---|
| 685 | **/
|
|---|
| 686 | /*@{*/
|
|---|
| 687 |
|
|---|
| 688 | /**
|
|---|
| 689 | * Create a solver object.
|
|---|
| 690 | **/
|
|---|
| 691 | int HYPRE_ParCSRPCGCreate(MPI_Comm comm,
|
|---|
| 692 | HYPRE_Solver *solver);
|
|---|
| 693 |
|
|---|
| 694 | /**
|
|---|
| 695 | * Destroy a solver object.
|
|---|
| 696 | **/
|
|---|
| 697 | int HYPRE_ParCSRPCGDestroy(HYPRE_Solver solver);
|
|---|
| 698 |
|
|---|
| 699 | /**
|
|---|
| 700 | **/
|
|---|
| 701 | int HYPRE_ParCSRPCGSetup(HYPRE_Solver solver,
|
|---|
| 702 | HYPRE_ParCSRMatrix A,
|
|---|
| 703 | HYPRE_ParVector b,
|
|---|
| 704 | HYPRE_ParVector x);
|
|---|
| 705 |
|
|---|
| 706 | /**
|
|---|
| 707 | * Solve the system.
|
|---|
| 708 | **/
|
|---|
| 709 | int HYPRE_ParCSRPCGSolve(HYPRE_Solver solver,
|
|---|
| 710 | HYPRE_ParCSRMatrix A,
|
|---|
| 711 | HYPRE_ParVector b,
|
|---|
| 712 | HYPRE_ParVector x);
|
|---|
| 713 |
|
|---|
| 714 | /**
|
|---|
| 715 | * (Optional) Set the convergence tolerance.
|
|---|
| 716 | **/
|
|---|
| 717 | int HYPRE_ParCSRPCGSetTol(HYPRE_Solver solver,
|
|---|
| 718 | double tol);
|
|---|
| 719 |
|
|---|
| 720 | /**
|
|---|
| 721 | * (Optional) Set maximum number of iterations.
|
|---|
| 722 | **/
|
|---|
| 723 | int HYPRE_ParCSRPCGSetMaxIter(HYPRE_Solver solver,
|
|---|
| 724 | int max_iter);
|
|---|
| 725 |
|
|---|
| 726 | /*
|
|---|
| 727 | * RE-VISIT
|
|---|
| 728 | **/
|
|---|
| 729 | int HYPRE_ParCSRPCGSetStopCrit(HYPRE_Solver solver,
|
|---|
| 730 | int stop_crit);
|
|---|
| 731 |
|
|---|
| 732 | /**
|
|---|
| 733 | * (Optional) Use the two-norm in stopping criteria.
|
|---|
| 734 | **/
|
|---|
| 735 | int HYPRE_ParCSRPCGSetTwoNorm(HYPRE_Solver solver,
|
|---|
| 736 | int two_norm);
|
|---|
| 737 |
|
|---|
| 738 | /**
|
|---|
| 739 | * (Optional) Additionally require that the relative difference in
|
|---|
| 740 | * successive iterates be small.
|
|---|
| 741 | **/
|
|---|
| 742 | int HYPRE_ParCSRPCGSetRelChange(HYPRE_Solver solver,
|
|---|
| 743 | int rel_change);
|
|---|
| 744 |
|
|---|
| 745 | /**
|
|---|
| 746 | * (Optional) Set the preconditioner to use.
|
|---|
| 747 | **/
|
|---|
| 748 | int HYPRE_ParCSRPCGSetPrecond(HYPRE_Solver solver,
|
|---|
| 749 | HYPRE_PtrToParSolverFcn precond,
|
|---|
| 750 | HYPRE_PtrToParSolverFcn precond_setup,
|
|---|
| 751 | HYPRE_Solver precond_solver);
|
|---|
| 752 |
|
|---|
| 753 | /**
|
|---|
| 754 | **/
|
|---|
| 755 | int HYPRE_ParCSRPCGGetPrecond(HYPRE_Solver solver,
|
|---|
| 756 | HYPRE_Solver *precond_data);
|
|---|
| 757 |
|
|---|
| 758 | /**
|
|---|
| 759 | * (Optional) Set the amount of logging to do.
|
|---|
| 760 | **/
|
|---|
| 761 | int HYPRE_ParCSRPCGSetLogging(HYPRE_Solver solver,
|
|---|
| 762 | int logging);
|
|---|
| 763 |
|
|---|
| 764 | /**
|
|---|
| 765 | * (Optional) Set the print level
|
|---|
| 766 | **/
|
|---|
| 767 | int HYPRE_ParCSRPCGSetPrintLevel(HYPRE_Solver solver,
|
|---|
| 768 | int print_level);
|
|---|
| 769 |
|
|---|
| 770 | /**
|
|---|
| 771 | * Return the number of iterations taken.
|
|---|
| 772 | **/
|
|---|
| 773 | int HYPRE_ParCSRPCGGetNumIterations(HYPRE_Solver solver,
|
|---|
| 774 | int *num_iterations);
|
|---|
| 775 |
|
|---|
| 776 | /**
|
|---|
| 777 | * Return the norm of the final relative residual.
|
|---|
| 778 | **/
|
|---|
| 779 | int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm(HYPRE_Solver solver,
|
|---|
| 780 | double *norm);
|
|---|
| 781 |
|
|---|
| 782 | /**
|
|---|
| 783 | * Setup routine for diagonal preconditioning.
|
|---|
| 784 | **/
|
|---|
| 785 | int HYPRE_ParCSRDiagScaleSetup(HYPRE_Solver solver,
|
|---|
| 786 | HYPRE_ParCSRMatrix A,
|
|---|
| 787 | HYPRE_ParVector y,
|
|---|
| 788 | HYPRE_ParVector x);
|
|---|
| 789 |
|
|---|
| 790 | /**
|
|---|
| 791 | * Solve routine for diagonal preconditioning.
|
|---|
| 792 | **/
|
|---|
| 793 | int HYPRE_ParCSRDiagScale(HYPRE_Solver solver,
|
|---|
| 794 | HYPRE_ParCSRMatrix HA,
|
|---|
| 795 | HYPRE_ParVector Hy,
|
|---|
| 796 | HYPRE_ParVector Hx);
|
|---|
| 797 |
|
|---|
| 798 | /*@}*/
|
|---|
| 799 |
|
|---|
| 800 | /*--------------------------------------------------------------------------
|
|---|
| 801 | *--------------------------------------------------------------------------*/
|
|---|
| 802 |
|
|---|
| 803 | /**
|
|---|
| 804 | * @name ParCSR GMRES Solver
|
|---|
| 805 | **/
|
|---|
| 806 | /*@{*/
|
|---|
| 807 |
|
|---|
| 808 | /**
|
|---|
| 809 | * Create a solver object.
|
|---|
| 810 | **/
|
|---|
| 811 | int HYPRE_ParCSRGMRESCreate(MPI_Comm comm,
|
|---|
| 812 | HYPRE_Solver *solver);
|
|---|
| 813 |
|
|---|
| 814 | /**
|
|---|
| 815 | * Destroy a solver object.
|
|---|
| 816 | **/
|
|---|
| 817 | int HYPRE_ParCSRGMRESDestroy(HYPRE_Solver solver);
|
|---|
| 818 |
|
|---|
| 819 | /**
|
|---|
| 820 | **/
|
|---|
| 821 | int HYPRE_ParCSRGMRESSetup(HYPRE_Solver solver,
|
|---|
| 822 | HYPRE_ParCSRMatrix A,
|
|---|
| 823 | HYPRE_ParVector b,
|
|---|
| 824 | HYPRE_ParVector x);
|
|---|
| 825 |
|
|---|
| 826 | /**
|
|---|
| 827 | * Solve the system.
|
|---|
| 828 | **/
|
|---|
| 829 | int HYPRE_ParCSRGMRESSolve(HYPRE_Solver solver,
|
|---|
| 830 | HYPRE_ParCSRMatrix A,
|
|---|
| 831 | HYPRE_ParVector b,
|
|---|
| 832 | HYPRE_ParVector x);
|
|---|
| 833 |
|
|---|
| 834 | /**
|
|---|
| 835 | * (Optional) Set the maximum size of the Krylov space.
|
|---|
| 836 | **/
|
|---|
| 837 | int HYPRE_ParCSRGMRESSetKDim(HYPRE_Solver solver,
|
|---|
| 838 | int k_dim);
|
|---|
| 839 |
|
|---|
| 840 | /**
|
|---|
| 841 | * (Optional) Set the convergence tolerance.
|
|---|
| 842 | **/
|
|---|
| 843 | int HYPRE_ParCSRGMRESSetTol(HYPRE_Solver solver,
|
|---|
| 844 | double tol);
|
|---|
| 845 |
|
|---|
| 846 | /*
|
|---|
| 847 | * RE-VISIT
|
|---|
| 848 | **/
|
|---|
| 849 | int HYPRE_ParCSRGMRESSetMinIter(HYPRE_Solver solver,
|
|---|
| 850 | int min_iter);
|
|---|
| 851 |
|
|---|
| 852 | /**
|
|---|
| 853 | * (Optional) Set maximum number of iterations.
|
|---|
| 854 | **/
|
|---|
| 855 | int HYPRE_ParCSRGMRESSetMaxIter(HYPRE_Solver solver,
|
|---|
| 856 | int max_iter);
|
|---|
| 857 |
|
|---|
| 858 | /*
|
|---|
| 859 | * RE-VISIT
|
|---|
| 860 | **/
|
|---|
| 861 | int HYPRE_ParCSRGMRESSetStopCrit(HYPRE_Solver solver,
|
|---|
| 862 | int stop_crit);
|
|---|
| 863 |
|
|---|
| 864 | /**
|
|---|
| 865 | * (Optional) Set the preconditioner to use.
|
|---|
| 866 | **/
|
|---|
| 867 | int HYPRE_ParCSRGMRESSetPrecond(HYPRE_Solver solver,
|
|---|
| 868 | HYPRE_PtrToParSolverFcn precond,
|
|---|
| 869 | HYPRE_PtrToParSolverFcn precond_setup,
|
|---|
| 870 | HYPRE_Solver precond_solver);
|
|---|
| 871 |
|
|---|
| 872 | /**
|
|---|
| 873 | **/
|
|---|
| 874 | int HYPRE_ParCSRGMRESGetPrecond(HYPRE_Solver solver,
|
|---|
| 875 | HYPRE_Solver *precond_data);
|
|---|
| 876 |
|
|---|
| 877 | /**
|
|---|
| 878 | * (Optional) Set the amount of logging to do.
|
|---|
| 879 | **/
|
|---|
| 880 | int HYPRE_ParCSRGMRESSetLogging(HYPRE_Solver solver,
|
|---|
| 881 | int logging);
|
|---|
| 882 |
|
|---|
| 883 | /**
|
|---|
| 884 | * (Optional) Set print level.
|
|---|
| 885 | **/
|
|---|
| 886 | int HYPRE_ParCSRGMRESSetPrintLevel(HYPRE_Solver solver,
|
|---|
| 887 | int print_level);
|
|---|
| 888 |
|
|---|
| 889 | /**
|
|---|
| 890 | * Return the number of iterations taken.
|
|---|
| 891 | **/
|
|---|
| 892 | int HYPRE_ParCSRGMRESGetNumIterations(HYPRE_Solver solver,
|
|---|
| 893 | int *num_iterations);
|
|---|
| 894 |
|
|---|
| 895 | /**
|
|---|
| 896 | * Return the norm of the final relative residual.
|
|---|
| 897 | **/
|
|---|
| 898 | int HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver,
|
|---|
| 899 | double *norm);
|
|---|
| 900 |
|
|---|
| 901 | /*@}*/
|
|---|
| 902 |
|
|---|
| 903 | /*--------------------------------------------------------------------------
|
|---|
| 904 | *--------------------------------------------------------------------------*/
|
|---|
| 905 |
|
|---|
| 906 | /**
|
|---|
| 907 | * @name ParCSR BiCGSTAB Solver
|
|---|
| 908 | **/
|
|---|
| 909 | /*@{*/
|
|---|
| 910 |
|
|---|
| 911 | /**
|
|---|
| 912 | * Create a solver object
|
|---|
| 913 | **/
|
|---|
| 914 | int HYPRE_ParCSRBiCGSTABCreate(MPI_Comm comm,
|
|---|
| 915 | HYPRE_Solver *solver);
|
|---|
| 916 |
|
|---|
| 917 | /**
|
|---|
| 918 | * Destroy a solver object.
|
|---|
| 919 | **/
|
|---|
| 920 | int HYPRE_ParCSRBiCGSTABDestroy(HYPRE_Solver solver);
|
|---|
| 921 |
|
|---|
| 922 | /**
|
|---|
| 923 | * Set up BiCGSTAB solver.
|
|---|
| 924 | **/
|
|---|
| 925 | int HYPRE_ParCSRBiCGSTABSetup(HYPRE_Solver solver,
|
|---|
| 926 | HYPRE_ParCSRMatrix A,
|
|---|
| 927 | HYPRE_ParVector b,
|
|---|
| 928 | HYPRE_ParVector x);
|
|---|
| 929 |
|
|---|
| 930 | /**
|
|---|
| 931 | * Solve the linear system.
|
|---|
| 932 | **/
|
|---|
| 933 | int HYPRE_ParCSRBiCGSTABSolve(HYPRE_Solver solver,
|
|---|
| 934 | HYPRE_ParCSRMatrix A,
|
|---|
| 935 | HYPRE_ParVector b,
|
|---|
| 936 | HYPRE_ParVector x);
|
|---|
| 937 |
|
|---|
| 938 | /**
|
|---|
| 939 | * (Optional) Set the convergence tolerance (default is 1.e-6).
|
|---|
| 940 | **/
|
|---|
| 941 | int HYPRE_ParCSRBiCGSTABSetTol(HYPRE_Solver solver,
|
|---|
| 942 | double tol);
|
|---|
| 943 |
|
|---|
| 944 | /**
|
|---|
| 945 | * (Optional) Set the minimal number of iterations (default: 0).
|
|---|
| 946 | **/
|
|---|
| 947 | int HYPRE_ParCSRBiCGSTABSetMinIter(HYPRE_Solver solver,
|
|---|
| 948 | int min_iter);
|
|---|
| 949 |
|
|---|
| 950 | /**
|
|---|
| 951 | * (Optional) Set the maximal number of iterations allowed (default: 1000).
|
|---|
| 952 | **/
|
|---|
| 953 | int HYPRE_ParCSRBiCGSTABSetMaxIter(HYPRE_Solver solver,
|
|---|
| 954 | int max_iter);
|
|---|
| 955 |
|
|---|
| 956 | /**
|
|---|
| 957 | * (Optional) If stop$\_$crit = 1, the absolute residual norm is used
|
|---|
| 958 | * for the stopping criterion. The default is the relative residual
|
|---|
| 959 | * norm (stop$\_$crit = 0).
|
|---|
| 960 | **/
|
|---|
| 961 | int HYPRE_ParCSRBiCGSTABSetStopCrit(HYPRE_Solver solver,
|
|---|
| 962 | int stop_crit);
|
|---|
| 963 |
|
|---|
| 964 | /**
|
|---|
| 965 | * (Optional) Set the preconditioner.
|
|---|
| 966 | **/
|
|---|
| 967 | int HYPRE_ParCSRBiCGSTABSetPrecond(HYPRE_Solver solver,
|
|---|
| 968 | HYPRE_PtrToParSolverFcn precond,
|
|---|
| 969 | HYPRE_PtrToParSolverFcn precond_setup,
|
|---|
| 970 | HYPRE_Solver precond_solver);
|
|---|
| 971 |
|
|---|
| 972 | /**
|
|---|
| 973 | * Get the preconditioner object.
|
|---|
| 974 | **/
|
|---|
| 975 | int HYPRE_ParCSRBiCGSTABGetPrecond(HYPRE_Solver solver,
|
|---|
| 976 | HYPRE_Solver *precond_data);
|
|---|
| 977 |
|
|---|
| 978 | /**
|
|---|
| 979 | * (Optional) Set the amount of logging to be done. The default is 0, i.e.
|
|---|
| 980 | * no logging.
|
|---|
| 981 | **/
|
|---|
| 982 | int HYPRE_ParCSRBiCGSTABSetLogging(HYPRE_Solver solver,
|
|---|
| 983 | int logging);
|
|---|
| 984 |
|
|---|
| 985 | /**
|
|---|
| 986 | * (Optional) Set the desired print level. The default is 0, i.e. no printing.
|
|---|
| 987 | **/
|
|---|
| 988 | int HYPRE_ParCSRBiCGSTABSetPrintLevel(HYPRE_Solver solver,
|
|---|
| 989 | int print_level);
|
|---|
| 990 |
|
|---|
| 991 | /**
|
|---|
| 992 | * Retrieve the number of iterations taken.
|
|---|
| 993 | **/
|
|---|
| 994 | int HYPRE_ParCSRBiCGSTABGetNumIterations(HYPRE_Solver solver,
|
|---|
| 995 | int *num_iterations);
|
|---|
| 996 |
|
|---|
| 997 | /**
|
|---|
| 998 | * Retrieve the final relative residual norm.
|
|---|
| 999 | **/
|
|---|
| 1000 | int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm(HYPRE_Solver solver,
|
|---|
| 1001 | double *norm);
|
|---|
| 1002 |
|
|---|
| 1003 | /*@}*/
|
|---|
| 1004 |
|
|---|
| 1005 | /*--------------------------------------------------------------------------
|
|---|
| 1006 | *--------------------------------------------------------------------------*/
|
|---|
| 1007 |
|
|---|
| 1008 | /*
|
|---|
| 1009 | * @name Schwarz Solver
|
|---|
| 1010 | **/
|
|---|
| 1011 |
|
|---|
| 1012 | int HYPRE_SchwarzCreate( HYPRE_Solver *solver);
|
|---|
| 1013 |
|
|---|
| 1014 | int HYPRE_SchwarzDestroy(HYPRE_Solver solver);
|
|---|
| 1015 |
|
|---|
| 1016 | int HYPRE_SchwarzSetup(HYPRE_Solver solver,
|
|---|
| 1017 | HYPRE_ParCSRMatrix A,
|
|---|
| 1018 | HYPRE_ParVector b,
|
|---|
| 1019 | HYPRE_ParVector x);
|
|---|
| 1020 |
|
|---|
| 1021 | int HYPRE_SchwarzSolve(HYPRE_Solver solver,
|
|---|
| 1022 | HYPRE_ParCSRMatrix A,
|
|---|
| 1023 | HYPRE_ParVector b,
|
|---|
| 1024 | HYPRE_ParVector x);
|
|---|
| 1025 |
|
|---|
| 1026 | int HYPRE_SchwarzSetVariant(HYPRE_Solver solver, int variant);
|
|---|
| 1027 |
|
|---|
| 1028 | int HYPRE_SchwarzSetOverlap(HYPRE_Solver solver, int overlap);
|
|---|
| 1029 |
|
|---|
| 1030 | int HYPRE_SchwarzSetDomainType(HYPRE_Solver solver, int domain_type);
|
|---|
| 1031 |
|
|---|
| 1032 | int HYPRE_SchwarzSetRelaxWeight(HYPRE_Solver solver, double relax_weight);
|
|---|
| 1033 |
|
|---|
| 1034 | int HYPRE_SchwarzSetDomainStructure(HYPRE_Solver solver,
|
|---|
| 1035 | HYPRE_CSRMatrix domain_structure);
|
|---|
| 1036 |
|
|---|
| 1037 | int HYPRE_SchwarzSetNumFunctions(HYPRE_Solver solver, int num_functions);
|
|---|
| 1038 |
|
|---|
| 1039 | int HYPRE_SchwarzSetDofFunc(HYPRE_Solver solver, int *dof_func);
|
|---|
| 1040 |
|
|---|
| 1041 | /*--------------------------------------------------------------------------
|
|---|
| 1042 | *--------------------------------------------------------------------------*/
|
|---|
| 1043 |
|
|---|
| 1044 | /*
|
|---|
| 1045 | * @name ParCSR CGNR Solver
|
|---|
| 1046 | **/
|
|---|
| 1047 |
|
|---|
| 1048 | int HYPRE_ParCSRCGNRCreate(MPI_Comm comm,
|
|---|
| 1049 | HYPRE_Solver *solver);
|
|---|
| 1050 |
|
|---|
| 1051 | int HYPRE_ParCSRCGNRDestroy(HYPRE_Solver solver);
|
|---|
| 1052 |
|
|---|
| 1053 | int HYPRE_ParCSRCGNRSetup(HYPRE_Solver solver,
|
|---|
| 1054 | HYPRE_ParCSRMatrix A,
|
|---|
| 1055 | HYPRE_ParVector b,
|
|---|
| 1056 | HYPRE_ParVector x);
|
|---|
| 1057 |
|
|---|
| 1058 | int HYPRE_ParCSRCGNRSolve(HYPRE_Solver solver,
|
|---|
| 1059 | HYPRE_ParCSRMatrix A,
|
|---|
| 1060 | HYPRE_ParVector b,
|
|---|
| 1061 | HYPRE_ParVector x);
|
|---|
| 1062 |
|
|---|
| 1063 | int HYPRE_ParCSRCGNRSetTol(HYPRE_Solver solver,
|
|---|
| 1064 | double tol);
|
|---|
| 1065 |
|
|---|
| 1066 | int HYPRE_ParCSRCGNRSetMinIter(HYPRE_Solver solver,
|
|---|
| 1067 | int min_iter);
|
|---|
| 1068 |
|
|---|
| 1069 | int HYPRE_ParCSRCGNRSetMaxIter(HYPRE_Solver solver,
|
|---|
| 1070 | int max_iter);
|
|---|
| 1071 |
|
|---|
| 1072 | int HYPRE_ParCSRCGNRSetStopCrit(HYPRE_Solver solver,
|
|---|
| 1073 | int stop_crit);
|
|---|
| 1074 |
|
|---|
| 1075 | int HYPRE_ParCSRCGNRSetPrecond(HYPRE_Solver solver,
|
|---|
| 1076 | HYPRE_PtrToParSolverFcn precond,
|
|---|
| 1077 | HYPRE_PtrToParSolverFcn precondT,
|
|---|
| 1078 | HYPRE_PtrToParSolverFcn precond_setup,
|
|---|
| 1079 | HYPRE_Solver precond_solver);
|
|---|
| 1080 |
|
|---|
| 1081 | int HYPRE_ParCSRCGNRGetPrecond(HYPRE_Solver solver,
|
|---|
| 1082 | HYPRE_Solver *precond_data);
|
|---|
| 1083 |
|
|---|
| 1084 | int HYPRE_ParCSRCGNRSetLogging(HYPRE_Solver solver,
|
|---|
| 1085 | int logging);
|
|---|
| 1086 |
|
|---|
| 1087 | int HYPRE_ParCSRCGNRGetNumIterations(HYPRE_Solver solver,
|
|---|
| 1088 | int *num_iterations);
|
|---|
| 1089 |
|
|---|
| 1090 | int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm(HYPRE_Solver solver,
|
|---|
| 1091 | double *norm);
|
|---|
| 1092 |
|
|---|
| 1093 | /*--------------------------------------------------------------------------
|
|---|
| 1094 | * Miscellaneous: These probably do not belong in the interface.
|
|---|
| 1095 | *--------------------------------------------------------------------------*/
|
|---|
| 1096 |
|
|---|
| 1097 | HYPRE_ParCSRMatrix GenerateLaplacian(MPI_Comm comm,
|
|---|
| 1098 | HYPRE_BigInt nx,
|
|---|
| 1099 | HYPRE_BigInt ny,
|
|---|
| 1100 | HYPRE_BigInt nz,
|
|---|
| 1101 | int P,
|
|---|
| 1102 | int Q,
|
|---|
| 1103 | int R,
|
|---|
| 1104 | int p,
|
|---|
| 1105 | int q,
|
|---|
| 1106 | int r,
|
|---|
| 1107 | double *value,
|
|---|
| 1108 | HYPRE_ParVector *rhs_ptr,
|
|---|
| 1109 | HYPRE_ParVector *x_ptr);
|
|---|
| 1110 |
|
|---|
| 1111 | HYPRE_ParCSRMatrix GenerateLaplacian27pt(MPI_Comm comm,
|
|---|
| 1112 | HYPRE_BigInt nx,
|
|---|
| 1113 | HYPRE_BigInt ny,
|
|---|
| 1114 | HYPRE_BigInt nz,
|
|---|
| 1115 | int P,
|
|---|
| 1116 | int Q,
|
|---|
| 1117 | int R,
|
|---|
| 1118 | int p,
|
|---|
| 1119 | int q,
|
|---|
| 1120 | int r,
|
|---|
| 1121 | double *value,
|
|---|
| 1122 | HYPRE_ParVector *rhs_ptr,
|
|---|
| 1123 | HYPRE_ParVector *x_ptr);
|
|---|
| 1124 |
|
|---|
| 1125 | HYPRE_ParCSRMatrix
|
|---|
| 1126 | GenerateVarDifConv( MPI_Comm comm,
|
|---|
| 1127 | HYPRE_BigInt nx,
|
|---|
| 1128 | HYPRE_BigInt ny,
|
|---|
| 1129 | HYPRE_BigInt nz,
|
|---|
| 1130 | int P,
|
|---|
| 1131 | int Q,
|
|---|
| 1132 | int R,
|
|---|
| 1133 | int p,
|
|---|
| 1134 | int q,
|
|---|
| 1135 | int r,
|
|---|
| 1136 | double eps,
|
|---|
| 1137 | HYPRE_ParVector *rhs_ptr,
|
|---|
| 1138 | HYPRE_ParVector *x_ptr);
|
|---|
| 1139 |
|
|---|
| 1140 | /*--------------------------------------------------------------------------
|
|---|
| 1141 | *--------------------------------------------------------------------------*/
|
|---|
| 1142 |
|
|---|
| 1143 | /*@}*/
|
|---|
| 1144 |
|
|---|
| 1145 | /*
|
|---|
| 1146 | * @name ParCSRHybrid Solver
|
|---|
| 1147 | **/
|
|---|
| 1148 |
|
|---|
| 1149 | int HYPRE_ParCSRHybridCreate( HYPRE_Solver *solver);
|
|---|
| 1150 |
|
|---|
| 1151 | int HYPRE_ParCSRHybridDestroy(HYPRE_Solver solver);
|
|---|
| 1152 |
|
|---|
| 1153 | int HYPRE_ParCSRHybridSetup(HYPRE_Solver solver,
|
|---|
| 1154 | HYPRE_ParCSRMatrix A,
|
|---|
| 1155 | HYPRE_ParVector b,
|
|---|
| 1156 | HYPRE_ParVector x);
|
|---|
| 1157 |
|
|---|
| 1158 | int HYPRE_ParCSRHybridSolve(HYPRE_Solver solver,
|
|---|
| 1159 | HYPRE_ParCSRMatrix A,
|
|---|
| 1160 | HYPRE_ParVector b,
|
|---|
| 1161 | HYPRE_ParVector x);
|
|---|
| 1162 |
|
|---|
| 1163 | int HYPRE_ParCSRHybridSetTol(HYPRE_Solver solver,
|
|---|
| 1164 | double tol);
|
|---|
| 1165 |
|
|---|
| 1166 | int HYPRE_ParCSRHybridSetConvergenceTol(HYPRE_Solver solver,
|
|---|
| 1167 | double cf_tol);
|
|---|
| 1168 |
|
|---|
| 1169 | int HYPRE_ParCSRHybridSetDSCGMaxIter(HYPRE_Solver solver,
|
|---|
| 1170 | int dscg_max_its);
|
|---|
| 1171 |
|
|---|
| 1172 | int HYPRE_ParCSRHybridSetPCGMaxIter(HYPRE_Solver solver,
|
|---|
| 1173 | int pcg_max_its);
|
|---|
| 1174 |
|
|---|
| 1175 | int HYPRE_ParCSRHybridSetSetupType(HYPRE_Solver solver,
|
|---|
| 1176 | int setup_type);
|
|---|
| 1177 |
|
|---|
| 1178 | int HYPRE_ParCSRHybridSetSolverType(HYPRE_Solver solver,
|
|---|
| 1179 | int solver_type);
|
|---|
| 1180 |
|
|---|
| 1181 | int HYPRE_ParCSRHybridSetKDim(HYPRE_Solver solver,
|
|---|
| 1182 | int k_dim);
|
|---|
| 1183 |
|
|---|
| 1184 | int HYPRE_ParCSRHybridSetTwoNorm(HYPRE_Solver solver,
|
|---|
| 1185 | int two_norm);
|
|---|
| 1186 |
|
|---|
| 1187 | int HYPRE_ParCSRHybridSetStopCrit(HYPRE_Solver solver,
|
|---|
| 1188 | int stop_crit);
|
|---|
| 1189 |
|
|---|
| 1190 | int HYPRE_ParCSRHybridSetRelChange(HYPRE_Solver solver,
|
|---|
| 1191 | int rel_change);
|
|---|
| 1192 |
|
|---|
| 1193 | int HYPRE_ParCSRHybridSetPrecond(HYPRE_Solver solver,
|
|---|
| 1194 | HYPRE_PtrToParSolverFcn precond,
|
|---|
| 1195 | HYPRE_PtrToParSolverFcn precond_setup,
|
|---|
| 1196 | HYPRE_Solver precond_solver);
|
|---|
| 1197 |
|
|---|
| 1198 | int HYPRE_ParCSRHybridSetLogging(HYPRE_Solver solver,
|
|---|
| 1199 | int logging);
|
|---|
| 1200 |
|
|---|
| 1201 | int HYPRE_ParCSRHybridSetPrintLevel(HYPRE_Solver solver,
|
|---|
| 1202 | int print_level);
|
|---|
| 1203 |
|
|---|
| 1204 | int
|
|---|
| 1205 | HYPRE_ParCSRHybridSetPrintLevel( HYPRE_Solver solver,
|
|---|
| 1206 | int print_level );
|
|---|
| 1207 |
|
|---|
| 1208 | int
|
|---|
| 1209 | HYPRE_ParCSRHybridSetStrongThreshold( HYPRE_Solver solver,
|
|---|
| 1210 | double strong_threshold );
|
|---|
| 1211 |
|
|---|
| 1212 | int
|
|---|
| 1213 | HYPRE_ParCSRHybridSetMaxRowSum( HYPRE_Solver solver,
|
|---|
| 1214 | double max_row_sum );
|
|---|
| 1215 |
|
|---|
| 1216 | int
|
|---|
| 1217 | HYPRE_ParCSRHybridSetTruncFactor( HYPRE_Solver solver,
|
|---|
| 1218 | double trunc_factor );
|
|---|
| 1219 |
|
|---|
| 1220 | int
|
|---|
| 1221 | HYPRE_ParCSRHybridSetMaxLevels( HYPRE_Solver solver,
|
|---|
| 1222 | int max_levels );
|
|---|
| 1223 |
|
|---|
| 1224 | int
|
|---|
| 1225 | HYPRE_ParCSRHybridSetMeasureType( HYPRE_Solver solver,
|
|---|
| 1226 | int measure_type );
|
|---|
| 1227 |
|
|---|
| 1228 | int
|
|---|
| 1229 | HYPRE_ParCSRHybridSetCoarsenType( HYPRE_Solver solver,
|
|---|
| 1230 | int coarsen_type );
|
|---|
| 1231 |
|
|---|
| 1232 | int
|
|---|
| 1233 | HYPRE_ParCSRHybridSetInterpType( HYPRE_Solver solver,
|
|---|
| 1234 | int interp_type );
|
|---|
| 1235 |
|
|---|
| 1236 | int
|
|---|
| 1237 | HYPRE_ParCSRHybridSetCycleType( HYPRE_Solver solver,
|
|---|
| 1238 | int cycle_type );
|
|---|
| 1239 |
|
|---|
| 1240 | int
|
|---|
| 1241 | HYPRE_ParCSRHybridSetNumGridSweeps( HYPRE_Solver solver,
|
|---|
| 1242 | int *num_grid_sweeps );
|
|---|
| 1243 |
|
|---|
| 1244 | int
|
|---|
| 1245 | HYPRE_ParCSRHybridSetGridRelaxType( HYPRE_Solver solver,
|
|---|
| 1246 | int *grid_relax_type );
|
|---|
| 1247 |
|
|---|
| 1248 | int
|
|---|
| 1249 | HYPRE_ParCSRHybridSetGridRelaxPoints( HYPRE_Solver solver,
|
|---|
| 1250 | int **grid_relax_points );
|
|---|
| 1251 |
|
|---|
| 1252 | int
|
|---|
| 1253 | HYPRE_ParCSRHybridSetNumSweeps( HYPRE_Solver solver,
|
|---|
| 1254 | int num_sweeps );
|
|---|
| 1255 |
|
|---|
| 1256 | int
|
|---|
| 1257 | HYPRE_ParCSRHybridSetCycleNumSweeps( HYPRE_Solver solver,
|
|---|
| 1258 | int num_sweeps,
|
|---|
| 1259 | int k );
|
|---|
| 1260 |
|
|---|
| 1261 | int
|
|---|
| 1262 | HYPRE_ParCSRHybridSetRelaxType( HYPRE_Solver solver,
|
|---|
| 1263 | int relax_type );
|
|---|
| 1264 |
|
|---|
| 1265 | int
|
|---|
| 1266 | HYPRE_ParCSRHybridSetCycleRelaxType( HYPRE_Solver solver,
|
|---|
| 1267 | int relax_type,
|
|---|
| 1268 | int k );
|
|---|
| 1269 |
|
|---|
| 1270 | int
|
|---|
| 1271 | HYPRE_ParCSRHybridSetRelaxOrder( HYPRE_Solver solver,
|
|---|
| 1272 | int relax_order );
|
|---|
| 1273 |
|
|---|
| 1274 | int
|
|---|
| 1275 | HYPRE_ParCSRHybridSetRelaxWt( HYPRE_Solver solver,
|
|---|
| 1276 | double relax_wt );
|
|---|
| 1277 |
|
|---|
| 1278 | int
|
|---|
| 1279 | HYPRE_ParCSRHybridSetLevelRelaxWt( HYPRE_Solver solver,
|
|---|
| 1280 | double relax_wt,
|
|---|
| 1281 | int level );
|
|---|
| 1282 |
|
|---|
| 1283 | int
|
|---|
| 1284 | HYPRE_ParCSRHybridSetOuterWt( HYPRE_Solver solver,
|
|---|
| 1285 | double outer_wt );
|
|---|
| 1286 |
|
|---|
| 1287 | int
|
|---|
| 1288 | HYPRE_ParCSRHybridSetLevelOuterWt( HYPRE_Solver solver,
|
|---|
| 1289 | double outer_wt,
|
|---|
| 1290 | int level );
|
|---|
| 1291 |
|
|---|
| 1292 | int
|
|---|
| 1293 | HYPRE_ParCSRHybridSetRelaxWeight( HYPRE_Solver solver,
|
|---|
| 1294 | double *relax_weight );
|
|---|
| 1295 | int
|
|---|
| 1296 | HYPRE_ParCSRHybridSetOmega( HYPRE_Solver solver,
|
|---|
| 1297 | double *omega );
|
|---|
| 1298 | int
|
|---|
| 1299 | HYPRE_ParCSRHybridSetAggNumLevels( HYPRE_Solver solver,
|
|---|
| 1300 | int agg_num_levels );
|
|---|
| 1301 | int
|
|---|
| 1302 | HYPRE_ParCSRHybridSetNumPaths( HYPRE_Solver solver,
|
|---|
| 1303 | int num_paths );
|
|---|
| 1304 | int
|
|---|
| 1305 | HYPRE_ParCSRHybridSetNumFunctions( HYPRE_Solver solver,
|
|---|
| 1306 | int num_functions );
|
|---|
| 1307 | int
|
|---|
| 1308 | HYPRE_ParCSRHybridSetDofFunc( HYPRE_Solver solver,
|
|---|
| 1309 | int *dof_func );
|
|---|
| 1310 | int
|
|---|
| 1311 | HYPRE_ParCSRHybridSetNodal( HYPRE_Solver solver,
|
|---|
| 1312 | int nodal );
|
|---|
| 1313 |
|
|---|
| 1314 | int HYPRE_ParCSRHybridGetNumIterations(HYPRE_Solver solver,
|
|---|
| 1315 | int *num_its);
|
|---|
| 1316 |
|
|---|
| 1317 | int HYPRE_ParCSRHybridGetDSCGNumIterations(HYPRE_Solver solver,
|
|---|
| 1318 | int *dscg_num_its);
|
|---|
| 1319 |
|
|---|
| 1320 | int HYPRE_ParCSRHybridGetPCGNumIterations(HYPRE_Solver solver,
|
|---|
| 1321 | int *pcg_num_its);
|
|---|
| 1322 |
|
|---|
| 1323 | int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(HYPRE_Solver solver, double *norm);
|
|---|
| 1324 |
|
|---|
| 1325 | /*
|
|---|
| 1326 | * (Optional) Switches on use of Jacobi interpolation after computing
|
|---|
| 1327 | * an original interpolation
|
|---|
| 1328 | **/
|
|---|
| 1329 | int HYPRE_BoomerAMGSetPostInterpType(HYPRE_Solver solver,
|
|---|
| 1330 | int post_interp_type);
|
|---|
| 1331 |
|
|---|
| 1332 | /*
|
|---|
| 1333 | * (Optional) Sets a truncation threshold for Jacobi interpolation.
|
|---|
| 1334 | **/
|
|---|
| 1335 | int HYPRE_BoomerAMGSetJacobiTruncThreshold(HYPRE_Solver solver,
|
|---|
| 1336 | double jacobi_trunc_threshold);
|
|---|
| 1337 |
|
|---|
| 1338 | /*
|
|---|
| 1339 | * (Optional) Defines the number of relaxation steps for CR
|
|---|
| 1340 | * The default is 2.
|
|---|
| 1341 | **/
|
|---|
| 1342 | int HYPRE_BoomerAMGSetNumCRRelaxSteps(HYPRE_Solver solver,
|
|---|
| 1343 | int num_CR_relax_steps);
|
|---|
| 1344 |
|
|---|
| 1345 | /*
|
|---|
| 1346 | * (Optional) Defines convergence rate for CR
|
|---|
| 1347 | * The default is 0.7.
|
|---|
| 1348 | **/
|
|---|
| 1349 | int HYPRE_BoomerAMGSetCRRate(HYPRE_Solver solver,
|
|---|
| 1350 | double CR_rate);
|
|---|
| 1351 |
|
|---|
| 1352 | /*
|
|---|
| 1353 | * (Optional) Defines the Type of independent set algorithm used for CR
|
|---|
| 1354 | **/
|
|---|
| 1355 | int HYPRE_BoomerAMGSetISType(HYPRE_Solver solver,
|
|---|
| 1356 | int IS_type);
|
|---|
| 1357 |
|
|---|
| 1358 |
|
|---|
| 1359 | /*
|
|---|
| 1360 | * (Optional) Defines the Order for Chebyshev smoohter.
|
|---|
| 1361 | * The default is 2.
|
|---|
| 1362 | **/
|
|---|
| 1363 | int HYPRE_BoomerAMGSetChebyOrder(HYPRE_Solver solver,
|
|---|
| 1364 | int order);
|
|---|
| 1365 |
|
|---|
| 1366 | /*
|
|---|
| 1367 | * (Optional) Defines the lower bound (max eig/ratio) for Chebyshev smoohter.
|
|---|
| 1368 | * The default is 2.
|
|---|
| 1369 | **/
|
|---|
| 1370 | int HYPRE_BoomerAMGSetChebyEigRatio (HYPRE_Solver solver,
|
|---|
| 1371 | double ratio);
|
|---|
| 1372 |
|
|---|
| 1373 | /*--------------------------------------------------------------------------
|
|---|
| 1374 | *--------------------------------------------------------------------------*/
|
|---|
| 1375 |
|
|---|
| 1376 | /**
|
|---|
| 1377 | * @name ParCSR FlexGMRES Solver
|
|---|
| 1378 | **/
|
|---|
| 1379 | /*@{*/
|
|---|
| 1380 |
|
|---|
| 1381 | /**
|
|---|
| 1382 | * Create a solver object.
|
|---|
| 1383 | **/
|
|---|
| 1384 | int HYPRE_ParCSRFlexGMRESCreate(MPI_Comm comm,
|
|---|
| 1385 | HYPRE_Solver *solver);
|
|---|
| 1386 |
|
|---|
| 1387 | /**
|
|---|
| 1388 | * Destroy a solver object.
|
|---|
| 1389 | **/
|
|---|
| 1390 | int HYPRE_ParCSRFlexGMRESDestroy(HYPRE_Solver solver);
|
|---|
| 1391 |
|
|---|
| 1392 | /**
|
|---|
| 1393 | **/
|
|---|
| 1394 | int HYPRE_ParCSRFlexGMRESSetup(HYPRE_Solver solver,
|
|---|
| 1395 | HYPRE_ParCSRMatrix A,
|
|---|
| 1396 | HYPRE_ParVector b,
|
|---|
| 1397 | HYPRE_ParVector x);
|
|---|
| 1398 |
|
|---|
| 1399 | /**
|
|---|
| 1400 | * Solve the system.
|
|---|
| 1401 | **/
|
|---|
| 1402 | int HYPRE_ParCSRFlexGMRESSolve(HYPRE_Solver solver,
|
|---|
| 1403 | HYPRE_ParCSRMatrix A,
|
|---|
| 1404 | HYPRE_ParVector b,
|
|---|
| 1405 | HYPRE_ParVector x);
|
|---|
| 1406 |
|
|---|
| 1407 | /**
|
|---|
| 1408 | * (Optional) Set the maximum size of the Krylov space.
|
|---|
| 1409 | **/
|
|---|
| 1410 | int HYPRE_ParCSRFlexGMRESSetKDim(HYPRE_Solver solver,
|
|---|
| 1411 | int k_dim);
|
|---|
| 1412 |
|
|---|
| 1413 | /**
|
|---|
| 1414 | * (Optional) Set the convergence tolerance.
|
|---|
| 1415 | **/
|
|---|
| 1416 | int HYPRE_ParCSRFlexGMRESSetTol(HYPRE_Solver solver,
|
|---|
| 1417 | double tol);
|
|---|
| 1418 |
|
|---|
| 1419 | /**
|
|---|
| 1420 | * (Optional) Set the absolute convergence tolerance (default is 0).
|
|---|
| 1421 | * If one desires
|
|---|
| 1422 | * the convergence test to check the absolute convergence tolerance {\it only}, then
|
|---|
| 1423 | * set the relative convergence tolerance to 0.0. (The convergence test is
|
|---|
| 1424 | * $\|r\| \leq$ max(relative$\_$tolerance $\ast \|b\|$, absolute$\_$tolerance).)
|
|---|
| 1425 | *
|
|---|
| 1426 | **/
|
|---|
| 1427 |
|
|---|
| 1428 | int HYPRE_ParCSRFlexGMRESSetAbsoluteTol(HYPRE_Solver solver,
|
|---|
| 1429 | double a_tol);
|
|---|
| 1430 |
|
|---|
| 1431 | /*
|
|---|
| 1432 | * RE-VISIT
|
|---|
| 1433 | **/
|
|---|
| 1434 | int HYPRE_ParCSRFlexGMRESSetMinIter(HYPRE_Solver solver,
|
|---|
| 1435 | int min_iter);
|
|---|
| 1436 |
|
|---|
| 1437 | /**
|
|---|
| 1438 | * (Optional) Set maximum number of iterations.
|
|---|
| 1439 | **/
|
|---|
| 1440 | int HYPRE_ParCSRFlexGMRESSetMaxIter(HYPRE_Solver solver,
|
|---|
| 1441 | int max_iter);
|
|---|
| 1442 |
|
|---|
| 1443 |
|
|---|
| 1444 | /**
|
|---|
| 1445 | * (Optional) Set the preconditioner to use.
|
|---|
| 1446 | **/
|
|---|
| 1447 | int HYPRE_ParCSRFlexGMRESSetPrecond(HYPRE_Solver solver,
|
|---|
| 1448 | HYPRE_PtrToParSolverFcn precond,
|
|---|
| 1449 | HYPRE_PtrToParSolverFcn precond_setup,
|
|---|
| 1450 | HYPRE_Solver precond_solver);
|
|---|
| 1451 |
|
|---|
| 1452 | /**
|
|---|
| 1453 | **/
|
|---|
| 1454 | int HYPRE_ParCSRFlexGMRESGetPrecond(HYPRE_Solver solver,
|
|---|
| 1455 | HYPRE_Solver *precond_data);
|
|---|
| 1456 |
|
|---|
| 1457 | /**
|
|---|
| 1458 | * (Optional) Set the amount of logging to do.
|
|---|
| 1459 | **/
|
|---|
| 1460 | int HYPRE_ParCSRFlexGMRESSetLogging(HYPRE_Solver solver,
|
|---|
| 1461 | int logging);
|
|---|
| 1462 |
|
|---|
| 1463 | /**
|
|---|
| 1464 | * (Optional) Set print level.
|
|---|
| 1465 | **/
|
|---|
| 1466 | int HYPRE_ParCSRFlexGMRESSetPrintLevel(HYPRE_Solver solver,
|
|---|
| 1467 | int print_level);
|
|---|
| 1468 |
|
|---|
| 1469 | /**
|
|---|
| 1470 | * Return the number of iterations taken.
|
|---|
| 1471 | **/
|
|---|
| 1472 | int HYPRE_ParCSRFlexGMRESGetNumIterations(HYPRE_Solver solver,
|
|---|
| 1473 | int *num_iterations);
|
|---|
| 1474 |
|
|---|
| 1475 | /**
|
|---|
| 1476 | * Return the norm of the final relative residual.
|
|---|
| 1477 | **/
|
|---|
| 1478 | int HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm(HYPRE_Solver solver,
|
|---|
| 1479 | double *norm);
|
|---|
| 1480 |
|
|---|
| 1481 |
|
|---|
| 1482 |
|
|---|
| 1483 | /**
|
|---|
| 1484 | * Set a user-defined function to modify solve-time preconditioner attributes.
|
|---|
| 1485 | **/
|
|---|
| 1486 | int HYPRE_ParCSRFlexGMRESSetModifyPC( HYPRE_Solver solver,
|
|---|
| 1487 | HYPRE_PtrToModifyPCFcn modify_pc);
|
|---|
| 1488 |
|
|---|
| 1489 | /*@}*/
|
|---|
| 1490 |
|
|---|
| 1491 | /*--------------------------------------------------------------------------
|
|---|
| 1492 | *--------------------------------------------------------------------------*/
|
|---|
| 1493 |
|
|---|
| 1494 | #ifdef __cplusplus
|
|---|
| 1495 | }
|
|---|
| 1496 | #endif
|
|---|
| 1497 |
|
|---|
| 1498 | #endif
|
|---|