/[escript]/trunk/escript/src/AbstractTransportProblem.h
ViewVC logotype

Annotation of /trunk/escript/src/AbstractTransportProblem.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (hide annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 4 months ago) by woo409
Original Path: trunk/escript/src/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4212 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

1 jgs 102 // $Id$
2 jgs 82 /*
3 elspeth 615 ************************************************************
4     * Copyright 2006 by ACcESS MNRF *
5     * *
6     * http://www.access.edu.au *
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     ************************************************************
12    
13 jgs 82 */
14 jgs 480
15 jgs 82 #if !defined escript_AbstractSystemMatrix_20040628_H
16     #define escript_AbstractSystemMatrix_20040628_H
17 woo409 757 #include "system_dep.h"
18 jgs 82
19 jgs 474 #include "FunctionSpace.h"
20     #include "SystemMatrixException.h"
21    
22 jgs 82 #include <boost/python/dict.hpp>
23    
24 jgs 480 //
25     // Forward declaration
26     class Data;
27    
28 jgs 82 namespace escript {
29    
30     /**
31     \brief
32     Give a short description of what AbstractSystemMatrix does.
33    
34     Description:
35     Give a detailed description of AbstractSystemMatrix
36    
37     Template Parameters:
38     For templates describe any conditions that the parameters used in the
39     template must satisfy
40     */
41     class AbstractSystemMatrix {
42    
43     public:
44    
45     /**
46     \brief
47     Default constructor for AbstractSystemMatrix
48    
49     Description:
50     Default constructor for AbstractSystemMatrix
51    
52     Preconditions:
53     Describe any preconditions
54    
55     Throws:
56     Describe any exceptions thrown
57     */
58 woo409 757 ESCRIPT_DLL_API
59 jgs 82 AbstractSystemMatrix();
60    
61 woo409 757 ESCRIPT_DLL_API
62 jgs 82 AbstractSystemMatrix(const int row_blocksize,
63     const FunctionSpace& row_functionspace,
64     const int column_blocksize,
65     const FunctionSpace& column_functionspace);
66     /**
67     \brief
68     Destructor.
69     */
70 woo409 757 ESCRIPT_DLL_API
71 jgs 82 virtual ~AbstractSystemMatrix();
72    
73     /**
74     \brief
75     matrix*vector multiplication
76     */
77 woo409 757 ESCRIPT_DLL_API
78 jgs 153 Data vectorMultiply(Data& right) const;
79 jgs 82
80     /**
81     \brief
82     returns true if the matrix is empty
83     */
84 woo409 757 ESCRIPT_DLL_API
85 jgs 82 int isEmpty() const;
86    
87     /**
88     \brief
89     returns the column function space
90     */
91 woo409 757 ESCRIPT_DLL_API
92 jgs 82 inline FunctionSpace getColumnFunctionSpace() const
93     {
94     if (isEmpty())
95     throw SystemMatrixException("Error - Matrix is empty.");
96     return m_column_functionspace;
97     }
98    
99     /**
100     \brief
101     returns the row function space
102     */
103 woo409 757 ESCRIPT_DLL_API
104 jgs 82 inline FunctionSpace getRowFunctionSpace() const
105     {
106     if (isEmpty())
107     throw SystemMatrixException("Error - Matrix is empty.");
108     return m_row_functionspace;
109     }
110    
111     /**
112     \brief
113     returns the row block size
114     */
115 woo409 757 ESCRIPT_DLL_API
116 jgs 82 inline int getRowBlockSize() const
117     {
118     if (isEmpty())
119     throw SystemMatrixException("Error - Matrix is empty.");
120     return m_row_blocksize;
121     }
122    
123     /**
124     \brief
125     returns the column block size
126     */
127 woo409 757 ESCRIPT_DLL_API
128 jgs 82 inline int getColumnBlockSize() const
129     {
130     if (isEmpty())
131     throw SystemMatrixException("Error - Matrix is empty.");
132     return m_column_blocksize;
133     }
134    
135     /**
136     \brief
137     returns the solution u of the linear system this*u=in
138     */
139 woo409 757 ESCRIPT_DLL_API
140 jgs 153 Data solve(Data& in,const boost::python::dict& options) const;
141 jgs 82
142 jgs 102 /**
143     \brief writes the matrix to a file using the Matrix Market file format
144     */
145 woo409 757 ESCRIPT_DLL_API
146 jgs 102 virtual void saveMM(const std::string& fileName) const;
147 jgs 123
148 jgs 102 /**
149 jgs 123 \brief writes the matrix to a file using the Harwell-Boeing file format
150     */
151 woo409 757 ESCRIPT_DLL_API
152 jgs 123 virtual void saveHB(const std::string& fileName) const;
153    
154     /**
155 jgs 149 \brief resets the matrix entries
156 jgs 102 */
157 woo409 757 ESCRIPT_DLL_API
158 jgs 149 virtual void resetValues() const;
159 jgs 102
160 jgs 82 protected:
161    
162     private:
163    
164     /**
165     \brief
166     solves the linear system this*out=in
167     */
168 woo409 757 ESCRIPT_DLL_API
169 jgs 153 virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;
170 jgs 82
171     /**
172     \brief
173     performs y+=this*x
174     */
175 woo409 757 ESCRIPT_DLL_API
176 jgs 153 virtual void ypAx(Data& y,Data& x) const;
177 jgs 82
178     int m_empty;
179     int m_column_blocksize;
180     int m_row_blocksize;
181     FunctionSpace m_column_functionspace;
182     FunctionSpace m_row_functionspace;
183    
184     };
185    
186 woo409 757 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
187 jgs 82
188    
189    
190     } // end of namespace
191     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26