source: CIVL/examples/mpi-omp/AMG2013/parcsr_ls/HYPRE_parcsr_ls.h

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 49.3 KB
RevLine 
[2aa6644]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
31extern "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
55struct hypre_Solver_struct;
56/**
57 * The solver object.
58 **/
59
60#ifndef HYPRE_SOLVER_STRUCT
61#define HYPRE_SOLVER_STRUCT
62struct hypre_Solver_struct;
63typedef struct hypre_Solver_struct *HYPRE_Solver;
64#endif
65
66typedef int (*HYPRE_PtrToParSolverFcn)(HYPRE_Solver,
67 HYPRE_ParCSRMatrix,
68 HYPRE_ParVector,
69 HYPRE_ParVector);
70
71
72#ifndef HYPRE_MODIFYPC
73#define HYPRE_MODIFYPC
74typedef 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 **/
94int HYPRE_BoomerAMGCreate(HYPRE_Solver *solver);
95
96/**
97 * Destroy a solver object.
98 **/
99int 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 **/
111int 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 **/
126int 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 **/
142int 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 **/
152int 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 **/
160int 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 **/
167int 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 **/
176int 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 **/
185int 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 **/
211int HYPRE_BoomerAMGSetCoarsenType(HYPRE_Solver solver,
212 int coarsen_type);
213
214/**
215 * (Optional) Defines whether local or global measures are used.
216 **/
217int 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 **/
225int 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 **/
235int 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 **/
243int 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 **/
258int 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 **/
269int 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 **/
292int 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 **/
308int 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 **/
331int 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 **/
340int 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 **/
349int 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 **/
368int 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 **/
378int 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 **/
387int 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 **/
405int 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 **/
415int HYPRE_BoomerAMGSetLevelOuterWt(HYPRE_Solver solver,
416 double omega,
417 int level);
418
419/**
420 * (Optional)
421 **/
422int HYPRE_BoomerAMGSetDebugFlag(HYPRE_Solver solver,
423 int debug_flag);
424
425/**
426 * Returns the residual.
427 **/
428int HYPRE_BoomerAMGGetResidual(HYPRE_Solver solver,
429 HYPRE_ParVector * residual);
430
431/**
432 * Returns the number of iterations taken.
433 **/
434int HYPRE_BoomerAMGGetNumIterations(HYPRE_Solver solver,
435 int *num_iterations);
436
437/**
438 * Returns the norm of the final relative residual.
439 **/
440int HYPRE_BoomerAMGGetFinalRelativeResidualNorm(HYPRE_Solver solver,
441 double *rel_resid_norm);
442
443/*
444 * (Optional)
445 **/
446int 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 **/
453int 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 **/
460int 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 **/
467int 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 **/
474int 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 **/
481int 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 **/
493int 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 **/
500int HYPRE_BoomerAMGSetInterpType(HYPRE_Solver solver,
501 int interp_type);
502
503/*
504 * (Optional)
505 **/
506int HYPRE_BoomerAMGSetMinIter(HYPRE_Solver solver,
507 int min_iter);
508
509/*
510 * (Optional) This routine will be eliminated in the future.
511 **/
512int 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 **/
537int 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 **/
547int 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 **/
554int 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 **/
561int 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 **/
577int 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 **/
585int 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 **/
592int 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 **/
599int 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 **/
607int 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 **/
614int 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 **/
621int 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 **/
641int 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 **/
655int 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 **/
669int HYPRE_BoomerAMGSetDomainType(HYPRE_Solver solver,
670 int domain_type);
671
672/**
673 * (Optional) Defines a smoothing parameter for the additive Schwarz method.
674 **/
675int 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 **/
691int HYPRE_ParCSRPCGCreate(MPI_Comm comm,
692 HYPRE_Solver *solver);
693
694/**
695 * Destroy a solver object.
696 **/
697int HYPRE_ParCSRPCGDestroy(HYPRE_Solver solver);
698
699/**
700 **/
701int HYPRE_ParCSRPCGSetup(HYPRE_Solver solver,
702 HYPRE_ParCSRMatrix A,
703 HYPRE_ParVector b,
704 HYPRE_ParVector x);
705
706/**
707 * Solve the system.
708 **/
709int 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 **/
717int HYPRE_ParCSRPCGSetTol(HYPRE_Solver solver,
718 double tol);
719
720/**
721 * (Optional) Set maximum number of iterations.
722 **/
723int HYPRE_ParCSRPCGSetMaxIter(HYPRE_Solver solver,
724 int max_iter);
725
726/*
727 * RE-VISIT
728 **/
729int HYPRE_ParCSRPCGSetStopCrit(HYPRE_Solver solver,
730 int stop_crit);
731
732/**
733 * (Optional) Use the two-norm in stopping criteria.
734 **/
735int 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 **/
742int HYPRE_ParCSRPCGSetRelChange(HYPRE_Solver solver,
743 int rel_change);
744
745/**
746 * (Optional) Set the preconditioner to use.
747 **/
748int HYPRE_ParCSRPCGSetPrecond(HYPRE_Solver solver,
749 HYPRE_PtrToParSolverFcn precond,
750 HYPRE_PtrToParSolverFcn precond_setup,
751 HYPRE_Solver precond_solver);
752
753/**
754 **/
755int HYPRE_ParCSRPCGGetPrecond(HYPRE_Solver solver,
756 HYPRE_Solver *precond_data);
757
758/**
759 * (Optional) Set the amount of logging to do.
760 **/
761int HYPRE_ParCSRPCGSetLogging(HYPRE_Solver solver,
762 int logging);
763
764/**
765 * (Optional) Set the print level
766 **/
767int HYPRE_ParCSRPCGSetPrintLevel(HYPRE_Solver solver,
768 int print_level);
769
770/**
771 * Return the number of iterations taken.
772 **/
773int HYPRE_ParCSRPCGGetNumIterations(HYPRE_Solver solver,
774 int *num_iterations);
775
776/**
777 * Return the norm of the final relative residual.
778 **/
779int HYPRE_ParCSRPCGGetFinalRelativeResidualNorm(HYPRE_Solver solver,
780 double *norm);
781
782/**
783 * Setup routine for diagonal preconditioning.
784 **/
785int 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 **/
793int 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 **/
811int HYPRE_ParCSRGMRESCreate(MPI_Comm comm,
812 HYPRE_Solver *solver);
813
814/**
815 * Destroy a solver object.
816 **/
817int HYPRE_ParCSRGMRESDestroy(HYPRE_Solver solver);
818
819/**
820 **/
821int HYPRE_ParCSRGMRESSetup(HYPRE_Solver solver,
822 HYPRE_ParCSRMatrix A,
823 HYPRE_ParVector b,
824 HYPRE_ParVector x);
825
826/**
827 * Solve the system.
828 **/
829int 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 **/
837int HYPRE_ParCSRGMRESSetKDim(HYPRE_Solver solver,
838 int k_dim);
839
840/**
841 * (Optional) Set the convergence tolerance.
842 **/
843int HYPRE_ParCSRGMRESSetTol(HYPRE_Solver solver,
844 double tol);
845
846/*
847 * RE-VISIT
848 **/
849int HYPRE_ParCSRGMRESSetMinIter(HYPRE_Solver solver,
850 int min_iter);
851
852/**
853 * (Optional) Set maximum number of iterations.
854 **/
855int HYPRE_ParCSRGMRESSetMaxIter(HYPRE_Solver solver,
856 int max_iter);
857
858/*
859 * RE-VISIT
860 **/
861int HYPRE_ParCSRGMRESSetStopCrit(HYPRE_Solver solver,
862 int stop_crit);
863
864/**
865 * (Optional) Set the preconditioner to use.
866 **/
867int HYPRE_ParCSRGMRESSetPrecond(HYPRE_Solver solver,
868 HYPRE_PtrToParSolverFcn precond,
869 HYPRE_PtrToParSolverFcn precond_setup,
870 HYPRE_Solver precond_solver);
871
872/**
873 **/
874int HYPRE_ParCSRGMRESGetPrecond(HYPRE_Solver solver,
875 HYPRE_Solver *precond_data);
876
877/**
878 * (Optional) Set the amount of logging to do.
879 **/
880int HYPRE_ParCSRGMRESSetLogging(HYPRE_Solver solver,
881 int logging);
882
883/**
884 * (Optional) Set print level.
885 **/
886int HYPRE_ParCSRGMRESSetPrintLevel(HYPRE_Solver solver,
887 int print_level);
888
889/**
890 * Return the number of iterations taken.
891 **/
892int HYPRE_ParCSRGMRESGetNumIterations(HYPRE_Solver solver,
893 int *num_iterations);
894
895/**
896 * Return the norm of the final relative residual.
897 **/
898int 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 **/
914int HYPRE_ParCSRBiCGSTABCreate(MPI_Comm comm,
915 HYPRE_Solver *solver);
916
917/**
918 * Destroy a solver object.
919 **/
920int HYPRE_ParCSRBiCGSTABDestroy(HYPRE_Solver solver);
921
922/**
923 * Set up BiCGSTAB solver.
924 **/
925int 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 **/
933int 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 **/
941int HYPRE_ParCSRBiCGSTABSetTol(HYPRE_Solver solver,
942 double tol);
943
944/**
945 * (Optional) Set the minimal number of iterations (default: 0).
946 **/
947int HYPRE_ParCSRBiCGSTABSetMinIter(HYPRE_Solver solver,
948 int min_iter);
949
950/**
951 * (Optional) Set the maximal number of iterations allowed (default: 1000).
952 **/
953int 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 **/
961int HYPRE_ParCSRBiCGSTABSetStopCrit(HYPRE_Solver solver,
962 int stop_crit);
963
964/**
965 * (Optional) Set the preconditioner.
966 **/
967int 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 **/
975int 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 **/
982int 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 **/
988int HYPRE_ParCSRBiCGSTABSetPrintLevel(HYPRE_Solver solver,
989 int print_level);
990
991/**
992 * Retrieve the number of iterations taken.
993 **/
994int HYPRE_ParCSRBiCGSTABGetNumIterations(HYPRE_Solver solver,
995 int *num_iterations);
996
997/**
998 * Retrieve the final relative residual norm.
999 **/
1000int HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm(HYPRE_Solver solver,
1001 double *norm);
1002
1003/*@}*/
1004
1005/*--------------------------------------------------------------------------
1006 *--------------------------------------------------------------------------*/
1007
1008/*
1009 * @name Schwarz Solver
1010 **/
1011
1012int HYPRE_SchwarzCreate( HYPRE_Solver *solver);
1013
1014int HYPRE_SchwarzDestroy(HYPRE_Solver solver);
1015
1016int HYPRE_SchwarzSetup(HYPRE_Solver solver,
1017 HYPRE_ParCSRMatrix A,
1018 HYPRE_ParVector b,
1019 HYPRE_ParVector x);
1020
1021int HYPRE_SchwarzSolve(HYPRE_Solver solver,
1022 HYPRE_ParCSRMatrix A,
1023 HYPRE_ParVector b,
1024 HYPRE_ParVector x);
1025
1026int HYPRE_SchwarzSetVariant(HYPRE_Solver solver, int variant);
1027
1028int HYPRE_SchwarzSetOverlap(HYPRE_Solver solver, int overlap);
1029
1030int HYPRE_SchwarzSetDomainType(HYPRE_Solver solver, int domain_type);
1031
1032int HYPRE_SchwarzSetRelaxWeight(HYPRE_Solver solver, double relax_weight);
1033
1034int HYPRE_SchwarzSetDomainStructure(HYPRE_Solver solver,
1035 HYPRE_CSRMatrix domain_structure);
1036
1037int HYPRE_SchwarzSetNumFunctions(HYPRE_Solver solver, int num_functions);
1038
1039int HYPRE_SchwarzSetDofFunc(HYPRE_Solver solver, int *dof_func);
1040
1041/*--------------------------------------------------------------------------
1042 *--------------------------------------------------------------------------*/
1043
1044/*
1045 * @name ParCSR CGNR Solver
1046 **/
1047
1048int HYPRE_ParCSRCGNRCreate(MPI_Comm comm,
1049 HYPRE_Solver *solver);
1050
1051int HYPRE_ParCSRCGNRDestroy(HYPRE_Solver solver);
1052
1053int HYPRE_ParCSRCGNRSetup(HYPRE_Solver solver,
1054 HYPRE_ParCSRMatrix A,
1055 HYPRE_ParVector b,
1056 HYPRE_ParVector x);
1057
1058int HYPRE_ParCSRCGNRSolve(HYPRE_Solver solver,
1059 HYPRE_ParCSRMatrix A,
1060 HYPRE_ParVector b,
1061 HYPRE_ParVector x);
1062
1063int HYPRE_ParCSRCGNRSetTol(HYPRE_Solver solver,
1064 double tol);
1065
1066int HYPRE_ParCSRCGNRSetMinIter(HYPRE_Solver solver,
1067 int min_iter);
1068
1069int HYPRE_ParCSRCGNRSetMaxIter(HYPRE_Solver solver,
1070 int max_iter);
1071
1072int HYPRE_ParCSRCGNRSetStopCrit(HYPRE_Solver solver,
1073 int stop_crit);
1074
1075int HYPRE_ParCSRCGNRSetPrecond(HYPRE_Solver solver,
1076 HYPRE_PtrToParSolverFcn precond,
1077 HYPRE_PtrToParSolverFcn precondT,
1078 HYPRE_PtrToParSolverFcn precond_setup,
1079 HYPRE_Solver precond_solver);
1080
1081int HYPRE_ParCSRCGNRGetPrecond(HYPRE_Solver solver,
1082 HYPRE_Solver *precond_data);
1083
1084int HYPRE_ParCSRCGNRSetLogging(HYPRE_Solver solver,
1085 int logging);
1086
1087int HYPRE_ParCSRCGNRGetNumIterations(HYPRE_Solver solver,
1088 int *num_iterations);
1089
1090int HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm(HYPRE_Solver solver,
1091 double *norm);
1092
1093/*--------------------------------------------------------------------------
1094 * Miscellaneous: These probably do not belong in the interface.
1095 *--------------------------------------------------------------------------*/
1096
1097HYPRE_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
1111HYPRE_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
1125HYPRE_ParCSRMatrix
1126GenerateVarDifConv( 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
1149int HYPRE_ParCSRHybridCreate( HYPRE_Solver *solver);
1150
1151int HYPRE_ParCSRHybridDestroy(HYPRE_Solver solver);
1152
1153int HYPRE_ParCSRHybridSetup(HYPRE_Solver solver,
1154 HYPRE_ParCSRMatrix A,
1155 HYPRE_ParVector b,
1156 HYPRE_ParVector x);
1157
1158int HYPRE_ParCSRHybridSolve(HYPRE_Solver solver,
1159 HYPRE_ParCSRMatrix A,
1160 HYPRE_ParVector b,
1161 HYPRE_ParVector x);
1162
1163int HYPRE_ParCSRHybridSetTol(HYPRE_Solver solver,
1164 double tol);
1165
1166int HYPRE_ParCSRHybridSetConvergenceTol(HYPRE_Solver solver,
1167 double cf_tol);
1168
1169int HYPRE_ParCSRHybridSetDSCGMaxIter(HYPRE_Solver solver,
1170 int dscg_max_its);
1171
1172int HYPRE_ParCSRHybridSetPCGMaxIter(HYPRE_Solver solver,
1173 int pcg_max_its);
1174
1175int HYPRE_ParCSRHybridSetSetupType(HYPRE_Solver solver,
1176 int setup_type);
1177
1178int HYPRE_ParCSRHybridSetSolverType(HYPRE_Solver solver,
1179 int solver_type);
1180
1181int HYPRE_ParCSRHybridSetKDim(HYPRE_Solver solver,
1182 int k_dim);
1183
1184int HYPRE_ParCSRHybridSetTwoNorm(HYPRE_Solver solver,
1185 int two_norm);
1186
1187int HYPRE_ParCSRHybridSetStopCrit(HYPRE_Solver solver,
1188 int stop_crit);
1189
1190int HYPRE_ParCSRHybridSetRelChange(HYPRE_Solver solver,
1191 int rel_change);
1192
1193int HYPRE_ParCSRHybridSetPrecond(HYPRE_Solver solver,
1194 HYPRE_PtrToParSolverFcn precond,
1195 HYPRE_PtrToParSolverFcn precond_setup,
1196 HYPRE_Solver precond_solver);
1197
1198int HYPRE_ParCSRHybridSetLogging(HYPRE_Solver solver,
1199 int logging);
1200
1201int HYPRE_ParCSRHybridSetPrintLevel(HYPRE_Solver solver,
1202 int print_level);
1203
1204int
1205HYPRE_ParCSRHybridSetPrintLevel( HYPRE_Solver solver,
1206 int print_level );
1207
1208int
1209HYPRE_ParCSRHybridSetStrongThreshold( HYPRE_Solver solver,
1210 double strong_threshold );
1211
1212int
1213HYPRE_ParCSRHybridSetMaxRowSum( HYPRE_Solver solver,
1214 double max_row_sum );
1215
1216int
1217HYPRE_ParCSRHybridSetTruncFactor( HYPRE_Solver solver,
1218 double trunc_factor );
1219
1220int
1221HYPRE_ParCSRHybridSetMaxLevels( HYPRE_Solver solver,
1222 int max_levels );
1223
1224int
1225HYPRE_ParCSRHybridSetMeasureType( HYPRE_Solver solver,
1226 int measure_type );
1227
1228int
1229HYPRE_ParCSRHybridSetCoarsenType( HYPRE_Solver solver,
1230 int coarsen_type );
1231
1232int
1233HYPRE_ParCSRHybridSetInterpType( HYPRE_Solver solver,
1234 int interp_type );
1235
1236int
1237HYPRE_ParCSRHybridSetCycleType( HYPRE_Solver solver,
1238 int cycle_type );
1239
1240int
1241HYPRE_ParCSRHybridSetNumGridSweeps( HYPRE_Solver solver,
1242 int *num_grid_sweeps );
1243
1244int
1245HYPRE_ParCSRHybridSetGridRelaxType( HYPRE_Solver solver,
1246 int *grid_relax_type );
1247
1248int
1249HYPRE_ParCSRHybridSetGridRelaxPoints( HYPRE_Solver solver,
1250 int **grid_relax_points );
1251
1252int
1253HYPRE_ParCSRHybridSetNumSweeps( HYPRE_Solver solver,
1254 int num_sweeps );
1255
1256int
1257HYPRE_ParCSRHybridSetCycleNumSweeps( HYPRE_Solver solver,
1258 int num_sweeps,
1259 int k );
1260
1261int
1262HYPRE_ParCSRHybridSetRelaxType( HYPRE_Solver solver,
1263 int relax_type );
1264
1265int
1266HYPRE_ParCSRHybridSetCycleRelaxType( HYPRE_Solver solver,
1267 int relax_type,
1268 int k );
1269
1270int
1271HYPRE_ParCSRHybridSetRelaxOrder( HYPRE_Solver solver,
1272 int relax_order );
1273
1274int
1275HYPRE_ParCSRHybridSetRelaxWt( HYPRE_Solver solver,
1276 double relax_wt );
1277
1278int
1279HYPRE_ParCSRHybridSetLevelRelaxWt( HYPRE_Solver solver,
1280 double relax_wt,
1281 int level );
1282
1283int
1284HYPRE_ParCSRHybridSetOuterWt( HYPRE_Solver solver,
1285 double outer_wt );
1286
1287int
1288HYPRE_ParCSRHybridSetLevelOuterWt( HYPRE_Solver solver,
1289 double outer_wt,
1290 int level );
1291
1292int
1293HYPRE_ParCSRHybridSetRelaxWeight( HYPRE_Solver solver,
1294 double *relax_weight );
1295int
1296HYPRE_ParCSRHybridSetOmega( HYPRE_Solver solver,
1297 double *omega );
1298int
1299HYPRE_ParCSRHybridSetAggNumLevels( HYPRE_Solver solver,
1300 int agg_num_levels );
1301int
1302HYPRE_ParCSRHybridSetNumPaths( HYPRE_Solver solver,
1303 int num_paths );
1304int
1305HYPRE_ParCSRHybridSetNumFunctions( HYPRE_Solver solver,
1306 int num_functions );
1307int
1308HYPRE_ParCSRHybridSetDofFunc( HYPRE_Solver solver,
1309 int *dof_func );
1310int
1311HYPRE_ParCSRHybridSetNodal( HYPRE_Solver solver,
1312 int nodal );
1313
1314int HYPRE_ParCSRHybridGetNumIterations(HYPRE_Solver solver,
1315 int *num_its);
1316
1317int HYPRE_ParCSRHybridGetDSCGNumIterations(HYPRE_Solver solver,
1318 int *dscg_num_its);
1319
1320int HYPRE_ParCSRHybridGetPCGNumIterations(HYPRE_Solver solver,
1321 int *pcg_num_its);
1322
1323int HYPRE_ParCSRHybridGetFinalRelativeResidualNorm(HYPRE_Solver solver, double *norm);
1324
1325/*
1326 * (Optional) Switches on use of Jacobi interpolation after computing
1327 * an original interpolation
1328 **/
1329int HYPRE_BoomerAMGSetPostInterpType(HYPRE_Solver solver,
1330 int post_interp_type);
1331
1332/*
1333 * (Optional) Sets a truncation threshold for Jacobi interpolation.
1334 **/
1335int 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 **/
1342int 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 **/
1349int HYPRE_BoomerAMGSetCRRate(HYPRE_Solver solver,
1350 double CR_rate);
1351
1352/*
1353 * (Optional) Defines the Type of independent set algorithm used for CR
1354 **/
1355int 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 **/
1363int 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 **/
1370int 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 **/
1384int HYPRE_ParCSRFlexGMRESCreate(MPI_Comm comm,
1385 HYPRE_Solver *solver);
1386
1387/**
1388 * Destroy a solver object.
1389 **/
1390int HYPRE_ParCSRFlexGMRESDestroy(HYPRE_Solver solver);
1391
1392/**
1393 **/
1394int HYPRE_ParCSRFlexGMRESSetup(HYPRE_Solver solver,
1395 HYPRE_ParCSRMatrix A,
1396 HYPRE_ParVector b,
1397 HYPRE_ParVector x);
1398
1399/**
1400 * Solve the system.
1401 **/
1402int 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 **/
1410int HYPRE_ParCSRFlexGMRESSetKDim(HYPRE_Solver solver,
1411 int k_dim);
1412
1413/**
1414 * (Optional) Set the convergence tolerance.
1415 **/
1416int 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
1428int HYPRE_ParCSRFlexGMRESSetAbsoluteTol(HYPRE_Solver solver,
1429 double a_tol);
1430
1431/*
1432 * RE-VISIT
1433 **/
1434int HYPRE_ParCSRFlexGMRESSetMinIter(HYPRE_Solver solver,
1435 int min_iter);
1436
1437/**
1438 * (Optional) Set maximum number of iterations.
1439 **/
1440int HYPRE_ParCSRFlexGMRESSetMaxIter(HYPRE_Solver solver,
1441 int max_iter);
1442
1443
1444/**
1445 * (Optional) Set the preconditioner to use.
1446 **/
1447int HYPRE_ParCSRFlexGMRESSetPrecond(HYPRE_Solver solver,
1448 HYPRE_PtrToParSolverFcn precond,
1449 HYPRE_PtrToParSolverFcn precond_setup,
1450 HYPRE_Solver precond_solver);
1451
1452/**
1453 **/
1454int HYPRE_ParCSRFlexGMRESGetPrecond(HYPRE_Solver solver,
1455 HYPRE_Solver *precond_data);
1456
1457/**
1458 * (Optional) Set the amount of logging to do.
1459 **/
1460int HYPRE_ParCSRFlexGMRESSetLogging(HYPRE_Solver solver,
1461 int logging);
1462
1463/**
1464 * (Optional) Set print level.
1465 **/
1466int HYPRE_ParCSRFlexGMRESSetPrintLevel(HYPRE_Solver solver,
1467 int print_level);
1468
1469/**
1470 * Return the number of iterations taken.
1471 **/
1472int HYPRE_ParCSRFlexGMRESGetNumIterations(HYPRE_Solver solver,
1473 int *num_iterations);
1474
1475/**
1476 * Return the norm of the final relative residual.
1477 **/
1478int 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 **/
1486int 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
Note: See TracBrowser for help on using the repository browser.