/[escript]/trunk/paso/src/Options_getSolver.c
ViewVC logotype

Contents of /trunk/paso/src/Options_getSolver.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (9 years ago) by jfenwick
File MIME type: text/plain
File size: 2942 byte(s)
Merging dudley and scons updates from branches

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Paso: returns the package to be used */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia 2004,2005 */
22 /* Author: Lutz Gross, l.gross@uq.edu.au */
23
24 /**************************************************************/
25
26 #include "Paso.h"
27 #include "Options.h"
28
29 /**************************************************************/
30
31 index_t Paso_Options_getSolver(index_t solver,index_t package, bool_t symmetry, Esys_MPIInfo *mpi_info) {
32 index_t out=PASO_DEFAULT;
33 /* PASO */
34 if (package==PASO_PASO) {
35 switch (solver) {
36 case PASO_BICGSTAB:
37 out=PASO_BICGSTAB;
38 break;
39 case PASO_PCG:
40 out=PASO_PCG;
41 break;
42 case PASO_PRES20:
43 out=PASO_PRES20;
44 break;
45 case PASO_GMRES:
46 out=PASO_GMRES;
47 break;
48 case PASO_NONLINEAR_GMRES:
49 out=PASO_NONLINEAR_GMRES;
50 break;
51 case PASO_TFQMR:
52 out=PASO_TFQMR;
53 break;
54 case PASO_MINRES:
55 out=PASO_MINRES;
56 break;
57 default:
58 if (symmetry) {
59 out=PASO_PCG;
60 } else {
61 out=PASO_BICGSTAB;
62 }
63 break;
64 }
65 /* MKL */
66 } else if (package==PASO_MKL) {
67 switch (solver) {
68 case PASO_CHOLEVSKY:
69 out=PASO_CHOLEVSKY;
70 break;
71 case PASO_DIRECT:
72 out=PASO_DIRECT;
73 break;
74 default:
75 if (symmetry) {
76 out=PASO_CHOLEVSKY;
77 } else {
78 out=PASO_DIRECT;
79 }
80 break;
81 }
82 /* TRILINOS */
83 } else if (package==PASO_TRILINOS) {
84 switch (solver) {
85 case PASO_BICGSTAB:
86 out=PASO_BICGSTAB;
87 break;
88 case PASO_PCG:
89 out=PASO_PCG;
90 break;
91 case PASO_PRES20:
92 out=PASO_PRES20;
93 break;
94 case PASO_GMRES:
95 out=PASO_GMRES;
96 break;
97 case PASO_TFQMR:
98 out=PASO_TFQMR;
99 break;
100 case PASO_MINRES:
101 out=PASO_MINRES;
102 break;
103 default:
104 if (symmetry) {
105 out=PASO_PCG;
106 } else {
107 out=PASO_BICGSTAB;
108 }
109 break;
110 }
111 } else if (package==PASO_UMFPACK) {
112 out=PASO_DIRECT;
113 } else {
114 Esys_setError(VALUE_ERROR,"Unidentified package.");
115 }
116 return out;
117 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26