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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3358 - (show annotations)
Wed Nov 17 08:02:32 2010 UTC (8 years, 9 months ago) by gross
File MIME type: text/plain
File size: 1894 byte(s)
a more flexiblae version of safeDiv
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 matrix format requested by a particular linear solver */
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 #include "SystemMatrix.h"
29
30 /**************************************************************/
31
32 index_t Paso_SystemMatrix_getSystemMatrixTypeId(const index_t solver,const index_t preconditioner, const index_t package,const bool_t symmetry, Esys_MPIInfo *mpi_info) {
33 index_t true_package;
34 index_t out=MATRIX_FORMAT_DEFAULT;
35 true_package=Paso_Options_getPackage(solver,package,symmetry, mpi_info);
36
37 switch(true_package) {
38
39 case PASO_PASO:
40 out=MATRIX_FORMAT_DEFAULT;
41 break;
42
43
44 case PASO_MKL:
45 out=MATRIX_FORMAT_BLK1 + MATRIX_FORMAT_OFFSET1;
46 break;
47
48 case PASO_UMFPACK:
49 if (mpi_info->size > 1) {
50 Esys_setError(VALUE_ERROR,"The selected solver UMFPACK requires CSC format which is not supported with MPI.");
51 return -1;
52 }
53 out=MATRIX_FORMAT_CSC + MATRIX_FORMAT_BLK1;
54 break;
55
56 case PASO_TRILINOS:
57 out=MATRIX_FORMAT_TRILINOS_CRS + MATRIX_FORMAT_BLK1; /* Distributed CRS */
58 break;
59
60 default:
61 Esys_setError(VALUE_ERROR,"unknown package code");
62 }
63 return out;
64 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26