/[escript]/branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h
ViewVC logotype

Annotation of /branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 615 - (hide annotations)
Wed Mar 22 02:12:00 2006 UTC (13 years, 5 months ago) by elspeth
Original Path: trunk/escript/src/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 3902 byte(s)
More copyright information.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26