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

Contents of /trunk/escript/src/AbstractSystemMatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (show annotations)
Fri Jul 8 04:08:13 2005 UTC (13 years, 9 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4471 byte(s)
Merge of development branch back to main trunk on 2005-07-08

1 // $Id$
2 /*
3 ******************************************************************************
4 * *
5 * COPYRIGHT ACcESS 2004 - All Rights Reserved *
6 * *
7 * This software is the property of ACcESS. No part of this code *
8 * may be copied in any form or by any means without the expressed written *
9 * consent of ACcESS. Copying, use or modification of this software *
10 * by any unauthorised person is illegal unless that person has a software *
11 * license agreement with ACcESS. *
12 * *
13 ******************************************************************************
14 */
15
16 #if !defined escript_AbstractSystemMatrix_20040628_H
17 #define escript_AbstractSystemMatrix_20040628_H
18
19 #include "escript/Data/FunctionSpace.h"
20 #include "escript/Data/SystemMatrixException.h"
21 #include "escript/Data/Data.h"
22 #include <boost/python/dict.hpp>
23
24 namespace escript {
25
26 /**
27 \brief
28 Give a short description of what AbstractSystemMatrix does.
29
30 Description:
31 Give a detailed description of AbstractSystemMatrix
32
33 Template Parameters:
34 For templates describe any conditions that the parameters used in the
35 template must satisfy
36 */
37 class AbstractSystemMatrix {
38
39 public:
40
41 /**
42 \brief
43 Default constructor for AbstractSystemMatrix
44
45 Description:
46 Default constructor for AbstractSystemMatrix
47
48 Preconditions:
49 Describe any preconditions
50
51 Throws:
52 Describe any exceptions thrown
53 */
54 AbstractSystemMatrix();
55
56 AbstractSystemMatrix(const int row_blocksize,
57 const FunctionSpace& row_functionspace,
58 const int column_blocksize,
59 const FunctionSpace& column_functionspace);
60 /**
61 \brief
62 Destructor.
63 */
64 virtual ~AbstractSystemMatrix();
65
66 /**
67 \brief
68 matrix*vector multiplication
69 */
70 Data vectorMultiply(const Data& right) const;
71
72 /**
73 \brief
74 returns true if the matrix is empty
75 */
76 int isEmpty() const;
77
78 /**
79 \brief
80 returns the column function space
81 */
82 inline FunctionSpace getColumnFunctionSpace() const
83 {
84 if (isEmpty())
85 throw SystemMatrixException("Error - Matrix is empty.");
86 return m_column_functionspace;
87 }
88
89 /**
90 \brief
91 returns the row function space
92 */
93 inline FunctionSpace getRowFunctionSpace() const
94 {
95 if (isEmpty())
96 throw SystemMatrixException("Error - Matrix is empty.");
97 return m_row_functionspace;
98 }
99
100 /**
101 \brief
102 returns the row block size
103 */
104 inline int getRowBlockSize() const
105 {
106 if (isEmpty())
107 throw SystemMatrixException("Error - Matrix is empty.");
108 return m_row_blocksize;
109 }
110
111 /**
112 \brief
113 returns the column block size
114 */
115 inline int getColumnBlockSize() const
116 {
117 if (isEmpty())
118 throw SystemMatrixException("Error - Matrix is empty.");
119 return m_column_blocksize;
120 }
121
122 /**
123 \brief
124 returns the solution u of the linear system this*u=in
125 */
126 Data solve(const Data& in,const boost::python::dict& options) const;
127
128 /**
129 \brief writes the matrix to a file using the Matrix Market file format
130 */
131 virtual void saveMM(const std::string& fileName) const;
132
133 /**
134 \brief writes the matrix to a file using the Harwell-Boeing file format
135 */
136 virtual void saveHB(const std::string& fileName) const;
137
138 /**
139 \brief sets the matrix entries to value
140 */
141 virtual void setValue(const double value) const;
142
143 /**
144 \brief cleans any setting, allocations by the solver.
145 */
146 virtual void resetSolver() const;
147
148
149 protected:
150
151 private:
152
153 /**
154 \brief
155 solves the linear system this*out=in
156 */
157 virtual void setToSolution(Data& out,const Data& in,const boost::python::dict& options) const;
158
159 /**
160 \brief
161 performs y+=this*x
162 */
163 virtual void ypAx(Data& y,const Data& x) const;
164
165 int m_empty;
166 int m_column_blocksize;
167 int m_row_blocksize;
168 FunctionSpace m_column_functionspace;
169 FunctionSpace m_row_functionspace;
170
171 };
172
173 Data operator*(const AbstractSystemMatrix& left, const Data& right) ;
174
175
176
177 } // end of namespace
178 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26