/[escript]/branches/doubleplusgood/paso/src/Options_getSolver.cpp
ViewVC logotype

Contents of /branches/doubleplusgood/paso/src/Options_getSolver.cpp

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26