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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 480 - (show annotations)
Wed Feb 1 05:15:12 2006 UTC (13 years, 7 months ago) by jgs
Original Path: trunk/escript/src/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4223 byte(s)
rationalise #includes and forward declarations

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 "FunctionSpace.h"
20 #include "SystemMatrixException.h"
21
22 #include <boost/python/dict.hpp>
23
24 //
25 // Forward declaration
26 class Data;
27
28 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 AbstractSystemMatrix();
59
60 AbstractSystemMatrix(const int row_blocksize,
61 const FunctionSpace& row_functionspace,
62 const int column_blocksize,
63 const FunctionSpace& column_functionspace);
64 /**
65 \brief
66 Destructor.
67 */
68 virtual ~AbstractSystemMatrix();
69
70 /**
71 \brief
72 matrix*vector multiplication
73 */
74 Data vectorMultiply(Data& right) const;
75
76 /**
77 \brief
78 returns true if the matrix is empty
79 */
80 int isEmpty() const;
81
82 /**
83 \brief
84 returns the column function space
85 */
86 inline FunctionSpace getColumnFunctionSpace() const
87 {
88 if (isEmpty())
89 throw SystemMatrixException("Error - Matrix is empty.");
90 return m_column_functionspace;
91 }
92
93 /**
94 \brief
95 returns the row function space
96 */
97 inline FunctionSpace getRowFunctionSpace() const
98 {
99 if (isEmpty())
100 throw SystemMatrixException("Error - Matrix is empty.");
101 return m_row_functionspace;
102 }
103
104 /**
105 \brief
106 returns the row block size
107 */
108 inline int getRowBlockSize() const
109 {
110 if (isEmpty())
111 throw SystemMatrixException("Error - Matrix is empty.");
112 return m_row_blocksize;
113 }
114
115 /**
116 \brief
117 returns the column block size
118 */
119 inline int getColumnBlockSize() const
120 {
121 if (isEmpty())
122 throw SystemMatrixException("Error - Matrix is empty.");
123 return m_column_blocksize;
124 }
125
126 /**
127 \brief
128 returns the solution u of the linear system this*u=in
129 */
130 Data solve(Data& in,const boost::python::dict& options) const;
131
132 /**
133 \brief writes the matrix to a file using the Matrix Market file format
134 */
135 virtual void saveMM(const std::string& fileName) const;
136
137 /**
138 \brief writes the matrix to a file using the Harwell-Boeing file format
139 */
140 virtual void saveHB(const std::string& fileName) const;
141
142 /**
143 \brief resets the matrix entries
144 */
145 virtual void resetValues() const;
146
147 protected:
148
149 private:
150
151 /**
152 \brief
153 solves the linear system this*out=in
154 */
155 virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;
156
157 /**
158 \brief
159 performs y+=this*x
160 */
161 virtual void ypAx(Data& y,Data& x) const;
162
163 int m_empty;
164 int m_column_blocksize;
165 int m_row_blocksize;
166 FunctionSpace m_column_functionspace;
167 FunctionSpace m_row_functionspace;
168
169 };
170
171 Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
172
173
174
175 } // end of namespace
176 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26