/[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 1639 - (show annotations)
Mon Jul 14 08:55:25 2008 UTC (10 years, 11 months ago) by gross
File MIME type: text/plain
File size: 3782 byte(s)


1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17
18 /* Paso: returns the package to be used */
19
20 /**************************************************************/
21
22 /* Copyrights by ACcESS Australia 2004,2005 */
23 /* Author: gross@access.edu.au */
24
25 /**************************************************************/
26
27 #include "Paso.h"
28 #include "Options.h"
29
30 /**************************************************************/
31
32 index_t Paso_Options_getSolver(index_t solver,index_t package, bool_t symmetry) {
33 index_t out=PASO_DEFAULT;
34 /* PASO */
35 if (package==PASO_PASO) {
36 switch (solver) {
37 case PASO_BICGSTAB:
38 out=PASO_BICGSTAB;
39 break;
40 case PASO_PCG:
41 out=PASO_PCG;
42 break;
43 case PASO_PRES20:
44 out=PASO_PRES20;
45 break;
46 case PASO_GMRES:
47 out=PASO_GMRES;
48 break;
49 case PASO_NONLINEAR_GMRES:
50 out=PASO_NONLINEAR_GMRES;
51 break;
52 default:
53 if (symmetry) {
54 out=PASO_PCG;
55 } else {
56 out=PASO_BICGSTAB;
57 }
58 break;
59 }
60 /* SCSL */
61 } else if (package==PASO_SCSL) {
62 switch (solver) {
63 case PASO_PCG:
64 out=PASO_PCG;
65 break;
66 case PASO_CR:
67 out=PASO_CR;
68 break;
69 case PASO_CGS:
70 out=PASO_CGS;
71 break;
72 case PASO_BICGSTAB:
73 out=PASO_BICGSTAB;
74 break;
75 case PASO_ITERATIVE:
76 if (symmetry) {
77 out=PASO_PCG;
78 } else {
79 out=PASO_BICGSTAB;
80 }
81 break;
82 case PASO_CHOLEVSKY:
83 out=PASO_CHOLEVSKY;
84 break;
85 case PASO_DIRECT:
86 out=PASO_DIRECT;
87 break;
88 default:
89 if (symmetry) {
90 out=PASO_CHOLEVSKY;
91 } else {
92 out=PASO_DIRECT;
93 }
94 break;
95 }
96 /* MKL */
97 } else if (package==PASO_MKL) {
98 switch (solver) {
99 case PASO_CHOLEVSKY:
100 out=PASO_CHOLEVSKY;
101 break;
102 case PASO_DIRECT:
103 out=PASO_DIRECT;
104 break;
105 default:
106 if (symmetry) {
107 out=PASO_CHOLEVSKY;
108 } else {
109 out=PASO_DIRECT;
110 }
111 break;
112 }
113 /* TRILINOS */
114 } else if (package==PASO_TRILINOS) {
115 switch (solver) {
116 case PASO_BICGSTAB:
117 out=PASO_BICGSTAB;
118 break;
119 case PASO_PCG:
120 out=PASO_PCG;
121 break;
122 case PASO_PRES20:
123 out=PASO_PRES20;
124 break;
125 case PASO_GMRES:
126 out=PASO_GMRES;
127 break;
128 default:
129 if (symmetry) {
130 out=PASO_PCG;
131 } else {
132 out=PASO_BICGSTAB;
133 }
134 break;
135 }
136 } else if (package==PASO_UMFPACK) {
137 out=PASO_DIRECT;
138 } else {
139 Paso_setError(VALUE_ERROR,"Unidentified package.");
140 }
141 return out;
142 }
143
144 /*
145 * $Log$
146 * Revision 1.2 2005/09/15 03:44:38 jgs
147 * Merge of development branch dev-02 back to main trunk on 2005-09-15
148 *
149 * Revision 1.1.2.1 2005/09/05 06:29:46 gross
150 * These files have been extracted from finley to define a stand alone libray for iterative
151 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
152 * has not been tested yet.
153 *
154 *
155 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26