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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 425 - (hide annotations)
Tue Jan 10 04:10:39 2006 UTC (13 years, 9 months ago) by gross
File MIME type: text/plain
File size: 2907 byte(s)
The sparse solver can be called by paso now. 

the building has been change to reduce some code redundancy:
now all scons SCscripts are importing scons/esys_options.py which
imports platform specific settings. 



1 jgs 150 /* $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 "Solvers/Solver.h"
16    
17     #ifdef SCSL
18 gross 411 #include "SCSL.h"
19 jgs 150 #endif
20    
21     #ifdef MKL
22 gross 411 #include "MKL.h"
23 jgs 150 #endif
24    
25     #ifdef UMFPACK
26 gross 411 #include "UMFPACK.h"
27 jgs 150 #endif
28    
29     /**************************************************************/
30    
31     void Paso_solve(Paso_SystemMatrix* A,
32     double* out,
33     double* in,
34     Paso_Options* options) {
35    
36     Paso_resetError();
37     if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {
38 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
39 jgs 150 return;
40     }
41     index_t package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
42     if (Paso_noError()) {
43     switch(package) {
44    
45     case PASO_PASO:
46     Paso_Solver(A,out,in,options);
47 gross 425 if (Paso_noError()) A->solver_package=PASO_PASO;
48 jgs 150 break;
49    
50     #ifdef SCSL
51     case PASO_SCSL:
52     Paso_SCSL(A,out,in,options);
53 gross 425 if (Paso_noError()) A->solver_package=PASO_SCSL;
54 jgs 150 break;
55     #endif
56    
57 gross 425
58     #ifdef MKL
59 jgs 150 case PASO_MKL:
60     Paso_MKL(A,out,in,options);
61 gross 425 if (Paso_noError()) A->solver_package=PASO_MKL;
62 jgs 150 break;
63 gross 425 #endif
64 jgs 150
65     /*
66     case PASO_UMFPACK:
67     Paso_UMFPACK(A,out,in,options);
68 gross 425 if (Paso_noError()) A->solver_package=PASO_UMFPACK;
69 jgs 150 break;
70     */
71    
72     default:
73 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
74 jgs 150 return;
75     }
76     }
77     return;
78     }
79    
80     /* free memory possibly resereved for a recall */
81    
82     void Paso_solve_free(Paso_SystemMatrix* in) {
83 gross 425 switch(in->solver_package) {
84    
85     case PASO_PASO:
86 jgs 150 Paso_Solver_free(in);
87 gross 425 break;
88    
89     #ifdef SCSL
90     case PASO_SCSL:
91 jgs 150 Paso_SCSL_free(in);
92 gross 425 break;
93     #endif
94    
95    
96     #ifdef MKL
97     case PASO_MKL:
98     Paso_MKL_free(in);
99     break;
100     #endif
101    
102     /*
103     case PASO_UMFPACK:
104     Paso_UMFPACK_free(in);
105     break;
106     */
107     }
108 jgs 150 }
109     /*
110     * $Log$
111     * Revision 1.2 2005/09/15 03:44:39 jgs
112     * Merge of development branch dev-02 back to main trunk on 2005-09-15
113     *
114     * Revision 1.1.2.2 2005/09/07 00:59:08 gross
115     * some inconsistent renaming fixed to make the linking work.
116     *
117     * Revision 1.1.2.1 2005/09/05 06:29:49 gross
118     * These files have been extracted from finley to define a stand alone libray for iterative
119     * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
120     * has not been tested yet.
121     *
122     *
123     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26