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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 584 - (show annotations)
Thu Mar 9 23:03:38 2006 UTC (13 years, 7 months ago) by gross
File MIME type: text/plain
File size: 3050 byte(s)
eigenvalues: compiles and passes tests on altix now
1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* Paso: interface to the direct solvers */
6
7 /**************************************************************/
8
9 /* Copyrights by ACcESS Australia 2003 */
10 /* Author: gross@access.edu.au */
11
12 /**************************************************************/
13
14 #include "Paso.h"
15 #include "performance.h"
16 #include "Solvers/Solver.h"
17
18 #ifdef SCSL
19 #include "SCSL.h"
20 #endif
21
22 #ifdef MKL
23 #include "MKL.h"
24 #endif
25
26 #ifdef UMFPACK
27 #include "UMFPACK.h"
28 #endif
29
30 /**************************************************************/
31
32 void Paso_solve(Paso_SystemMatrix* A,
33 double* out,
34 double* in,
35 Paso_Options* options) {
36 Paso_Performance pp;
37 Paso_resetError();
38 if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {
39 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
40 return;
41 }
42 Performance_open(&pp,options->verbose);
43 index_t package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
44 if (Paso_noError()) {
45 switch(package) {
46
47 case PASO_PASO:
48 Paso_Solver(A,out,in,options,&pp);
49 if (Paso_noError()) A->solver_package=PASO_PASO;
50 break;
51
52 #ifdef SCSL
53 case PASO_SCSL:
54 Paso_SCSL(A,out,in,options,&pp);
55 if (Paso_noError()) A->solver_package=PASO_SCSL;
56 break;
57 #endif
58
59
60 #ifdef MKL
61 case PASO_MKL:
62 Paso_MKL(A,out,in,options,&pp);
63 if (Paso_noError()) A->solver_package=PASO_MKL;
64 break;
65 #endif
66
67 /*
68 case PASO_UMFPACK:
69 Paso_UMFPACK(A,out,in,options);
70 if (Paso_noError()) A->solver_package=PASO_UMFPACK;
71 break;
72 */
73
74 default:
75 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
76 break;
77 }
78 }
79 Performance_close(&pp,options->verbose);
80 return;
81 }
82
83 /* free memory possibly resereved for a recall */
84
85 void Paso_solve_free(Paso_SystemMatrix* in) {
86 switch(in->solver_package) {
87
88 case PASO_PASO:
89 Paso_Solver_free(in);
90 break;
91
92 #ifdef SCSL
93 case PASO_SCSL:
94 Paso_SCSL_free(in);
95 break;
96 #endif
97
98
99 #ifdef MKL
100 case PASO_MKL:
101 Paso_MKL_free(in);
102 break;
103 #endif
104
105 /*
106 case PASO_UMFPACK:
107 Paso_UMFPACK_free(in);
108 break;
109 */
110 }
111 }
112 /*
113 * $Log$
114 * Revision 1.2 2005/09/15 03:44:39 jgs
115 * Merge of development branch dev-02 back to main trunk on 2005-09-15
116 *
117 * Revision 1.1.2.2 2005/09/07 00:59:08 gross
118 * some inconsistent renaming fixed to make the linking work.
119 *
120 * Revision 1.1.2.1 2005/09/05 06:29:49 gross
121 * These files have been extracted from finley to define a stand alone libray for iterative
122 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
123 * has not been tested yet.
124 *
125 *
126 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26